| Up | Next | Prev | PrevTail | Tail |
In most cases, an adaptively damped Newton iteration is used to find an approximative zero of a function, a function vector or the solution of an equation or an equation system. Equations are internally converted to a difference of lhs and rhs such that the Newton method (=zero detection) can be applied. The expressions must have continuous derivatives for all variables. A starting point for the iteration can be given. If not given, random values are taken instead. If the number of forms is not equal to the number of variables, the Newton method cannot be applied.
However, if only one variable is involved and the starting point is specified as an interval containing the required solution, then the secant method is used.
With oncomplex solutions with imaginary parts can be found, if either the
expression(s) or the starting point contain a nonzero imaginary part.
Syntax:
\((exp_1, var_1[=val_1][,accuracy=a][,iterations=i])\)
\((exp_1, var_1[=val_1~..~val_2][,accuracy=a][,iterations=i])\)
\((\{exp_1,\ldots ,exp_n\}, var_1[=val_1],\ldots ,var_n[=val_n]\)
\([,accuracy=a][,iterations=i])\)
\((\{exp_1,\ldots ,exp_n\}, \{var_1[=val_1],\ldots ,var_n[=val_n]\}\)
\([,accuracy=a][,iterations=i])\)
where \(exp_1, \ldots , exp_n\) are function expressions,
\(var_1, \ldots , var_n\) are the variables,
\(val_1, \ldots , val_n\) are optional start values.
num_solve tries to find a zero/solution of the expression(s). The result is a list
of equations, where the variables are equated to the coordinates of the result
point.
The Jacobian matrix is stored as a side effect in the shared variable jacobian. This
applies even to a univariate problem, which is treated as a special case of the multivariate
problem (when the Newton method is used).
Examples:
num_solve({sin x = cos y, x + y = 1}, {x = 1, y = 1});
{x= - 1.85619449019,y=2.85619449019}
jacobian;
[cos(x) sin(y)]
[ ]
[ 1 1 ]
num_solve(tan x = 1, x = 0 .. 1);
{x=0.785398163397}
| Up | Next | Prev | PrevTail | Front |