GenerateSimilar - Maple Help

Online Help

All Products    Maple    MapleSim


RandomTools

  

GenerateSimilar

  

create a random expression similar to the one given

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

GenerateSimilar( expr )

Parameters

expr

-

integer, float, polynomial, or general expression

Description

• 

The GenerateSimilar command produces a new expression that is similar to the given expression expr. The structure and variables in the original expression are preserved, but new constants and coefficients replace the initial ones. The random floating-point numbers and integers in the new expression are the same magnitude as in the original.

• 

Trig functions are not always preserved: sin and cos can switch, sec and csc can switch, and tan and cot can switch. The inverse trig functions are paired and can switch in the same way.

• 

Inputting a polynomial that can be factored and has integer roots returns a polynomial of the same order that can be factored and has integer roots.

• 

If a polynomial is input without integer roots then a polynomial up to the same degree as the input polynomial with random coefficients up to the same order of magnitude as the largest integer in the input expression is returned.

• 

Numerators and denominators of input rational expressions are replaced in the same way as polynomials with the additional feature that if the numerator and denominator have a common root then the returned rational expression also has a shared root in its numerator and denominator.

• 

If a singular square matrix is input then a singular square matrix is output. Inputting upper triangular, lower triangular, diagonal, symmetric, hermitian, or antisymmetric matrices returns the same type. Otherwise the elements of the output matrix are generated individually from each element of the input matrix.

• 

Rational and integer exponents of functions or expressions (other than exponential functions) are preserved.

• 

If an integral is passed into the function then the resultant integral will be solvable using the same integration technique (u substitution, partial fractions, trig substitution, integration by parts).

• 

If an equation is passed into GenerateSimilar then a similar equation is output: radical equations produce radical equations, polynomial equations produce polynomial equations, logarithmic equations produce logarithmic equations, and exponential equations produce exponential equations.

• 

Sums over values of binomial or poisson probability distributions produce sums over values of binomial or poisson probability distributions respectively.

• 

Expectation value of a function over a binomial or poisson probability distribution returns an expectation value of a similar function over a binomial or poisson probability distribution respectively.

• 

Integrals over values of exponential or gaussian probability distributions return integrals over values of exponential or gaussian probability distributions respectively.

• 

Expectation value of a function over an exponential or gaussian probability distribution returns an expectation value of a similar function over an exponential or gaussian probability distribution respectively.

• 

Parametrizations of circles, ellipses and cycloids return parametrizations of circles, ellipses and cycloids.

• 

Differential equations should not be input into GenerateSimilar; for differential equations use GenerateSimilarODE.   

Examples

withRandomTools:

GenerateSimilarx

4x+2

(1)

The cube on the sin function is preserved.

GenerateSimilarsinx3+3expx2

5Typesetting:-_Hold%cosx735Typesetting:-_Hold%exp4x2+3x

(2)

Inputting a factorable polynomial returns a factorable polynomial..

factorr2+r6

r+3r2

(3)

poly1GenerateSimilarr2+r6

poly1r26r16

(4)

factorpoly1

r+2r8

(5)

A polynomial without integer roots returns a polynomial with random coefficients

solver22r+2=0

1+I,1I

(6)

GenerateSimilarr22r+2

r2+r+2

(7)

Factorable numerators and denominators remain factorable and if a factor is shared between the numerator and denominator then the resultant rational function will share a factor between numerator and denominator.

factory21y3

y1y+1y3

(8)

rational1GenerateSimilary21y3

rational1y2+4y3y4

(9)

factorrational1

y1y3y+4

(10)

factory21y+1

y1

(11)

rational2GenerateSimilary21y+1

rational2y2