Solving Equations Numerically
You can use the Solve > Expression command1PET_XA and the NSOLVE and NSOLUTIONS functions to solve an equation dependent on one variable using approximate numerical methods. NSOLVE and NSOLUTIONS cannot solve equations dependent on more than one variable, inequalities, or systems of equations. Functions are defined in the EquationSolving.mth.S02QQ utility file to solve systems of equations dependent on more than one variable using numerical methods.
The NSOLVE and NSOLUTIONS functions always use approximate numerical methods to solve an equation. If Derive is in approximate mode and the functions SOLVE and SOLUTIONS are unable to solve an equation using algebraic methods, they switch to numerical methods to solve the equation.
The solutions returned by NSOLVE and NSOLUTIONS are in the same form as those returned by SOLVE and SOLUTIONS, respectively (see Solving Equations and Inequalities AlgebraicallySolving_Equations_and_Inequalities_Algebraically). In particular, if the third argument is the constant Real, only solutions not involving imaginary numbers are returned. For example,
NSOLVE(x^5 - 2·x^3 + 4·x^2 + 2·x - 3 = 0, x)
simplifies to
x = 1.013396467 - 1.152395734·î ∨
x = 1.013396467 + 1.152395734·î ∨
x = 0.7265501429 ∨
x = -1.753343077 ∨
x = -1
whereas
NSOLVE(x^5 - 2·x^3 + 4·x^2 + 2·x - 3 = 0, x, Real)
simplifies to
x = 0.7265501429 ∨ x = -1.753343077 ∨ x = -1
As the examples above show, given a polynomial equation with numeric coefficients, NSOLVE and NSOLUTIONS return all the real and complex solutions to the equation. However, for any other type of equation, NSOLVE and NSOLUTIONS return only one solution to the equation.
If the third and fourth arguments of NSOLVE and NSOLUTIONS approximate to numbers, the search for a solution is restricted to that interval and only one solution is returned. For example, to find an approximate solution to the equation x·sin(x) = 1 between x=2 and 4, simplify the expression
NSOLVE(x·SIN(x) = 1, x, 2, 4)
If you have no idea where a solution occurs, you can plot the difference in the two sides of the equation to find an interval where the plot crosses or touches the x-axis. To find a solution other than ones already found, specify an interval that excludes the known solutions.
The numerical equation solving commands and functions will find an approximate solution if the difference in the two sides of the equations is continuous and has different signs at the ends of the interval. Even if the equation is discontinuous in the interval or does not have different signs at the ends, these commands and functions usually find a solution if one exists in the interval.
The numerical equation solving commands and functions are normally able to return a solution accurate to the current digits of precision specified in the Precision fieldPrecision_field of the Options > Mode Settings > Simplification command19_L5FP. However, catastrophic cancellation of approximate large magnitude terms can make the difference in the two sides equal 0 even though the approximate solution is not accurate to the current digits of precision.
Rationally factoring the difference in the two sides of an equation (see the Simplify Factor commandU08MH3) before using these commands and functions often results in more accurate solutions obtained more quickly. For example,
NSOLVE((x - pi)^4 = 0, x, 3, 4)
simplifies to x = 3.141592653 which is a good approximation for π, whereas
NSOLVE(x^4 - 4·pi·x^3 + 6·pi^2·x^2 - 4·pi^3·x + pi^4 = 0, x, 3, 4)
simplifies to x = 3.140685047 which is a poor approximation.
Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator