Engineering Optimization: Theory and Practice, Fourth Edition

(Martin Jones) #1

236 Linear Programming II: Additional Topics and Extensions


Express the constraints in the formA x≤band identify the matrixAand the
vectorbas

A=



2 1− 1

2 −1 5

4 1 1


 and b=




2

6

6




Step 2Use the command for executing linear programming program using interior
point method as indicated below:
clc
clear all
f=[–1;–2;–1];
A=[2 1—1;
2—1 5;
4 1 1];
b=[2;6;6];
lb=zeros(3,1);
Aeq=[];
beq=[];
options = optimset('Display', 'iter');
[x,fval,exitflag,output] = linprog(f,A,b,Aeq,beq,lb,[],[],
options)

This produces the solution or ouput as follows:

Iter 0: 1.03e+003 7.97e+000 1.50e+003 4.00e+002
Iter 1: 4.11e+002 2.22e–016 2.78e+002 4.72e+001
Iter 2: 1.16e–013 1.90e–015 2.85e+000 2.33e–001
Iter 3: 1.78e–015 1.80e–015 3.96e–002 3.96e–003
Iter 4: 7.48e–014 1.02e–015 1.99e–006 1.99e–007
Iter 5: 2.51e–015 4.62e–015 1.99e–012 1.98e–013
Optimization terminated.
x =
0.0000
4.0000
2.0000
fval = -10.0000
exitflag = 1
output =
iterations: 5
algorithm: 'large-scale: interior point'
cgiterations: 0
message: 'Optimization terminated.'
Free download pdf