num_solve INDEX

NUM_SOLVE _ _ _ _ _ _ _ _ _ _ _ _ operator

An adaptively damped Newton iteration is used to find an approximative root of a function (function vector) or the solution of an equation (equation system). 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. When 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 complex on, solutions with imaginary parts can be found, if either the expression(s) or the starting point contain a nonzero imaginary part.

syntax:

num_solve(<exp>, <var>[=<val>][,accuracy=<a>][, iterations=<i>])

or

num_solve({<exp>,...,<exp>}, <var>[=<val>],..., <var>[=<val>] [,accuracy=<a>][,iterations=<i>])

or

num_solve({<exp>,...,<exp>}, {<var>[=<val>],... ,<var>[=<val>]} [,accuracy=<a>][,iterations=<i>])

where <exp> are function expressions, <var> are the variables, <val> are optional start values. For <a> and <i> see numeric accuracy.

num_solvetries 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 side effect the shared variable jacobian.

examples:


num_solve({sin x=cos y, x + y = 1},{x=1,y=2});


  {X= - 1.8561957251,Y=2.856195584}


jacobian;

      [COS(X)  SIN(Y)]
      [              ]
      [  1       1   ]