F =
0 0 0 -1
[y,gl]=linprog(b,-A,F,Aeq,Beq,bl,bu)
Optimization terminated.
y =
3.4386
1.1537
0.6048
2.8847
0.0000
0.0000
0.0000
gl =
55.7695
Пример 2.1
Решение:
F =
0 0 0 -1
A =
-0.9000 0.2700 0.1600 0
0.0500 -0.8400 0.2000 0.7200
0.1400 0.1500 -0.9300 0.2800
b =
-33200 7600 -11900
Aeq =
[]
Beq =
[]
bl =
0 0 0 0
bu =
66000 50000 76000 100000
>> [x1,f1]=linprog(F,A,b,Aeq,Beq,bl,bu)
Optimization terminated.
x1 =
1.0e+004 *
5.9990
5.0000
4.5567
5.2066
f1 =
-5.2066e+004
>> Konspros_Y=[33200 0.72*f1 0.28*f1]
Konspros_Y =
1.0e+004 *
3.3200 -3.7487 -1.4578
Двойственная задача 12а
>> lengthX=length(x1)
lengthX =
4
>> y0=zeros(3,1)
y0 =
0
0
0
>> Options=optimset('Display','final','GradObj','on');%,...'TolFun',20,'TolPCG',20, 'TolX',20) %,'TypicalX','on')
>> bl=[0.0 0.0 0.0]
bl =
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]
A =
-0.9000 0.0500 0.1400 1.0000 0 0 0
0.2700 -0.8400 0.1500 0 1.0000 0 0
0.1600 0.2000 -0.9300 0 0 1.0000 0
0 0.7200 0.2800 0 0 0 1.0000
>> F=[0.0 0.0 0.0 -1.0]
F =
0 0 0 -1
>> b=[-33200 7600 -11900 66000 50000 76000 100000]
b =
-33200 7600 -11900 66000 50000 76000 100000
>> Aeq=[]
Aeq =
[]
>> Beq=[]
Beq =
[]
>> bl=[0.0 0.0 0.0 0.0 0 0 0]
bl =
0 0 0 0 0 0 0
>> bu=[66000 50000 76000 100000]
bu =
66000 50000 76000 100000
>> F=[0.0 0.0 0.0 -1.0]
F =
0 0 0 -1
>> [y,yl]=linprog(b,-A,F,Aeq,Beq,bl,bu)
Optimization terminated.
y =
0.1166
1.2745
0.2941
0.0000
0.9950
0.0000
0.0000
yl =
5.2066e+004
>> gly=b*y
gly =
5.2066e+004
>> Ay=A*y
Ay =
0.0000
0.0000
0.0000
1.0000
>> dFy=-F'-Ay
dFy =
1.0e-015 *
-0.8121
-0.7772
-0.7447
-0.2220
>> dFy=-F'-Ay
dFy =
1.0e-015 *
-0.8121
-0.7772
-0.7447
-0.2220
Пример 2.1б
>> F=[0.0 0.0 0.0 -1 -1 -1]
F =
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]
A =
-0.9000 0.2700 0.1600 1.0000 0 0
0.0500 -0.8400 0.2000 0 1.0000 0
0.1400 0.1500 -0.9300 0 0 1.0000
>> b=[0.0 0.0 0.0]
b =
0 0 0
>> Aeq=[]
Aeq =
[]
>> Beq=[]
Beq =
[]
>> bl=[0.0 0.0 0.0 0.0]
bl =
0 0 0 0
>> bu=[66000 50000 76000 100000]
bu =
66000 50000 76000 100000
>> [x1,f1]=linprog(F,A,b,Aeq,Beq,bl,bu)
Optimization terminated.
x1 =
1.0e+004 *
6.6000
5.0000
7.6000
3.3740
2.3500
5.3940
f1 =
-1.1118e+005
Пример 2.1в
F =
0 0 0 -1
A =
-0.9000 0.2700 0.1600 0
0.0500 -0.8400 0.2000 0.6667
0.1400 0.1500 -0.9300 0.3333
b =
-33200 2700 -16100
Aeq =
[]
Beq =
[]
bl =
0 0 0 0
bu =
66000 50000 76000 100000
Optimization terminated.
x1 =
1.0e+004 *
6.1031
5.0000
5.1423
4.7043
f1 =
-4.7043e+004
>> y=[33200 0.6667*f1 0,3333*f1]
y =
1.0e+008 *
0.0003 -0.0003 0 -1.5680
Пример 2.2
>> F=[0.0 0.0 0.0 -1.0]
F =
0 0 0 -1
>> 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]
A =
-0.9000 0.2700 0.1600 0
0.0500 -0.8400 0.2000 0.7200
0.1400 0.1500 -0.9300 0.2800
>> b=[-33200 7600 -11900]
b =
-33200 7600 -11900
>> %b=[-33200 6840 -13090]
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.