0.25 -0.85 0.2 0. 1. 0. 0.;
0.1 0.2 -0.95 0. 0. 1. 0.;
0.0 0.72 0.28 0. 0. 0. 1.]
F=[0.0 0.0 0.0 -1.0]
b=[-3.5 3.5 0.5 22 60 40 100]
Aeq=[]
Beq=[]
bl=[0.0 0.0 0.0 0.0 0. 0. 0.]
bu=[22. 60. 40. 100.]
F=[0.0 0.0 0.0 -1.0]
[y,gl]=linprog(b,-A,F,Aeq,Beq,bl,bu)//y0,[],[],OPTIONS)//LB,UB,X0,OPTIONS
y=[3.4386 1.1537 0.6048 2.8847 0.0000 0.0000 0.0000]
gly=b*Y
Ay=A*y
dFy=-F-Ay
disp("Пример 2.1a Модель 2003 г.")
F=[0.0 0.0 0.0 -1.0]
A=[-0.9 0.27 0.16 0.0;
0.05 -0.84 0.2 0.72;
0.14 0.15 -0.93 0.28]
b=[-33200 7600 -11900]
Aeq=[]
Beq=[]
bl=[0.0 0.0 0.0 0.0]
bu=[66000 50000 76000 100000]
[x1,f1]=linprog(F,A,b,Aeq,Beq,bl,bu)
x1=[59990 50000 45567 52066], f1=-52066
Konspros_Y=[33200 0.72*f1 0.28*f1]
//KonSpros_Y=[33200 -37487 -14578]
Двойственная задача 12а
lengthX=length(x1)
y0=zeros(3,1)
Options=optimset('Display','final','GradObj','on');%,...'TolFun',20,'TolPCG',20, 'TolX',20) %,'TypicalX','on')
bl=[0.0 0.0 0.0]
A=[-0.9 0.05 0.14 1 0 0 0; 0.27 -0.84 0.15 0 1 0 0; 0.16 0.2 -0.93 0 0 1 0; 0.0 0.72 0.28 0 0 0 1]
F=[0.0 0.0 0.0 -1.0]
b=[-33200 7600 -11900 66000 50000 76000 100000]
Aeq=[]
Beq=[]
bl=[0.0 0.0 0.0 0.0 0 0 0]
bu=[66000 50000 76000 100000]
F=[0.0 0.0 0.0 -1.0]
[y,yl]=linprog(b,-A,F,Aeq,Beq,bl,bu)
gly=b*y
Ay=A*y
dFy=-F'-Ay
пример 2.1б
F=[0.0 0.0 0.0 -1 -1 -1]
A=[-0.9 0.27 0.16 1 0.0 0.0; 0.05 -0.84 0.2 0.0 1.0 0.0; 0.14 0.15 -0.93 0.0 0.0 1.0]
b=[0.0 0.0 0.0]
Aeq=[]
Beq=[]
bl=[0.0 0.0 0.0 0.0]
bu=[66000 50000 76000 100000]
[x1,f1]=linprog(F,A,b,Aeq,Beq,bl,bu)
Пример 2.1в
F=[-0.0 0.0 0.0 -1.0]
A=[-0.9 0.27 0.16 0.0;0.05 -0.84 0.2 0.6667; 0.14 0.15 -0.93 0.3333]
b=[-33200 2700 -16100]
Aeq=[]
Beq=[]
bl=[0.0 0.0 0.0 0.0]
bu=[66000 50000 76000 100000]
[x1,f1]=linprog(F,A,b,Aeq,Beq,bl,bu)
y=[33200 0.6667*f1 0,3333*f1]
пример2.2
F=[0.0 0.0 0.0 -1.0]
A=[-0.9 0.27 0.16 0.0; 0.05 -0.84 0.2 0.72; 0.14 0.15 -0.93 0.28]
b=[-33200 7600 -11900]
%b=[-33200 6840 -13090]
Aeq=[]
Beq=[]
bl=[0.0 0.0 0.0 0.0]
bu=[66000 50000 76000 100000]*1.1
[x1,f1]=linprog (F,A,b,Aeq,Beq,bl,bu)
KonSpros_Y=[33200 0.72*f1 0.28*f1]
Пример 2.3
F=[0.0 0.0 0.0 -1.0 0.0 0.0; 0.0 0.0 0.0 0.0 -1.0 0.0; 0.0 0.0 0.0 0.0 0.0 -1.0]
A=[-0.9 0.27 0.16 1.0 0.0 0.0; 0.05 -0.84 0.2 0.0 1.0 0.0; 0.14 0.15 -0.93 0.0 0.0 1.0; 0.0032 0.0107 0.010 0.0 0.0 0.0]
b=[0.0 0.0 0.0 1400]
Aeq=[]
Beq=[]
bl=[0.0 0.0 0.0 0.0 0.0 0.0]
bu=[66000 50000 76000 100000 100000 100000]
[x1,f1]=linprog(F(1,:),A,b,Aeq,Beq,bl,bu)
[x2,f2]=linprog(F(2,:),A,b,Aeq,Beq,bl,bu)
[x3,f3]=linprog(F(3,:),A,b,Aeq,Beq,bl,bu)
f1=-f1
f2=-f2
f3=-f3
L=[-1.0 0.0 0.0 0.0 0.0 0.0 0.0]
A0=[1.0 0.0 0.0 0.0 -1.0/f1 0.0 0.0; 1.0 0.0 0.0 0.0 0.0 -1.0/f2 0.0; 1.0 0.0 0.0 0.0 0.0 0.0 -1.0/f3; 0.0 -0.9 0.27 0.16 1.0 0.0 0.0; 0.0 0.05 -0.84 0.2 0.0 1.0 0.0; 0.0 0.0032 0.0107 0.010 0.0 0.0 0.0]
bo=[0.01 0.01 0.01 0.01 0.01 0.01 1400]
Aeq=[]
Beq=[]
blo=[0.1 0.0 0.0 0.0 0.0 0.0 0.0]
buo=[1.0 66000 50000 76000 100000 100000 100000]
[x0,L0]=linprog(L,A0,bo,Aeq,Beq,blo,buo)
Пример 0
F =
0 0 0 -1
A =
-0.9500 0.2500 0.1000 0
0.2000 -0.8500 0.2000 0.7200
0.2500 0.2000 -0.9500 0.2800
b =
-3.5000 3.5000 0.5000
Aeq =
[]
Beq =
[]
bl =
0 0 0 0
bu =
22 60 40 100
Optimization terminated.
x1 =
22.0000
56.1882
33.5296
55.7695
f1 =
-55.7695
Двойственная задача
bl =
0 0 0
A =
-0.9500 0.2000 0.2500 1.0000 0 0 0
0.2500 -0.8500 0.2000 0 1.0000 0 0
0.1000 0.2000 -0.9500 0 0 1.0000 0
0 0.7200 0.2800 0 0 0 1.0000
F =
0 0 0 -1
b =
-3.5000 3.5000 0.5000 22.0000 60.0000 40.0000 100.0000
Aeq =
[]
Beq =
[]
bl =
0 0 0 0 0 0 0
bu =
22 60 40 100
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.