$LastChangedDate$fsolvefind a zero of a system of n nonlinear functionsCalling Sequence[x [,v [,info]]]=fsolve(x0,fct [,fjac] [,tol])Parametersx0real vector (initial value of function argument).fctexternal (i.e function or list or string).fjacexternal (i.e function or list or string).tolreal scalar. precision tolerance: termination occurs when the
algorithm estimates that the relative error between x and the
solution is at most tol. (tol=1.d-10 is the
default value).x :real vector (final value of function argument, estimated
zero).v :real vector (value of function at x).infotermination indicator0improper input parameters.1algorithm estimates that the relative error between x
and the solution is at most tol.2number of calls to fcn reached3tol is too small. No further improvement in the
approximate solution x is possible.4iteration is not making good progress.Descriptionfind a zero of a system of n nonlinear functions in n variables by a
modification of the powell hybrid method. Jacobian may be provided.fct is an "external". This external returns
v=fct(x) given x.The simplest calling sequence for fct is:If fct is a character string, it refers to a C or
Fortran routine which must be linked to Scilab. Fortran calling sequence
must beand C Calling sequence must beIncremental link is possible (help link).jac is an "external". This external returns
v=d(fct)/dx (x) given x.The simplest calling sequence for jac is:If jac is a character string, it refers to a to a
C or Fortran routine which must be linked to Scilab calling sequences are
the same as those for fct. Note however that v must be a nxn array.ExamplesFor some starting points and some equations system, the fsolve method can fail. The fsolve method is a local search method.
So, to have a good chance to find a solution to your equations system, you must ship, a good starting point to fsolve. Here is an example on which fsolve can fail:So, each time you use fsolve, be sure to check the termination indicator and the residual value to see if fsolve has converged.See Alsoexternalqpsolveoptim