GenerateSimilar - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

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

5cosx735ⅇ4x2+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+11y24y+3

(12)

factorrational2

y8

(13)

Singular matrices return singular matrices.

withLinearAlgebra:

DeterminantMatrix3,3,2,4,6,2,0,2,6,8,14

0

(14)

matrix1GenerateSimilarMatrix3,3,2,4,6,2,0,2,6,8,14

matrix103−3−206−16−3

(15)

Determinantmatrix1

0

(16)

Diagonal matrices return diagonal matrices.

matrix2Matrix3,3,1,0,0,0,2,0,0,0,7

matrix21000−20007

(17)

GenerateSimilarmatrix2

4000−10005

(18)

Upper triangular matrices return upper triangular matrices.

matrix3Matrix3,3,2,4,3,0,5,7,0,0,6

matrix32−4305700−6

(19)

GenerateSimilarmatrix3

99207800−9

(20)

Lower triangular matrices return lower triangular matrices.

matrix4Matrix3,3,3,0,0,1,5,0,7,10,3

matrix4300−150710−3

(21)

GenerateSimilarmatrix4

1000770310−1

(22)

Symmetric matrices return symmetric matrices.

matrix5Matrix3,3,1,9,7,9,π,3,7,3,2

matrix51−97−9π3732

(23)

GenerateSimilarmatrix5

5−22−25π61214

(24)

Hermitian matrices return hermitian matrices.

matrix6Matrix3,3,2,I,7+2I,I,3,84I,72I,8+4I,1

matrix62−I7+2II384I72I8+4I1

(25)

GenerateSimilarmatrix6

53I83I3I463I8+3I6+3I9

(26)

Skew-symmetric matrices return skew-symmetric matrices.

matrix7Matrix3,3,0,1,4,1,0,7,4,7,0

matrix701−4−1074−70

(27)

GenerateSimilarmatrix7

0−3630−4−640

(28)

If the matrix doesn't fall into one of the above categories GenerateSimilar is mapped to every element in the matrix

matrix8Matrix3,3,1,3,x,sinx,2,lnx2,6,3.1,45

matrix813xsinx−2lnx2−63.145

(29)

GenerateSimilarmatrix8

618x+77cos9x+6−109ln2x2+4x−99.013

(30)

Integration technique: u substitution.

GenerateSimilar%int2x+2expx2+2x+7,x

12x4ⅇ6x24x9ⅆx

(31)

Integration technique: partial fractions.

GenerateSimilar%intx+7x24,x

x+5x2+6x7ⅆx

(32)

Integration technique: trig substitution.

GenerateSimilar%intsqrtx2+1,x

6x2+6ⅆx

(33)

GenerateSimilar%intxsqrtx4+1,x

8x4+5xⅆx

(34)

GenerateSimilar%intsqrtexp2x+1,x

ⅇ2x+3ⅆx

(35)

Integration technique: integration by parts.

GenerateSimilar%intxlnx,x

2x3lnx+3ⅆx

(36)

GenerateSimilar%int2x33x2lnx2,x

4x3+9x2lnx3ⅆx

(37)

GenerateSimilar%intxexpx,x

8xⅇ6xⅆx

(38)

GenerateSimilar%intxcosx,x

600xcos2xⅆx

(39)

GenerateSimilar%intexpxcosx,x

27ⅇ2xcos7xⅆx

(40)

GenerateSimilar%intarccosx,x

arccos6x+6ⅆx

(41)

Integration resulting in an erf function will give back integration resulting in an erf function.

simplify%intexpx2,x

ⅇx2ⅆx

(42)

integral1GenerateSimilar%intexpx2,x

integral1ⅇ3x2+3ⅆx

(43)

simplifyintegral1

ⅇ3x1x+1ⅆx

(44)

Integration resulting in an Si function will give back integration resulting in an Si function.

simplify%intsinxx,x

sinxxⅆx

(45)

integral2GenerateSimilar%intsinxx,x

integral27sin9x754x+42ⅆx

(46)

simplifyintegral2

7sin9x79x7ⅆx6

(47)

Integration that results in an arctan function will give back integration resulting in an arctan function.

simplify%int1x2+1,x

1x2+1ⅆx

(48)

integral3GenerateSimilar%int1x2+1,x

integral334x23ⅆx

(49)

simplifyintegral3

314x2+3ⅆx

(50)

A double integral will produce a double integral;

integral14%int%intsinxcosy,y=0..π,x=π2..π

integral14π2π0πsinxcosyⅆyⅆx

(51)

GenerateSimilarintegral14

3π42ππ3059π60432cos10xcos9yⅆyⅆx

(52)

A polynomial equation will produce a polynomial equation. If the input equation has integer roots the output equation will have integer roots.

equation1x2+x9=2x3

equation1x2+x9=2x3

(53)

solveequation1

3,−2

(54)

newEquation1GenerateSimilarequation1

newEquation1x2+4x38=x+2

(55)

solvenewEquation1

5,−8

(56)

Radical equations with rational solutions will produce radical equations with rational solutions or no solutions.

equation2sqrt3x2+10x5=0

equation23x2+10x5=0

(57)

solveequation2

53,−5

(58)

newEquation2GenerateSimilarequation2

newEquation210=x27x+110

(59)

solvenewEquation2

5,2

(60)

equation3sqrt2x2x+3sqrtx22x+9=1

equation32x2x+3x22x+9=1

(61)

solveequation3

2,−3

(62)

newEquation3GenerateSimilarequation3

newEquation312x30x2+6x+10=1

(63)

solvenewEquation3

−10,4

(64)

equation4sqrt2x2x3=sqrtx22x+9

equation42x2x3=x22x+9

(65)

solveequation4

3,−4

(66)

newEquation4GenerateSimilarequation4

newEquation43x2+15x+5=4x2+7x11

(67)

solvenewEquation4

−4

(68)

equation52x=sqrtx+3

equation52x=x+3

(69)

solveequation5

1

(70)

newEquation5GenerateSimilarequation5

newEquation52x=14x10

(71)

solvenewEquation5

1,52

(72)

equation62xsqrtx+3=1

equation62xx+3=1

(73)

solveequation6

1

(74)

newEquation6GenerateSimilarequation6

newEquation62x14x299x10=1

(75)

solvenewEquation6

10

(76)

equation712x=1sqrtx+3

equation712x=1x+3

(77)

solveequation7

1

(78)

newEquation7GenerateSimilarequation7

newEquation717x=157x22x10

(79)

solvenewEquation7

54

(80)

equation81+sqrt1x=sqrt2x+4

equation81+1x=2x+4

(81)

solveequation8

0

(82)

newEquation8GenerateSimilarequation8

newEquation81+8x=1+4x1

(83)

solvenewEquation8

54,14

(84)

Trig equations in forms that can be solved without a calculator produce trig equations that can be solved without a calculator.

equation9cosx2+cosx=0

equation9cosx2+cosx=0

(85)

solveequation9

π,π2

(86)

newEquation9GenerateSimilarequation9

newEquation93cos7x+42cos7x+432=3

(87)

solvenewEquation9

47+5π42,47+π14

(88)

equation10cosx2+cosx=sinx2

equation10cosx2+cosx=sinx2

(89)

solveequation10

π,π3

(90)

newEquation10GenerateSimilarequation10

newEquation105cos6x223=sin6x22

(91)

solvenewEquation10

13+π24,13+π8

(92)

equation11cosx+sinx=0

equation11cosx+sinx=0

(93)

solveequation11

π4

(94)

newEquation11GenerateSimilarequation11

newEquation11cosx+6=sinx+6

(95)

solvenewEquation11

6+π4

(96)

Logarithmic equations that are easily solvable without a calculator return logarithmic equations that can be easily solved without a calculator.

equation12lnx1+ln2x1=2lnx+1

equation12lnx1+ln2x1=2lnx+1

(97)

solveequation12

5

(98)

newEquation12GenerateSimilarequation12

newEquation12ln2x2+7x+16=2lnx+4

(99)

solvenewEquation12

0,1

(100)

equation13%log3x1+%log32x1=2%log3x+1

equation13log3x1+log32x1=2log3x+1

(101)

solveInertForm:-Valueequation13

5

(102)

newEquationGenerateSimilarequation13

newEquationlog413x+4=2log4x2

(103)

solvenewEquation13

0

(104)

Exponential equations that can be easily solved without a calculator return exponential equations that can be easily solved without a calculator.

equation14expcosx2=expcosxexpsinx2

equation14ⅇcosx2=ⅇcosxⅇsinx2

(105)

solveequation14

π,π3,π3

(106)

newEquation14GenerateSimilarequation14

newEquation14ⅇ2cos2x+322sin2x+324cos2x+31=ⅇ2cos2x+3+2ⅇ2cos2x+323cos2x+34

(107)

solvenewEquation14

32+π2,32+π3

(108)

Complex polynomial equations with roots that have integer real and imaginary parts produce complex polynomial equations with integer real and imaginary roots.

equation15z2+9+4Iz+418I=0

equation15z2+−9+4Iz+418I=0

(109)

solveequation15

82I,12I

(110)

newEquation15GenerateSimilarequation15

newEquation15z2+9zIz+8+21I=0

(111)

solvenewEquation15

−12I,10+I

(112)

Absolute value equations produce absolute value equations.

equation16absx3=abs53x

equation16x3=3x5

(113)

solveequation16

2,1

(114)

newEquation16GenerateSimilarequation16

newEquation163x=x+4

(115)

solvenewEquation16

−1,2

(116)

equation17absx2+2x=15

equation17x2+2x=15

(117)

solveequation17

−5,3

(118)

newEquation17GenerateSimilarequation17

newEquation17x214x+33=12

(119)

solvenewEquation17

727,7+27,5,9

(120)

Equations of circles return equations of circles.

equation18x32+y+42=16

equation18x32+y+42=16

(121)

plots:-implicitplotequation18,x=20..20,y=20..20

newEquation18GenerateSimilarequation18

newEquation18x92+y+102=25

(122)

plots:-implicitplotnewEquation18,x=20..20,y=20..20

Equations of ellipses return equations of ellipses.

equation19x224+y+329=1

equation19x224+y+329=1

(123)

plots:-implicitplotequation19,x=20..20,y=20..20

newEquation19GenerateSimilarequation19

newEquation19x32100+y+1249=1

(124)

plots:-implicitplotnewEquation19,x=20..20,y=20..20

Equations of hyperbolas return equations of hyperbolas.

equation20x224y+5216=1

equation20x224y+5216=1

(125)

plots:-implicitplotequation20,x=20..20,y=20..20

newEquation20GenerateSimilarequation20

newEquation20x102100y+8281=1

(126)

plots:-implicitplotnewEquation20,x=20..20,y=20..20

Probability of measuring less than a certain amount of successes from a binomial distribution.

GenerateSimilar%sum8!8x!x!14x348x,x=0..4

x=075040310x7107x7x!x!

(127)

Probability of measuring more than a certain amount of successes from a binomial distribution.

GenerateSimilar%sum8!8x!x!14x348x,x=4..8

x=242467x174x4x!x!

(128)

Expectation value of a binomial distribution.

GenerateSimilar%sumx8!8x!x!14x348x,x=0..8

x=0512025x35x+5xx+5!x!

(129)

Probability of measuring an event of a poisson distribution within a certain amount of time.

GenerateSimilar%sumexp55xx!,x=0..10

x=058ⅇ−44xx!

(130)

Probability of not measuring an event of a poisson distribution within a certain amount of time.

GenerateSimilar%sumexp55xx!,x=10..

x=69ⅇ−44xx!

(131)

Expectation value of a poisson distribution.

GenerateSimilar%sumxexp55xx!,x=0..

x=0ⅇ−66xxx!

(132)

Probability of measuring the time between poisson events to be less than a certain value.

GenerateSimilar%int5exp5x,x=0..10

0374ⅇ4xⅆx

(133)

Probability of measuring the time between poisson events to be more than a certain value.

GenerateSimilar%int5exp5x,x=10..

528ⅇ8xⅆx

(134)

Expectation value of an exponential distribution.

GenerateSimilar%intx5exp5x,x=0..

06ⅇ6xxⅆx

(135)

Probability of measuring less than a certain value for a gaussian distribution.

GenerateSimilar%int1%sqrt2π2expx428,x=..0

0ⅇx229872πⅆx

(136)

Probability of measuring more than a certain value for a gaussian distribution.

GenerateSimilar%int1%sqrt2π2expx428,x=0..

0ⅇx62200102πⅆx

(137)

Expectation value of a gaussian distribution.

GenerateSimilar%intx%sqrt2π2expx428,x=..

ⅇx6232x42πⅆx

(138)

Parametrization of a circle returns a parametrization of a circle.

plot2cost4,2sint+1,t=0..2π

newCircleGenerateSimilar2cost4,2sint+1

newCirclecos9t8sin9t+7

(139)

plotnewCircle1,newCircle2,t=0..2π

Parametrization of an ellipse returns a parametrization of an ellipse.

plot2cost4,3sint+1,t=0..2π

newEllipseGenerateSimilar2cost4,3sint+1

newEllipse7cos5t64sin5t+8

(140)

plotnewEllipse1,newEllipse2,t=0..2π

Parametrization of a cycloid returns a parametrization of a cycloid.

plot10t5sint,55cost,t=0..4π

newCycloidGenerateSimilar5t5sint,55cost

newCycloid27t+3sin9t33cos9t

(141)

plotnewCycloid1,newCycloid2,t=0..π

Compatibility

• 

The RandomTools[GenerateSimilar] command was introduced in Maple 2020.

• 

For more information on Maple 2020 changes, see Updates in Maple 2020.

See Also

HowDoI,WorkWithRandomGenerators

InertForm

rand

RandomTools

RandomTools[Generate]

RandomTools[GenerateSimilarODE]

randpoly