Up | Next | Prev | PrevTail | Tail |
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. Then the minimum of the sum of absolute squares is located instead.
With oncomplex solutions with imaginary parts can be found, if either the expression(s) or the starting point contain a nonzero imaginary part.
Syntax:
num_solve
(\(\langle \)exp\(_1\)\(\rangle \),\(\langle \)var\(_1\)\(\rangle \)[=val\(_1\)][,accuracy=a][,iterations=i])
or
num_solve
\((\{exp_1,\ldots ,exp_n\}, var_1[=val_1],\ldots ,var_n[=val_n]\)
\([,accuracy=a][,iterations=i])\)
or
num_solve
\((\{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). 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.
Example:
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 ]
Up | Next | Prev | PrevTail | Front |