资源描述:
《数学实验Lingo软件和其应用》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Lingo软件及其应用班级数学092姓名李荣学号200912010206(一)1.求解整数规划给出最优解及最优值。程序:model:,sets:ba/1..7/:x,c,a1,a2,a3;bb/1,2,3/:b;endsetsdata:c=3133113;b=502015;a1=3321100;a2=0102130;a3=0010102;enddatamin=@sum(ba(I):c(I)*x(I));@sum(ba(I):a1(I)*x(I))>=b(1);@sum(ba(I):a2(I)*x(I))>=b(2);@sum(ba(I):a3(I)*x(I))
2、>=b(3);endGlobaloptimalsolutionfound.Objectivevalue:26.66667Totalsolveriterations:4RowSlackorSurplusDualPrice126.66667-1.00000020.000000-0.333333336.6666670.00000040.000000-0.66666672.求解混合规划:model:sets:ba/1..5/:x,c,a1,a2,a3,a4;bb/1,2,3,4/:b;endsetsdata:c=31331;b=50204040;enddatamin=
3、@sum(ba(i):c(i)*x(i));@for(bb(J):@sum(ba(i)
4、i#ne#j:x(i))>=b(j););Globaloptimalsolutionfound.Objectivevalue:50.00000Totalsolveriterations:9VariableValueReducedCostX(1)0.0000003.000000X(2)30.000000.000000X(3)0.0000002.000000X(4)0.0000002.000000X(5)20.000000.000000RowSlackorSurplusDual
5、Price150.00000-1.00000020.000000-1.00000030.0000000.000000410.000000.000000510.000000.000000((二)3.求解混合规划其中:(要求:必须利用集合语言描述,a)前三个约束用三个语句表达,b)第4-7的约束用sum和for用1个语句完成,c)最后12个约束用1个语句完成d)目标函数用一个语句完成。)e)请将结果填入下面的表格中,不能用人工填写的方式完成(用ole函数完成)。model:sets:aa/1..3/:b1;bb/1..4/:b2;cc(aa,bb):x,c;end
6、setsdata:c=2768786984210;b1=304050;b2=100100100100;@ole(E:ddd.xls,x)=x;enddatamin=@sum(cc(i,j):c(i,j)*x(i,j));@for(aa(i):@sum(bb(j):x(i,j))>=b1(i););@for(bb(j):@sum(aa(i):x(i,j))>=b2(j););@for(cc(i,j):@gin(x(i,j)););End100006000040010010004.要求:1-4约束用一个语句完成,5-7用一个语句完成。model:sets:aa/
7、1,2,3/:x,y,c1,c2,a1,a2,a3,a4,f;bb/1,2,3,4/:b;endsetsdata:c1=348;c2=-100-150-200;a1=248;a2=234;a3=123;a4=357;f=200150700;enddatamax=@sum(aa(i):c1(i)*x(i)+c2(i)*y(i));@sum(aa(i):a1(i)*x(i))<=b(1);@sum(aa(i):a2(i)*x(i))<=b(2);@sum(aa(i):a3(i)*x(i))<=b(3);@sum(aa(i):a4(i)*x(i))<=b(4);@f
8、or(aa(i):x(i)<=f(i)*y(i););@for(aa(i):@gin(x(i));@gin(x(i)););endVariableValueX(1)1.234568X(2)1.234568X(3)1.234568Y(1)1.234568Y(2)1.234568Y(3)1.234568RowSlackorSurplus10.00000021.23456831.23456841.23456851.23456861.23456871.23456881.2345685.某小卖部6天卖出热茶的杯数(y)与当天气温(x)之间是线性相关的。数据如下表[来源:
9、学§科§网Z§X§X§K]气温(xi)