Beruflich Dokumente
Kultur Dokumente
AKINO (748791)
3.21:
MATLAB CODE:
clc
clear all
f=[1;-1;3;-3];
A=[-4 4 3 -3;
1 -1 1 -1;
1 -1 -4 4];
b=[12;7;2];
lb=zeros(3,1);
Aeq=[];
beq=[];
options=optimset('Largescale','off','simplex','on');
[x,fval,exitflag,output]=linprog(f,A,b,Aeq,beq,lb,[],[],optimset('Display','iter'))
OUTPUT:
Warning: Length of lower bounds is < length(x); filling in missing lower bounds with -Inf.
> In checkbounds at 34
In linprog at 238
Residuals: Primal
Dual
Duality Total
Infeas Infeas
Gap
Rel
A*x-b A'*y+z-f x'*z
Error
--------------------------------------------------Iter 0: 5.28e+02 9.26e+00 2.75e+03 3.00e+02
Iter 1: 2.88e+01 3.23e-01 1.50e+02 2.05e+00
Iter 2: 2.02e-09 4.64e-03 9.66e+00 7.27e-01
Iter 3: 6.24e-09 3.18e-04 4.41e-01 3.93e-02
Iter 4: 9.63e-09 1.87e-08 2.48e-05 2.27e-06
Iter 5: 5.42e-10 1.87e-13 2.49e-10 3.86e-11
Optimization terminated.
x = 124.4019
128.5558
95.7892
97.3277
fval = -8.7692
exitflag = 1
output = iterations: 5
algorithm: 'interior-point'
cgiterations: 0
message: 'Optimization terminated.'
constrviolation: 2.8535e-10
firstorderopt: 3.2925e-10
3.28:
MATLAB CODE:
clc
clear all
f=[1;-4];
A=[-1 1;
45;
5 -2;
5 2];
b=[4;45;20;10];
lb=zeros(4,1);
Aeq=[];
beq=[];
options=optimset('Largescale','off','simplex','on');
[x,fval,exitflag,output]=linprog(f,A,b,Aeq,beq,lb,[],[],optimset('Display','iter'))
OUTPUT:
Warning: Length of lower bounds is > length(x); ignoring extra bounds.
> In checkbounds at 28
In linprog at 238
Residuals: Primal
Dual
Duality Total
Infeas Infeas
Gap
Rel
A*x-b A'*y+z-f x'*z
Error
--------------------------------------------------Iter 0: 1.30e+03 9.76e+00 1.75e+03 3.00e+02
Iter 1: 1.76e+02 1.35e-15 1.86e+02 3.49e+00
Iter 2: 6.57e+00 1.42e-14 2.46e+01 4.88e-01
Iter 3: 1.47e-14 4.97e-16 8.52e-01 4.84e-02
Iter 4: 5.10e-15 5.00e-16 8.84e-03 5.25e-04
Iter 5: 1.61e-14 5.00e-16 4.59e-07 2.72e-08
Iter 6: 1.02e-14 1.11e-16 4.59e-14 2.95e-15
Optimization terminated.
x = 0.2857
4.2857
fval = -16.8571
exitflag = 1
output = iterations: 6
algorithm: 'interior-point'
cgiterations: 0
message: 'Optimization terminated.'
constrviolation: 0
firstorderopt: 1.7510e-14
3.36:
MATLAB CODE:
clc
clear all
f=[5;2];
A=[3 4;
1 -1;
-1 -4;
-3 -1];
b=[24;3;-4;-3];
lb=zeros(4,1);
Aeq=[];
beq=[];
options=optimset('Largescale','off','simplex','on');
[x,fval,exitflag,output]=linprog(f,A,b,Aeq,beq,lb,[],[],optimset('Display','iter'))
OUTPUT:
Warning: Length of lower bounds is > length(x); ignoring extra bounds.
> In checkbounds at 28
In linprog at 238
Residuals: Primal
Dual
Duality Total
Infeas Infeas
Gap
Rel
A*x-b A'*y+z-f x'*z
Error
--------------------------------------------------Iter 0: 9.26e+02 6.12e+00 2.20e+03 7.00e+02
Iter 1: 2.55e-13 2.22e-15 8.02e+01 1.16e+00
Iter 2: 2.70e-14 1.78e-15 9.31e+00 8.82e-01
Iter 3: 3.48e-13 9.42e-16 4.18e+00 7.06e-01
Iter 4: 1.01e-14 3.18e-14 1.23e+00 2.09e-01
Iter 5: 2.51e-13 2.22e-16 2.56e-01 4.82e-02
Iter 6: 7.12e-15 8.88e-16 1.58e-04 2.99e-05
Iter 7: 1.60e-15 8.88e-16 7.88e-09 1.49e-09
Optimization terminated.
x =0.7273
0.8182
fval = 5.2727
exitflag =1
output = iterations: 7
algorithm: 'interior-point'
cgiterations: 0
message: 'Optimization terminated.'
constrviolation: 0
firstorderopt: 1.5635e-09
MATLAB CODE:
clc
clear all
f=[-14.36;-33.08;-112.32;-1023.20];