资源描述:
《大学数学建模实习报告作业汇总new》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、一、线性规划问题评分:题目1:一车队有8辆车,这8辆车存放在不同地点,队长要派其中5辆到个不同的工地去运货。各车从存放处调到装货地点所需费用列于表2.5.问应选用哪五辆车调到何处去运货,才能使各车从所在地点调到装货地点所需的费用最少(要求分别用matlab和Lingo编程求解)?表2.5调车费用表-装货地点车号123456781302518322719222622931191821203019328293019192223264293019242519182152120181716141618(1)解:记表示第j号车调到装货地点i所需的费用。引进
2、0-1变量,建立如下的0-1整数规划模型:(1)编写的matlab程序如下clc,clearc=[30251832271922262931191821203019282930191922232629301924251918212120181716141618];c=c(:);a=zeros(8,40);forj=1:8a(j,[(j-1)*5+1:5*j])=1;endb=ones(8,1);d=zeros(5,40);fori=1:5d(i,[i:5:40])=1;ende=ones(5,1);[x,fval]=bintprog(c,a,b,d
3、,e);x=reshape(x,[5,8])fval运行结果如下:x=(1,3)1(2,4)1(3,5)1(5,6)1(4,7)1fval=87所以最优方案为Lingo程序如下model:sets:col/1..5/:i;var/1..8/:j;links(col,var):c,x;endsetsdata:c=30251832271922262931191821203019282930191922232629301924251918212120181716141618;enddatamin=@sum(links:c*x);@for(col(i):
4、@sum(var(j):x(i,j))=1);@for(var(j):@sum(col(i):x(i,j))<=1);@for(links:@bin(x));end运行结果为Objectivevalue:87.00000X(1,1)0.00000030.00000X(1,2)0.00000025.00000X(1,3)1.00000018.00000X(1,4)0.00000032.00000X(1,5)0.00000027.00000X(1,6)0.00000019.00000X(1,7)0.00000022.00000X(1,8)0.0000
5、0026.00000X(2,1)0.00000029.00000X(2,2)0.00000031.00000X(2,3)0.00000019.00000X(2,4)1.00000018.00000X(2,5)0.00000021.00000X(2,6)0.00000020.00000X(2,7)0.00000030.00000X(2,8)0.00000019.00000X(3,1)0.00000028.00000X(3,2)0.00000029.00000X(3,3)0.00000030.00000X(3,4)0.00000019.00000X(
6、3,5)1.00000019.00000X(3,6)0.00000022.00000X(3,7)0.00000023.00000X(3,8)0.00000026.00000X(4,1)0.00000029.00000X(4,2)0.00000030.00000X(4,3)0.00000019.00000X(4,4)0.00000024.00000X(4,5)0.00000025.00000X(4,6)0.00000019.00000X(4,7)1.00000018.00000X(4,8)0.00000021.00000X(5,1)0.000000
7、21.00000X(5,2)0.00000020.00000X(5,3)0.00000018.00000X(5,4)0.00000017.00000X(5,5)0.00000016.00000X(5,6)1.00000014.00000X(5,7)0.00000016.00000X(5,8)0.00000018.00000所以最优方案为第2题某单位需要加工制作100套钢架,每套用长为2.9m,2.1m和1m的圆钢各一根。已知原料长6.9m,问应如何下料,使用的原材料最省。解:列出所有可行性方案如下表方案长度一X1二X2三X3四X4五X5六X6七X
8、72.92.111111421322146合计(米)剩余(米)60.96.906.80.16.30.66.20.76.10.860.9第