资源描述:
《《LINGO实习报告》word版.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、Lingo实习报告姓名:张永桥班级:信息计算101801班学号:201018030131LINGO实习报告1.直接用LINGO来解如下二次规划问题:程序:max=98*x1+277*x2-x1^2-2*x2^2-0.3*x1*x2;x1+x2<=100;x1<=2*x2;@gin(x1);@gin(x2);2.例SAILCO公司需要决定下四个季度的帆船生产量。下四个季度的帆船需求量分别是40条,60条,75条,25条,这些需求必须按时满足。每个季度正常的生产能力是40条帆船,每条船的生产费用为400美元。如果加班生产,每条船的生产费用为450美元。每个季度末,每条船的库存费用
2、为20美元。假定生产提前期为0,初始库存为10条船。如何安排生产可使总费用最小?程序:sets:quarters/1,2,3,4/:dem,rp,op,inv;endsetsmin=@sum(quarters:400*rp+450*op+20*inv);@for(quarters(i):rp(i)<40);@for(quarters(i)
3、i#gt#1:inv(i)=inv(i-1)+rp(i)+op(i)-dem(i););inv(1)=10+rp(1)+op(1)+-dem(1);data:dem=40,60,75,25;enddata运行结果:Globaloptimal
4、solutionfound.Objectivevalue:145750.0Infeasibilities:0.000000Totalsolveriterations:4VariableValueReducedCostXQ(1)40.000000.000000XQ(2)60.000000.000000XQ(3)75.000000.000000XQ(4)25.000000.000000XQ(5)30.000000.000000XQ(6)65.000000.000000XQ(7)50.000000.000000XQ(8)20.000000.000000ZC(1)40.000000.
5、000000ZC(2)40.000000.000000ZC(3)40.000000.000000ZC(4)40.000000.000000ZC(5)40.000000.000000ZC(6)40.000000.000000ZC(7)40.000000.000000ZC(8)20.000000.000000JB(1)0.00000020.00000JB(2)10.000000.000000JB(3)35.000000.000000JB(4)0.00000040.00000JB(5)0.00000020.00000JB(6)0.0000000.000000JB(7)10.0000
6、00.000000JB(8)0.00000050.00000KC(1)10.000000.000000KC(2)0.00000020.00000KC(3)0.00000060.00000KC(4)15.000000.000000KC(5)25.000000.000000KC(6)0.00000020.00000KC(7)0.00000070.00000KC(8)0.000000420.0000RowSlackorSurplusDualPrice1145750.0-1.00000020.00000030.0000030.00000050.0000040.00000050.000
7、0050.00000010.0000060.00000030.0000070.00000050.0000080.00000050.00000920.000000.000000100.000000430.0000110.000000450.0000120.000000450.0000130.000000410.0000140.000000430.0000150.000000450.0000160.000000450.0000170.000000400.00003.例3.4建筑工地的位置(用平面坐标a,b表示,距离单位:公里)及水泥日用量d(吨)下表给出。有两个临时料场位于P(5
8、,1),Q(2,7),日储量各有20吨。从A,B两料场分别向各工地运送多少吨水泥,使总的吨公里数最小。两个新的料场应建在何处,节省的吨公里数有多大?123456a1.258.750.55.7537.25b1.250.754.7556.57.75d3547611程序:model:sets:gdjh/1..6/:a,b,d;lcjh/1,2/:x,y,e;gdlcjh(gdjh,lcjh):c;endsetsdata:a=1.25,8.75,0.5,5.75,3,7.25;b=1.25,0.75,4.75,