线性规划的灵敏度分析实验报告.docx
《线性规划的灵敏度分析实验报告.docx》由会员分享,可在线阅读,更多相关《线性规划的灵敏度分析实验报告.docx(30页珍藏版)》请在冰豆网上搜索。
线性规划的灵敏度分析实验报告
《运筹学/线性规划》实验报告
实验室:
实验日期:
实验项目
线性规划的灵敏度分析
系别
数学系
姓名
学号
班级
指导教师
成绩
一实验目的
掌握用Lingo/Lindo对线性规划问题进行灵敏度分析的方法,理解解报告的内容。
初步掌握对实际的线性规划问题建立数学模型,并利用计算机求解分析的一般方法。
二实验环境
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;
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=23000;
b=81612;
a=12100
40010
04001;
enddata
end
灵敏度分析
Rangesinwhichthebasisisunchanged:
ObjectiveCoefficientRanges
CurrentAllowableAllowable
VariableCoefficientIncreaseDecrease
X
(1)2.000000INFINITY0.5000000
X
(2)3.0000001.0000003.000000
X(3)0.01.500000INFINITY
X(4)0.00.1250000INFINITY
X(5)0.00.75000000.2500000
RighthandSideRanges
RowCurrentAllowableAllowable
RHSIncreaseDecrease
28.0000002.0000004.000000
316.0000016.000008.000000
412.00000INFINITY4.000000
当b2在[8,32]之间变化时最优基不变
最优解
Globaloptimalsolutionfoundatiteration:
0
Objectivevalue:
14.00000
VariableValueReducedCost
B
(1)8.0000000.000000
B
(2)16.000000.000000
B(3)12.000000.000000
C
(1)2.0000000.000000
C
(2)3.0000000.000000
C(3)0.0000000.000000
C(4)0.0000000.000000
C(5)0.0000000.000000
X
(1)4.0000000.000000
X
(2)2.0000000.000000
X(3)0.0000001.500000
X(4)0.0000000.1250000
X(5)4.0000000.000000
A(1,1)1.0000000.000000
A(1,2)2.0000000.000000
A(1,3)1.0000000.000000
A(1,4)0.0000000.000000
A(1,5)0.0000000.000000
A(2,1)4.0000000.000000
A(2,2)0.0000000.000000
A(2,3)0.0000000.000000
A(2,4)1.0000000.000000
A(2,5)0.0000000.000000
A(3,1)0.0000000.000000
A(3,2)4.0000000.000000
A(3,3)0.0000000.000000
A(3,4)0.0000000.000000
A(3,5)1.0000000.000000
RowSlackorSurplusDualPrice
114.000001.000000
20.0000001.500000
30.0000000.1250000
40.0000000.000000
例题2-11
模型
MAX2X
(1)+3X
(2)
SUBJECTTO
2]X
(1)+2X
(2)+X(3)=12
3]4X
(1)+X(4)=16
4]4X
(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=23000;
b=121612;
a=12100
40010
04001;
enddata
end
最优解
Globaloptimalsolutionfoundatiteration:
2
Objectivevalue:
17.00000
VariableValueReducedCost
B
(1)12.000000.000000
B
(2)16.000000.000000
B(3)12.000000.000000
C
(1)2.0000000.000000
C
(2)3.0000000.000000
C(3)0.0000000.000000
C(4)0.0000000.000000
C(5)0.0000000.000000
X
(1)4.0000000.000000
X
(2)3.0000000.000000
X(3)2.0000000.000000
X(4)0.0000000.5000000
X(5)0.0000000.7500000
A(1,1)1.0000000.000000
A(1,2)2.0000000.000000
A(1,3)1.0000000.000000
A(1,4)0.0000000.000000
A(1,5)0.0000000.000000
A(2,1)4.0000000.000000
A(2,2)0.0000000.000000
A(2,3)0.0000000.000000
A(2,4)1.0000000.000000
A(2,5)0.0000000.000000
A(3,1)0.0000000.000000
A(3,2)4.0000000.000000
A(3,3)0.0000000.000000
A(3,4)0.0000000.000000
A(3,5)1.0000000.000000
RowSlackorSurplusDualPrice
117.000001.000000
20.0000000.000000
30.0000000.5000000
40.0000000.7500000
最优解(4,3,2,0,0)最优值z=17
分析
Rangesinwhichthebasisisunchanged:
ObjectiveCoefficientRanges
CurrentAllowableAllowable
VariableCoefficientIncreaseDecrease
X
(1)2.000000INFINITY2.000000
X
(2)3.000000INFINITY3.000000
X(3)0.01.500000INFINITY
X(4)0.00.5000000INFINITY
X(5)0.00.7500000INFINITY
RighthandSideRanges
RowCurrentAllowableAllowable
RHSIncreaseDecrease
212.00000INFINITY2.000000
316.000008.00000016.00000
412.000004.00000012.00000
例题2-12
模型
MAX2X
(1)+3X
(2)
SUBJECTTO
2]X
(1)+2X
(2)+X(3)=8
3]4X
(1)+X(4)=16
4]4X
(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=23000;
b=81612;
a=12100
40010
04001;
enddata
end
灵敏度分析
Rangesinwhichthebasisisunchanged:
ObjectiveCoefficientRanges
CurrentAllowableAllowable
VariableCoefficientIncreaseDecrease
X
(1)2.000000INFINITY0.5000000
X
(2)3.0000001.0000003.000000
X(3)0.01.500000INFINITY
X(4)0.00.1250000INFINITY
X(5)0.00.75000000.2500000
RighthandSideRanges
RowCurrentAllowableAllowable
RHSIncreaseDecrease
28.0000002.0000004.000000
316.0000016.000008.000000
412.00000INFINITY4.000000
由灵敏度分析表知道C2在【0,4】之间变化时,最优基不变。
第六题
模型
MODEL:
[_1]MAX=3*X_1+X_2+4*X_3;
[_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));
@for(is(I):
@sum(js(J):
a(I,J)*x(J))<=b(I));
data:
c=314;
b=450300;
a=635
345;
enddata
End
最优解Globaloptimalsolutionfound.
Objectivevalue:
270.0000
Infeasibilities:
0.000000
Totalsolveriterations:
2
VariableValueReducedCost
B
(1)450.00000.000000
B
(2)300.00000.000000
C
(1)3.0000000.000000
C
(2)1.0000000.000000
C(3)4.0000000.000000
X
(1)50.000000.000000
X
(2)0.0000002.000000
X(3)30.000000.000000
A(1,1)6.0000000.000000
A(1,2)3.0000000.000000
A(1,3)5.0000000.000000
A(2,1)3.0000000.000000
A(2,2)4.0000000.000000
A(2,3)5.0000000.000000
RowSlackorSurplusDualPrice
1270.00001.000000
20.0000000.2000000
30.0000000.6000000
第一问:
A生产50B生产0C生产30有最高利润270元;
第二问:
单个价值系数和右端系数变化范围的灵敏度分析结果
Rangesinwhichthebasisisunchanged:
ObjectiveCoefficientRanges
CurrentAllowableAllowable
VariableCoefficientIncreaseDecrease
X
(1)3.0000001.8000000.6000000
X
(2)1.0000002.000000INFINITY
X(3)4.0000001.0000001.500000
RighthandSideRanges
RowCurrentAllowableAllowable
RHSIncreaseDecrease
2450.0000150.0000150.0000
3300.0000150.000075.00000
当A的利润在【2.4,4.8】之间变化时,原最优生产计划不变。
第三问:
模型
MODEL:
[_1]MAX=3*X_1+X_2+4*X_3+3*X_4;
[_2]6*X_1+3*X_2+5*X_3+8*X_4<=450;
[_3]3*X_1+4*X_2+5*X_3+2*X_4<=300;
END
编程
sets:
is/1..2/:
b;
js/1..4/:
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=3143;
b=450300;
a=6358
3452;
enddata
End
最优解
Globaloptimalsolutionfound.
Objectivevalue:
275.0000
Infeasibilities:
0.000000
Totalsolveriterations:
2
VariableValueReducedCost
B
(1)450.00000.000000
B
(2)300.00000.000000
C
(1)3.0000000.000000
C
(2)1.0000000.000000
C(3)4.0000000.000000
C(4)3.0000000.000000
X
(1)0.0000000.1000000
X
(2)0.0000001.966667
X(3)50.000000.000000
X(4)25.000000.000000
A(1,1)6.0000000.000000
A(1,2)3.0000000.000000
A(1,3)5.0000000.000000
A(1,4)8.0000000.000000
A(2,1)3.0000000.000000
A(2,2)4.0000000.000000
A(2,3)5.0000000.000000
A(2,4)2.0000000.000000
RowSlackorSurplusDualPrice
1275.00001.000000
20.0000000.2333333
30.0000000.5666667
利润275元值得生产。
第四问
由单个价值系数和右端系数变化范围的灵敏度分析结果
Rangesinwhichthebasisisunchanged:
ObjectiveCoefficientRanges
CurrentAllowableAllowable
VariableCoefficientIncreaseDecrease
X
(1)3.0000001.8000000.6000000
X
(2)1.0000002.000000INFINITY
X(3)4.0000001.0000001.500000
RighthandSideRanges
RowCurrentAllowableAllowable
RHSIncreaseDecrease
2450.0000150.0000150.0000
3300.0000150.000075.00000
当购买150吨时此时可买360元在减去购买150吨的进价60元此时可获利300超过了原计划,应该购买。
第七题
模型
MODEL:
[_1]MAX=30*X_1+20*X_2+50*X_3;
[_2]X_1+2*X_2+X_3<=430;
[_3]3*X_1+2*X_3<=410;
[_4]X_1+4*X_2<=420;
[_5]X_1+X_2+X_3<=300;
[_6]X_2>=70;
[_7]X_3<=240;
END
编程
sets:
is/1..6/:
b;
js/1..3/:
c,x;
links(is,js):
a;
endsets
max=@sum(js(J):
c(J)*x(J));
@sum(js(J):
a(1,J)*x(J))<=b
(1);
@sum(js(J):
a(2,J)*x(J))<=b
(2);
@sum(js(J):
a(3,J)*x(J))<=b(3);
@sum(js(J):
a(4,J)*x(J))<=b(4);
@sum(js(J):
a(5,J)*x(J))>=B(5);
@sum(js(J):
a(6,J)*x(J))<=b(6);
data:
c=302050;
b=43041042030070240;
a=121
302
140
111
010
001;
enddata
end
最优解
Globaloptimalsolutionfound.
Objectivevalue:
12150.00
Infeasibilities:
0.000000
Totalsolveriterations:
4
VariableValueReducedCost
B
(1)430.00000.000000
B
(2)410.00000.000000
B(3)420.00000.000000
B(4)300.00000.000000
B(5)70.000000.000000
B(6)240.00000.000000
C
(1)30.000000.000000
C
(2)20.000000.000000
C(3)50.000000.000000
X
(1)0.00000035.00000
X
(2)95.000000.000000
X(3)205.00000.000000
A(1,1)1.0000000.000000
A(1,2)2.0000000.000000
A(1,3)1.0000000.000000
A(2,1)3.0000000.000000
A(2,2)0.0000000.000000
A(2,3)2.0000000.000000
A(3,1)1.0000000.000000
A(3,2)4.0000000.000000
A(3,3)0.0000000.000000
A(4,1)1.0000000.000000
A(4,2)1.0000000.000000
A(4,3)1.0000000.000000
A(5,1)0.0000000.000000
A(5,2)1.0000000.000000
A(5,3)0.0000000.000000
A(6,1)0.0000000.000000
A(6,2)0.0000000.000000
A(6,3)1.0000000.000000
RowSlackorSurplusDualPrice
112150.001.000000
235.000000.000000
30.00000015.00000
440.000000.000000
50.00000020.00000
625.000000.000000
735.000000.000000
最优解(095205)最优值12150
第一问
模型
MODEL:
[_1]MAX=30*X_1+20*X_2+60*X_3;
[_2]X_1+2*X_2+X_3<=430;
[_3]3*X_1+2*X_3<=410;
[_4]X_1+4*X_2<