当前位置:
文档之家› 线性规划的灵敏度分析实验报告
线性规划的灵敏度分析实验报告
Total solver iterations: 2
Variable Value Reduced Cost
B( 1) 450.0000 0.000000
B( 2) 300.0000 0.000000
C( 1) 3.000000 0.000000
C( 2) 1.000000 0.000000
C( 3) 4.000000 0.000000
Lingo软件
三 实验内容(包括数学模型、上机程序、实验结果、结果分析与问题解答等)
例题2-10
MODEL:
[_1]MAX= 2 * X_1 + 3 * X_2 ;
[_2] X_1 + 2 * X_2 + X_3 = 8 ;
[_3] 4 * X_1 + X_4= 16 ;
[_4] 4 * X_2 + X_5 = 12 ;
for(is(I):sum(js(J):a(I,J)*x(J))<=b(I));
data:
c=3 1 4;
b=450 300;
a=6 3 5
3 4 5;
enddata
End
最优解Global optimal solution found.
Objective value: 270.0000
Infeasibilities: 0.000000
X( 1) 2.000000 INFINITY 2.000000
X( 2) 3.000000 INFINITY 3.000000
X( 3) 0.0 1.500000 INFINITY
X( 4) 0.0 0.5000000 INFINITY
X( 5) 0.0 0.7500000 INFINITY
Righthand Side Ranges
最优解(4,3,2,0,0)最优值z=17
分析
Ranges in which the basis is unchanged:
Objective Coefficient Ranges
Current Allowable Allowable
Variable Coefficient Increase Decrease
4] 4 X( 2) + X( 5) = 12
END
编程
sets:
is/1..3/:b;
js/1..5/:c,x;
links(is,js):a;
endsets
max=sum(js(J):c(J)*x(J));
for(is(I):sum(js(J):a(I,J)*x(J))=b(I));
data:
c=2 3 0 0 0;
X( 1) 50.00000 0.000000
X( 2) 0.000000 2.000000
X( 3) 30.00000 0.000000
A( 1, 1) 6.000000 0.000000
A( 1, 2) 3.000000 0.000000
A( 1, 3) 5.000000 0.000000
A( 2, 1) 3.000000 0.000000
1 14.00000 1.000000
2 0.000000 1.500000
3 0.000000 0.1250000
4 0.000000 0.000000
例题2-11
模型
MAX 2 X( 1) + 3 X( 2)
SUBJECT TO
2] X( 1) + 2 X( 2) + X( 3) = 12
3] 4 X( 1) + X( 4) = 16
2 8.000000 2.000000 4.000000
3 16.00000 16.00000 8.000000
4 12.00000 INFINITY 4.000000
由灵敏度分析表知道C2在【0,4】之间变化时,最优基不变。
第六题
模型
MODEL:
[_1]MAX= 3 * X_1 + X_2 + 4 * X_3 ;
A( 3, 4) 0.000000 0.000000
A( 3, 5) 1.000000 0.000000
Row Slack or Surplus Dual Price
1 17.00000 1.000000
2 0.000000 0.000000
3 0.000000 0.5000000
4 0.000000 0.7500000
b=12 16 12;
a=1 2 1 0 0
4 0 0 1 0
0 4 0 0 1;
enddata
end
最优解
Global optimal solution found at iteration: 2
Objective value: 17.00000
Variable Value Reduced Cost
Row Current Allowable Allowable
RHS Increase Decrease
2 12.00000 INFINITY 2.000000
3 16.00000 8.000000 16.00000
4 12.00000 4.000000 12.00000
例题2-12
模型
MAX 2 X( 1) + 3 X( 2)
for(is(I):sum(js(J):a(I,J)*x(J))=b(I));
data:
c=2 3 0 0 0;
b=8 16 12;
a=1 2 1 0 0
4 0 0 1 0
0 4 0 0 1;
enddata
end
灵敏度分析
Ranges in which the basis is unchanged:
《运筹学/线性规划》实验报告
实验室: 实验日期:
实验项目
线性规划的灵敏度分析
系 别
数学系
姓 名
学 号
班 级
指导教师
成 绩
一 实验目的
掌握用Lingo/Lindo对线性规划问题进行灵敏度分析的方法,理解解报告的内容。初步掌握对实际的线性规划问题建立数学模型,并利用计算机求解分析的一般方法。
二 实验环境
SUBJECT TO
2] X( 1) + 2 X( 2) + X( 3) = 8
3] 4 X( 1) + X( 4) = 16
4] 4 X( 2) + X( 5) = 12
END
编程
sets:
is/1..3/:b;
js/1..5/:c,x;
links(is,js):a;
endsets
max=sum(js(J):c(J)*x(J));
A( 3, 1) 0.000000 0.000000
A( 3, 2) 4.000000 0.000000
A( 3, 3) 0.000000 0.000000
A( 3, 4) 0.000000 0.000000
A( 3, 5) 1.000000 0.000000
Row Slack or Surplus Dual Price
END
编程
sets:
is/1..3/:b;
js/1..5/:c,x;
links(is,js):a;
endsets
max=sum(js(J):c(J)*x(J));
for(is(I):sum(js(J):a(I,J)*x(J))=b(I));
data:
c=2 3 0 0 0;
b=8 16 12;
a=1 2 1 0 0
Objective Coefficient Ranges
Current Allowable Allowable
Variable Coefficient Increase Decrease
X( 1) 2.000000 INFINITY 0.5000000
X( 2) 3.000000 1.000000 3.000000
C( 5) 0.000000 0.000000
X( 1) 4.000000 0.000000
X( 2) 3.000000 0.000000
X( 3) 2.000000 0.000000
X( 4) 0.000000 0.5000000
X( 5) 0.000000 0.7500000
A( 1, 1) 1.000000 0.000000
[_2] 6 * X_1 + 3 * X_2 + 5 * X_3 <= 450 ;
[_3] 3 * X_1 + 4 * X_2 + 5 * X_3 <= 300 ;
END
编程
sets:
is/1..2/:b;
js/1..3/:c,x;
links(is,js):a;
endsets
max=sum(js(J):c(J)*x(J));
4 0 0 1 0
0 4 0 0 1;
enddata
end
灵敏度分析
Ranges in which the basis is unchanged:
Objective Coefficient Ranges
Current Allowable Allowable
Variable Coefficient Increase Decrease
A( 1, 2) 2.000000 0.000000
A( 1, 3) 1.000000 0.000000
A( 1, 4) 0.000000 0.000000
A( 1, 5) 0.000000 0.000000
A( 2, 1) 4.000000 0.000000