Solve one nonlinear algebraic equation.
To numerically solve the nonlinear equation x^2 - cos(x) = 0, type
Variable x
Solve( x^2 - cos(x) = 0, x = 0.2 ) % x = 0.2 is a guess.
As shown in the plot to the right, this nonlinear equation has two solutions.
In general, nonlinear equations have an unknown number of solutions (0, 1, 2, 9, ...).
The
Solve command frequently converges to a solution close to the starting guess.
|
If you guess
|
x = 0.2,
|
Solves to x = 0.82413
|
|
If you guess
|
x = -9,
|
Solves to x = -0.82413
|
To
save commands (for subsequent re-use) or commands/responses, type