794 Introduction to MATLAB
- Distinction between linear and nonlinear constraints.
- Identification of lower and upper bounds on design variables.
- Setting/changing the parameters of the optimization algorithm (based on the avail-
able options).
Using MATLAB Programs. Each program or m-file in MATLAB can be imple-
mented in several ways. The details can be found either in the reference given above
or online using the help command. For illustration, the help command and the response
for the programfminconare shown below.
The functionfminconcan be used in 12 different ways as indicated below (by
the help command). The differences depend on the available data in the mathematical
model of the problem and the information required from the solution of the problem.
In using the different function calls, any data missing in the mathematical model of
the optimization problem need to be indicated using a null vector as [ ]. Note that the
response is edited for brevity.
>> help fmincon
FMINCON Finds the constrained minimum of a function of
several variables.
FMINCON solves problems of the form:
min F(X) subject to:
A*X <= B, Aeq*X = Beq (linear constraints)
C(X) <= 0, Ceq(X) = 0 (nonlinear constraints)
LB <= X <= UB
X=FMINCON (FUN,X0,A,B)
X=FMINCON (FUN,X0,A,B,Aeq,Beq)
X=FMINCON (FUN,X0,A,B,Aeq,Beq,LB,UB)
X=FMINCON (FUN,X0,A,B,Aeq,Beq,LB,UB,NONLCON)
X=FMINCON (FUN,X0,A,B,Aeq,Beq,LB,UB,NONLCON,OPTIONS)
X=FMINCON (FUN,X0,A,B,Aeq,Beq,LB,UB,NONLCON,OPTIONS,...
P1,P2,...)
[X,FVAL] = FMINCON (FUN,X0,...)
[X,FVAL,EXITFLAG] = FMINCON (FUN,X0,...)
[X,FVAL,EXITFLAG,OUTPUT]=FMINCON (FUN,X0,...)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA] =FMINCON (FUN,X0,...)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD]=FMINCON (FUN,X0,...)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN]=FMINCON
(FUN,X0,...).
The solution of representative constrained nonlinear programming problems using the
functionfminconis illustrated in Chapters 1 and 7.