All Algorithms |
Algorithm
| Choose between 'trust-region-dogleg' (default), 'trust-region-reflective' ,
and 'levenberg-marquardt' . Set the initial Levenberg-Marquardt
parameter λ by setting Algorithm to
a cell array such as {'levenberg-marquardt',.005} .
The default λ = 0.01 . The Algorithm option
specifies a preference for which algorithm to use. It is only a preference
because for the trust-region-reflective algorithm, the nonlinear system
of equations cannot be underdetermined; that is, the number of equations
(the number of elements of F returned by fun )
must be at least as many as the length of x . Similarly,
for the trust-region-dogleg algorithm, the number of equations must
be the same as the length of x . fsolve uses
the Levenberg-Marquardt algorithm when the selected algorithm is unavailable.
For more information on choosing the algorithm, see Choosing the Algorithm. |
DerivativeCheck
| Compare user-supplied derivatives
(gradients of objective or constraints) to finite-differencing derivatives.
The choices are 'on' or the default 'off' . |
Diagnostics
| Display diagnostic information
about the function to be minimized or solved. The choices are 'on' or
the default 'off' . |
DiffMaxChange
| Maximum change in variables for
finite-difference gradients (a positive scalar). The default is Inf . |
DiffMinChange
| Minimum change in variables for
finite-difference gradients (a positive scalar). The default is 0 . |
Display | Level of display (see Iterative Display): 'off' or 'none' displays
no output.
'iter' displays output at each
iteration, and gives the default exit message.
'iter-detailed' displays output
at each iteration, and gives the technical exit message.
'final' (default) displays just
the final output, and gives the default exit message.
'final-detailed' displays just
the final output, and gives the technical exit message.
|
FinDiffRelStep | Scalar or vector step size factor for finite differences. When
you set FinDiffRelStep to a vector v ,
forward finite differences steps delta are delta
= v.*sign′(x).*max(abs(x),TypicalX);
where sign′(x)
= sign(x) except sign′(0) = 1 .
Central finite differences are delta = v.*max(abs(x),TypicalX);
Scalar FinDiffRelStep expands
to a vector. The default is sqrt(eps) for forward
finite differences, and eps^(1/3) for central finite
differences. |
FinDiffType | Finite differences, used to estimate gradients,
are either 'forward' (default), or 'central' (centered). 'central' takes
twice as many function evaluations, but should be more accurate. The
algorithm is careful to obey bounds when estimating both types of
finite differences. So, for example, it could take a backward, rather
than a forward, difference to avoid evaluating at a point outside
bounds. |
FunValCheck | Check whether objective function
values are valid. 'on' displays an error when the
objective function returns a value that is complex , Inf ,
or NaN . The default, 'off' ,
displays no error. |
Jacobian
| If 'on' , fsolve uses
a user-defined Jacobian (defined in fun ), or Jacobian information (when using JacobMult ),
for the objective function. If 'off' (default), fsolve approximates
the Jacobian using finite differences. |
MaxFunEvals
| Maximum number of function evaluations
allowed, a positive integer. The default is 100*numberOfVariables .
See Tolerances and Stopping Criteria and Iterations and Function Counts. |
MaxIter
| Maximum number of iterations allowed,
a positive integer. The default is 400 . See Tolerances and Stopping Criteria and Iterations and Function Counts. |
OutputFcn | Specify one or more user-defined
functions that an optimization function calls at each iteration, either
as a function handle or as a cell array of function handles. The default
is none ([] ). See Output Function. |
PlotFcns
| Plots various measures of progress
while the algorithm executes. Select from predefined plots or write
your own. Pass a function handle or a cell array of function handles.
The default is none ([] ): @optimplotx plots the current point.
@optimplotfunccount plots the function
count.
@optimplotfval plots the function
value.
@optimplotstepsize plots the step
size.
@optimplotfirstorderopt plots the
first-order optimality measure.
For information on writing a custom plot function,
see Plot Functions. |
TolFun
| Termination tolerance on the function
value, a positive scalar. The default is 1e-6 .
See Tolerances and Stopping Criteria. |
TolX
| Termination tolerance on x ,
a positive scalar. The default is 1e-6 . See Tolerances and Stopping Criteria. |
TypicalX
| Typical x values.
The number of elements in TypicalX is equal to
the number of elements in x0 , the starting point.
The default value is ones(numberofvariables,1) . fsolve uses TypicalX for
scaling finite differences for gradient estimation. The trust-region-dogleg algorithm
uses TypicalX as the diagonal terms of a scaling
matrix. |
Trust-Region-Reflective Algorithm |
JacobMult
| Function handle for
Jacobian multiply function. For large-scale structured problems, this
function computes the Jacobian matrix product J*Y ,
J'*Y , or J'*(J*Y) without actually
forming J . The function is of the form where Jinfo contains
a matrix used to compute J*Y (or J'*Y ,
or J'*(J*Y) ). The first argument Jinfo must
be the same as the second argument returned by the objective function fun ,
for example, in Y is
a matrix that has the same number of rows as there are dimensions
in the problem. flag determines which product to
compute:
In each case, J is not formed
explicitly. fsolve uses Jinfo to
compute the preconditioner. See Passing Extra Parameters for information on how to supply
values for any additional parameters jmfun needs. Note
'Jacobian' must be set to 'on' for fsolve to
pass Jinfo from fun to jmfun . |
See Minimization with Dense Structured Hessian, Linear Equalities for
a similar example. |
|
|
JacobPattern
| Sparsity pattern of the Jacobian
for finite differencing. Set JacobPattern(i,j) = 1 when fun(i) depends
on x(j) . Otherwise, set JacobPattern(i,j)
= 0 . In other words, JacobPattern(i,j) = 1 when
you can have ∂fun(i) /∂x(j) ≠ 0. Use JacobPattern when
it is inconvenient to compute the Jacobian matrix J in fun ,
though you can determine (say, by inspection) when fun(i) depends
on x(j) . fsolve can approximate J via
sparse finite differences when you give JacobPattern . In
the worst case, if the structure is unknown, do not set JacobPattern .
The default behavior is as if JacobPattern is a
dense matrix of ones. Then fsolve computes a
full finite-difference approximation in each iteration. This can be
very expensive for large problems, so it is usually better to determine
the sparsity structure. | |
MaxPCGIter
| Maximum number of PCG (preconditioned
conjugate gradient) iterations, a positive scalar. The default is max(1,floor(numberOfVariables/2)) .
For more information, see Equation Solving Algorithms. | |
PrecondBandWidth
| Upper bandwidth of preconditioner
for PCG, a nonnegative integer. The default PrecondBandWidth is Inf ,
which means a direct factorization (Cholesky) is used rather than
the conjugate gradients (CG). The direct factorization is computationally
more expensive than CG, but produces a better quality step towards
the solution. Set PrecondBandWidth to 0 for
diagonal preconditioning (upper bandwidth of 0). For some problems,
an intermediate bandwidth reduces the number of PCG iterations. | |
TolPCG
| Termination tolerance on the PCG
iteration, a positive scalar. The default is 0.1 . | |
Levenberg-Marquardt Algorithm | |
InitDamping
| Initial value of the Levenberg-Marquardt parameter,
a positive scalar. Default is 1e-2 . For details,
see Levenberg-Marquardt Method. | |
ScaleProblem
| 'Jacobian' can sometimes improve the
convergence of a poorly scaled problem. The default is 'none' .
| |