Get started: Sample mathematics
Type Help MathFunctions for an extensive list of built-in mathematical functions.
To define i  as -1,  and do math with real and complex numbers, type
SetImaginaryNumber( i ) someNumber = sin(pi/4) + exp(3) + abs(-3) + sqrt(i) -> someNumber = 24.49975 + 0.7071068*i
Use the Expand command to eliminate parentheses, e.g.,
p = Expand( (1+t) * (2+t) * (3+t^2) ) -> p = 6 + 9*t + t^4 + 3*t^3 + 5*t^2
To evaluatep  at t = 2.3,  issue the command
p23 = Evaluate( p, t = 2.3 ) -> p23 = 117.6351
To determine the ordinary time-derivative of p, type
pDt = Dt( p ) -> pDt = 9 + 10*t + 4*t^3 + 9*t^2
pDt is a 3rd-order polynomial in t. Its 3 roots are calculated with
roots = GetCubicRoots( pDt = 0, t ) -> roots = [-1.5704; -0.3398 - 1.1477*i; -0.3398 + 1.1477*i]
To save commands (for subsequent re-use) or commands/responses, type
Save MGMathExampleA.txt % Save commands. Save MGMathExampleA.html % Save commands and responses.
Exit the program by typing Quit.
Various other mathematical commands
Command file MGMathExampleB.txt
Output responses MGMathExampleB.html
MotionGenesis™ also does matrix algebra, solves sets of linear equations (symbolically or numerically), and numerically solves sets of nonlinear equations.