% MATH 4/5794: Optimization Modeling
% EXAMPLES: W. A. Lodwick - Example 1, Multiple Sclerosis
Scab Detection 1
% Example 2, Multiple
Sclerosis Scab Detection 2
% Example 3, Multiple
Sclerosis Scab Detection 3
% Example 4, Multiple
Sclerosis Scab Detection 4
% Example 5, Radiation
Therapy (inactive)
% Example 6, Fuzzy
Linear Programming (inactive)
%
Example 7, Possibilistic
Probramming (inactive)
% Example
5, Stochastic Progra8ming (inactive)
% Created:
January 20, 2005
%
function [x,z,c] = classdemo2(exnum)
% options=optimset('Gradobj','on');
% x(1): Echo time
% x(2): Pulse repetition time
x0(1,1) = 0;
x0(2,1) = 0;
vlb(1,1) =
10.00000001;
vlb(2,1) = 100;
vub(1,1) = 200;
vub(2,1) = 3000;
% Call the nlp solver
options =
optimset('LargeScale','off','MaxIter',200,'Display','iter',...
'MaxFunEvals',2000);
[x,z]
=fmincon('introwalobj',x0,[],[],[],[],vlb,vub,'introwalcon', ...
options,exnum);
'The solution is: '
x
% Objective function value - since minimizing to obtain
maximum, need negative to
% get the correct maximum
z = -z;
'Objective function value is: '
z
% Constraints - how close the solution is to satisfying
the constraints
[c,ceq] = introwalcon(x,exnum);
'Constraints are'
c = -c;
c