|
To numerically solve the equation
x^2 - cos(x) = 0 for x, type
Variable x Solve( x^2 - cos(x), x = 0.2 )
Nonlinear equations may have multiple solutions.
To save input (for subsequent re-use) and/or
input and output responses, type
|
|
To save input (for subsequent re-use) and/or
input and output responses, type
Save SolveSampleNonlinearEqns.txt
Save SolveSampleNonlinearEqns.all
|
y = A * sin(x) To numerically solve the previous set of nonlinear equations for x and y, type Note: Numerical values for A and R are provided in the Input command. Constant R, A Variable x, y Zero[1] = x^2 + y^2 - R^2 Zero[2] = y - A*sin(x) Input A=1, R=1 Solve( Zero, x=3, y=5 )
To save input (for subsequent re-use) and/or
input and output responses, type
|
|
|
|
|
|
|
|
|
Compile and link source code.
Modify input values in CodeSampleNonlinearEqns.in Note: Compiled code optimizes for its processor. |
|
|
|
Compile and link source code.
Modify input values in CodeSampleNonlinearEqns.in Note: Compiled code optimizes for its processor. |
|
|
|
Invoke MATLABŪ and type load CodeSampleNonlinearEqns
Modify input values in Note: Interpreted .m codes are slower than compiled codes. |
To save input (for subsequent re-use) and/or
input and output responses, type
Save CodeSampleNonlinearEqns.txt
Save CodeSampleNonlinearEqns.all