summaryrefslogtreecommitdiff
path: root/413/CH7/EX7.3/Example_7_3.sce
blob: 906baed12ded5f3ff0d581cbf27be05ce0bd1090 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
clc
clear
A=[5 8]
B=[3 4
   2 5]
C=[12
   10]
printf('The Primal:')
printf('\nMax f = %dx1+ %dx2',A(1,1),A(1,2))

for i=1:2
printf('\n%dx1 +%dx2<=%d', B(i,1),B(i,2),C(i,1))
end
printf('\nx1, x2>=0')
A=A'
B=B'
C=C'
printf('\n\nThe Dual:')
printf('\nMin f = %dy1+ %dy2',C(1,1),C(1,2))

for i=1:2
printf('\n%dy1 +%dy2>=%d', B(i,1),B(i,2),A(i,1))
end
printf('\ny1, y2>=0')