Options (kinsol) Changing the default behavior of solver

## Syntax

                ... = kinsol( ... , options)

## Common options

The default behavior of the solver can be tuned by specifying a sequence of named parameter values. These parameters are the following:

options | A struct with options field names and corresponding values. Specifying the options with a struct allows to use the same options set in different solver calls. Values are overriden by separately setting individual options.
                                        OPT = struct();
                                        OPT.display = "iter";
                                        OPT.tol = 1e-6;
                                        OPT.stepTol = 1e-8;
                                        function F=fun(x)
                                            F = [2*x(1)-x(2)-exp(-x(1))
                                                  -x(1)+2*x(2)-exp(-2*x(2))];
                                        end
                                        x = kinsol(fun, [0 0], options = OPT)
method | The solver method given as a string. kinsol accepts "Newton" (inexact Newton method), "lineSearch" (inexact Newton method with linesearch globalization), "Picard" (Picard iterations), and "fixedPoint" (fixed-point iterations).
maxIters | The maximum number of nonlinear iterations (default is 200).
tol | stopping tolerance on the scaled maximum norm of the system function (default is `%eps^(1/3)`)
stepTol | stopping tolerance on the minimum scaled step length (default is `%eps^(2/3)`).
maxNewtonStep | The maximum length of the Newton step (default is 1000 times the scaled norm of intial guess).
typicalArg | The typical value of system function argument when the latter is close to the solution. This vector is used for scaling the argument components (default is `ones(n,1)`, where n is the number of equations).
typicalF | The typical value of system function when argument is far from the solution. This vector is used for scaling the system function components (default is `ones(n,1)`, where n is the number of equations).
accel | The number of acceleration Anderson vectors in fixed-point or Picard iterations (default is 0).
damping | The damping factor in fixed-point or Picard iterations, must be in ]0,1] (default is 1, which means no damping).
jacUpdateFreq | the maximum number of iterations before updating the Jacobian (default is 10) when using Newton method. Must be a multiple of resMonFreq (see below).
resMonFreq | the maximum number of iterations before checking the residual (default is 5).
negative, nonPositive, nonNegative, positive | A vector with the indices of the solution to constrain. When a theoretical solution exists and some of its components have a given sign then any of the following four constraints can be imposed: y(i)<0, y(i)<=0, y(i)>=0, y(i)>0. This option is only available when using inexact Newton method or Newton method with linesearch.
jacobian, jacBand, jacPattern, jacNonZeros | These options allow to specify a user-supplied Jacobian or its approximation (not available with fixed-point method). Please see the dedicated Jacobian page. Note that when using Picard iterations the Jacobian is supposed to be constant.
callback | The solver can call a user function after each successfull internal step. See the dedicated Callback page for explanations and use cases.
display | A string allowing to choose the verbosity of the solver output: "iter" (the default, giving the iteration details and termination message), "final" (termination message only) and "none".

## See also

- kinsol
- User functions