Find minimum of semi-infinitely constrained multivariable nonlinear function
Finds the minimum of a problem specified by
b and beq are vectors, A and Aeq are matrices, c(x), ceq(x), and Ki(x,wi) are functions that return vectors, and f(x) is a function that returns a scalar. f(x), c(x), and ceq(x) can be nonlinear functions. The vectors (or matrices) Ki(x,wi) ≤ 0 are continuous functions of both x and an additional set of variables w1,w2,...,wn. The variables w1,w2,...,wn are vectors of, at most, length two.
x, lb, and ub can be passed as vectors or matrices; see Matrix Arguments.
x = fseminf(fun,x0,ntheta,seminfcon)
x = fseminf(fun,x0,ntheta,seminfcon,A,b)
x = fseminf(fun,x0,ntheta,seminfcon,A,b,Aeq,beq)
x = fseminf(fun,x0,ntheta,seminfcon,A,b,Aeq,beq,lb,ub)
x = fseminf(fun,x0,ntheta,seminfcon,A,b,Aeq,beq,lb,ub,options)
x = fseminf(problem)
[x,fval] = fseminf(...)
[x,fval,exitflag] = fseminf(...)
[x,fval,exitflag,output] = fseminf(...)
[x,fval,exitflag,output,lambda] = fseminf(...)
fseminf
finds a minimum of a semi-infinitely constrained scalar
function of several variables, starting at an initial estimate. The aim is to
minimize f(x) so the constraints hold for all
possible values of wi∈ℜ1 (or wi∈ℜ2). Because it is impossible to calculate all possible values of Ki(x,wi), a region must be chosen for
wi over which to calculate an
appropriately sampled set of values.
Note
Passing Extra Parameters explains how to pass extra parameters to the objective function and nonlinear constraint functions, if necessary.
x = fseminf(fun,x0,ntheta,seminfcon)
starts
at x0
and finds a minimum of the function fun
constrained by ntheta
semi-infinite constraints defined in
seminfcon
.
x = fseminf(fun,x0,ntheta,seminfcon,A,b)
also tries to satisfy the linear inequalities
A*x ≤ b
.
x = fseminf(fun,x0,ntheta,seminfcon,A,b,Aeq,beq)
minimizes subject to the linear equalities Aeq*x = beq
as well. Set A = []
and
b = []
if no inequalities exist.
x = fseminf(fun,x0,ntheta,seminfcon,A,b,Aeq,beq,lb,ub)
defines a set of lower and upper bounds on the design variables in
x
, so that the solution is always in the range
lb
≤ x
≤ ub
.
Note
x = fseminf(fun,x0,ntheta,seminfcon,A,b,Aeq,beq,lb,ub,options)
minimizes with the optimization options specified in options
. Use
optimoptions
to set these
options.
x = fseminf(problem)
finds the minimum for
problem
, where problem
is a structure
described in Input Arguments.
[x,fval] = fseminf(...)
returns the value of
the objective function fun
at the solution
x
.
[x,fval,exitflag] = fseminf(...)
returns a
value exitflag
that describes the exit condition.
[x,fval,exitflag,output] = fseminf(...)
returns a structure output
that contains information about the
optimization.
[x,fval,exitflag,output,lambda] = fseminf(...)
returns a structure lambda
whose fields contain the Lagrange
multipliers at the solution x
.
Note
If the specified input bounds for a problem are inconsistent, the output
x
is x0
and the output
fval
is []
.
Function Input Arguments contains general descriptions of arguments passed
into fseminf
. This section provides function-specific details for
fun
, ntheta
, options
,
seminfcon
, and problem
:
| The
function to be minimized. x = fseminf(@myfun,x0,ntheta,seminfcon) where
function f = myfun(x) f = ... % Compute function value at x
fun = @(x)sin(x''*x); If
the gradient of options = optimoptions('fseminf','SpecifyObjectiveGradient',true) then
the function | |
ntheta | The number of semi-infinite constraints. | |
options | Options provides the
function-specific details for the | |
| The
function that computes the vector of nonlinear inequality
constraints, x = fseminf(@myfun,x0,ntheta,@myinfcon) where
function [c,ceq,K1,K2,...,Kntheta,S] = myinfcon(x,S) % Initial sampling interval if isnan(S(1,1)), S = ...% S has ntheta rows and 2 columns end w1 = ...% Compute sample set w2 = ...% Compute sample set ... wntheta = ... % Compute sample set K1 = ... % 1st semi-infinite constraint at x and w K2 = ... % 2nd semi-infinite constraint at x and w ... Kntheta = ...% Last semi-infinite constraint at x and w c = ... % Compute nonlinear inequalities at x ceq = ... % Compute the nonlinear equalities at x
The vectors or matrices
Note Because Optimization Toolbox™ functions only accept inputs of type
Passing Extra Parameters
explains how to parametrize | |
problem |
| Objective function |
| Initial point for
x | |
ntheta | Number of semi-infinite constraints | |
seminfcon | Semi-infinite constraint function | |
| Matrix for linear inequality constraints | |
| Vector for linear inequality constraints | |
| Matrix for linear equality constraints | |
| Vector for linear equality constraints | |
lb | Vector of lower bounds | |
ub | Vector of upper bounds | |
| 'fseminf' | |
| Options created with optimoptions |
Function Input Arguments contains general descriptions of arguments returned
by fseminf
. This section provides function-specific details for
exitflag
, lambda
, and
output
:
| Integer identifying the reason
the algorithm terminated. The following lists the values of
| |
| Function converged to a solution
| |
| Magnitude of the search direction was less than the
specified tolerance and constraint violation was less than
| |
| Magnitude of directional derivative was less than the
specified tolerance and constraint violation was less than
| |
| Number of iterations exceeded
| |
| Algorithm was terminated by the output function. | |
| No feasible point was found. | |
| Structure containing the
Lagrange multipliers at the solution | |
lower | Lower bounds | |
upper | Upper bounds | |
ineqlin | Linear inequalities | |
eqlin | Linear equalities | |
ineqnonlin | Nonlinear inequalities | |
eqnonlin | Nonlinear equalities | |
| Structure containing information about the optimization. The fields of the structure are | |
iterations | Number of iterations taken | |
funcCount | Number of function evaluations | |
lssteplength | Size of line search step relative to search direction | |
stepsize | Final displacement in | |
algorithm | Optimization algorithm used | |
constrviolation | Maximum of constraint functions | |
firstorderopt | Measure of first-order optimality | |
message | Exit message |
Optimization options used by fseminf
. Use optimoptions
to set or change options
. See Optimization Options Reference for detailed information.
Some options are absent from the
optimoptions
display. These options appear in italics in the following
table. For details, see View Options.
| Compare user-supplied derivatives
(gradients of objective or constraints) to finite-differencing
derivatives. The choices are For
|
ConstraintTolerance | Termination tolerance on the
constraint violation, a positive scalar. The default is
For
|
Diagnostics | Display diagnostic information about
the function to be minimized or solved. The choices are
|
DiffMaxChange | Maximum change in variables for
finite-difference gradients (a positive scalar). The default is
|
DiffMinChange | Minimum change in variables for
finite-difference gradients (a positive scalar). The default is
|
Display | Level of display (see Iterative Display):
|
FiniteDifferenceStepSize |
Scalar or vector step size factor for finite differences. When
you set
sign′(x) = sign(x) except sign′(0) = 1 .
Central finite differences are
FiniteDifferenceStepSize expands to a vector. The default
is sqrt(eps) for forward finite differences, and eps^(1/3)
for central finite differences.
For |
FiniteDifferenceType | Finite differences, used to estimate
gradients, are either 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. For
|
FunctionTolerance | Termination tolerance on the function
value, a positive scalar. The default is
For
|
FunValCheck | Check whether objective function and
constraints values are valid. |
MaxFunctionEvaluations | Maximum number of function
evaluations allowed, a positive integer. The default is
For
|
MaxIterations | Maximum number of iterations allowed,
a positive integer. The default is For
|
MaxSQPIter | Maximum number of SQP iterations
allowed, a positive integer. The default is
|
OptimalityTolerance |
Termination tolerance on the first-order optimality (a positive
scalar). The default is For |
OutputFcn | Specify one or more user-defined
functions that an optimization function calls at each iteration.
Pass a function handle or a cell array of function handles. The
default is none ( |
PlotFcn | Plots various measures of progress
while the algorithm executes; select from predefined plots or
write your own. Pass a name, a function handle, or a cell array
of names or function handles. For custom plot functions, pass
function handles. The default is none
(
Custom plot functions use the same syntax as output functions. See Output Functions for Optimization Toolbox™ and Output Function and Plot Function Syntax. For
|
RelLineSrchBnd | Relative bound (a real nonnegative
scalar value) on the line search step length such that the total
displacement in |
RelLineSrchBndDuration | Number of iterations for which the
bound specified in |
SpecifyObjectiveGradient | Gradient for the objective function
defined by the user. See the preceding description of
For |
StepTolerance | Termination tolerance on
For
|
TolConSQP | Termination tolerance on inner
iteration SQP constraint violation, a positive scalar. The
default is |
TypicalX | Typical |
The optimization routine fseminf
might vary the
recommended sampling interval, S
, set in
seminfcon
, during the computation because values other than
the recommended interval might be more appropriate for efficiency or robustness.
Also, the finite region wi, over which Ki(x,wi) is calculated, is allowed to vary during the optimization,
provided that it does not result in significant changes in the number of local
minima in Ki(x,wi).
The function to be minimized, the constraints, and semi-infinite constraints, must
be continuous functions of x
and w
.
fseminf
might only give local solutions.
When the problem is not feasible, fseminf
attempts to minimize
the maximum constraint value.
fseminf
uses cubic and quadratic interpolation techniques to
estimate peak values in the semi-infinite constraints. The peak values are used to
form a set of constraints that are supplied to an SQP method as in the fmincon
function. When the number of constraints changes, Lagrange
multipliers are reallocated to the new set of constraints.
The recommended sampling interval calculation uses the difference between the interpolated peak values and peak values appearing in the data set to estimate whether the function needs to take more or fewer points. The function also evaluates the effectiveness of the interpolation by extrapolating the curve and comparing it to other points in the curve. The recommended sampling interval is decreased when the peak values are close to constraint boundaries, i.e., zero.
For more details on the algorithm used and the types of procedures displayed under
the Procedures
heading when the Display
option
is set to 'iter'
with optimoptions
, see also
SQP Implementation. For more details on the fseminf
algorithm, see fseminf Problem Formulation and Algorithm.