Optimization Toolbox
  Go to function:
    Search    Help Desk 
fseminf    Examples   See Also

Find minimum of a semi-infinitely constrained multivariable nonlinear function

where x, b, beq, lb, and ub 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) are continuous functions of both x and an additional set of variables . The variables are vectors of, at most, length two.

Syntax

Description

fseminf finds the 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 (or ). Since it is impossible to calculate all possible values of , a region must be chosen for over which to calculate an appropriately sampled set of values.

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, x, so that the solution is always in the range lb <= x <= ub.

x = fseminf(fun,x0,ntheta,seminfcon,A,b,Aeq,beq,lb,ub,options) minimizes with the optimization parameters specified in the structure options.

x = fseminf(fun,x0,ntheta,seminfcon,A,b,Aeq,beq,lb,ub,options, P1,P2,...) passes the problem-dependent parameters P1, P2, etc., directly to the functions fun and seminfcon. Pass empty matrices as placeholders for A, b, Aeq, beq, lb, ub, and options if these arguments are not needed.

[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.

Arguments

The arguments passed into the function are described in Table 1-1. The arguments returned by the function are described in Table 1-2. Details relevant to fseminf are included below for fun, ntheta, options, seminfcon, exitflag, lambda, and output.

fun
The function to be minimized. fun takes a vector x and returns a scalar value f of the objective function evaluated at x. You can specify fun to be an inline object. For example,

    fun = inline('sin(x''*x)');
    
Alternatively, fun can be a string containing the name of a function (an M-file, a built-in function, or a MEX-file). If fun='myfun' then the M-file function myfun.m would have the form

    function f = myfun(x)
    f = ...            % Compute function value at x
    

If the gradient of fun can also be computed and options.GradObj is 'on', as set by

    options = optimset('GradObj','on')
    
then the function fun must return, in the second output argument, the gradient value g, a vector, at x. Note that by checking the value of nargout the function can avoid computing g when fun is called with only one output argument (in the case where the optimization algorithm only needs the value of f but not g):

    function [f,g] = myfun(x)
    f = ...          % compute the function value at x
    if nargout > 1   % fun called with 2 output arguments
       g = ...       % compute the gradient evaluated at x
    end
    

The gradient is the partial derivatives of f at the point x. That is, the ith component of g is the partial derivative of f with respect to the ith component of x.

ntheta
The number of semi-infinite constraints.
options
Optimization parameter options. You can set or change the values of these parameters using the optimset function.


seminfcon
The function that computes the vector of nonlinear inequality constraints, c, a vector of nonlinear equality constraints, ceq, and ntheta semi-infinite constraints (vectors or matrices) K1, K2,..., Kntheta evaluated over an interval S at the point x. seminfcon is a string containing the name of the function (an M-file, a built-in, or a MEX-file). For example, if seminfcon='myinfcon' then the M-file myinfcon.m would have the form


    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
    
S is a recommended sampling interval, which may or may not be used. Return [] for c and ceq if no such constraints exist.


The vectors or matrices, K1, K2, ..., Kntheta, contain the semi-infinite constraints evaluated for a sampled set of values for the independent variables, w1, w2, ... wntheta, respectively. The two column matrix, S, contains a recommended sampling interval for values of w1, w2, ... wntheta, which are used to evaluate K1, K2, ... Kntheta. The ith row of S contains the recommended sampling interval for evaluating Ki. When Ki is a vector, use only S(i,1) (the second column can be all zeros). When Ki is a matrix, s(i,2) is used for the sampling of the rows in Ki, S(i,1) is used for the sampling interval of the columns of Ki (see "Two-Dimensional Example" in the Examples section). On the first iteration S is NaN, so that some initial sampling interval must be determined by seminfcon.

exitflag
Describes the exit condition:

lambda
A structure containing the Lagrange multipliers at the solution x (separated by constraint type):

output
A structure whose fields contain information about the optimization:

Notes

The recommended sampling interval, S, set in seminfcon, may be varied by the optimization routine fseminf during the computation because values other than the recommended interval may be more appropriate for efficiency or robustness. Also, the finite region , over which 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 .

Examples

One-Dimensional Example

Find values of x that minimize


for all values of and over the ranges

Note that the semi-infinite constraints are one-dimensional, that is, vectors. Since the constraints must be in the form you will need to compute the constraints as

First, write an M-file that computes the objective function:

Second, write an M-file, mycon.m, that computes the nonlinear equality and inequality constraints and the semi-infinite constraints:

Then, invoke an optimization routine:

After eight iterations, the solution is

The function value and the maximum values of the semi-infinite constraints at the solution x are

A plot of the semi-infinite constraints is produced.


This plot shows how peaks in both functions are on the constraint boundary.

The plot command inside of 'mycon.m' will slow down the computation; remove this line to improve the speed.

Two-Dimensional Example

Find values of x that minimize


where


for all values of and over the ranges:


starting at the point .

Note that the semi-infinite constraint is two-dimensional, that is, a matrix.

First, we reuse the file myfun.m for the objective function from the previous example.

Second, write an M-file for the constraints, called mycon.m:

Next, invoke an optimization routine:

After seven iterations, the solution is

The function value and the maximum value of the semi-infinite constraint at the solution x are

The following mesh plot is produced.


Algorithm

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 function fmincon. 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 more or fewer points need to be taken. The effectiveness of the interpolation is also taken into consideration 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.

See also the SQP implementation section in the Introduction to Algorithms chapter for more details on the algorithm used and the types of procedures printed under the Procedures heading for options.Display = 'iter' setting.

Limitations

The function to be minimized, the constraints, and semi-infinite constraints, must be continuous functions of x and w. fseminf may only give local solutions.

When the problem is not feasible, fseminf attempts to minimize the maximum constraint value.

See Also

fmincon, optimset



[ Previous | Help Desk | Next ]