## 数学建模 原料

 原料 X1 X2 X3 X4 X5 X6 X7 X8 方案一 2 5 3 3 2 1 3 1 剩余总根数 23 4 6 8 5 17 1 10 方案二 3 4 3 3 1 2 3 1 剩余总根数 10 15 6 8 16 6 1 10 方案三 3 5 2 2 2 2 3 1 剩余总根数 10 4 19 21 5 6 1 10

Lingo软件编程：

max=y;

3*x1+3.5*x2+4*x3+4.5*x4+5*x5+5.5*x6+6*x7+6.5*x8=89;

x1+x2+x3+x4+x5+x6+x7+x8=20;

y*x1<=43;

y*x2<=59;

y*x3<=39;

y*x4<=41;

y*x5<=27;

y*x6<=28;

y*x7<=34;

y*x8<=21;

@gin(x1);@bnd(0,x1,43);

@gin(x2);@bnd(0,x2,59);

@gin(x3);@bnd(0,x3,39);

@gin(x4);@bnd(0,x4,41);

@gin(x5);@bnd(0,x5,27);

@gin(x6);@bnd(0,x6,28);

@gin(x7);@bnd(0,x7,34);

@gin(x8);@bnd(0,x8,21);

@gin(y);

Matlab编程：

function y1

c=1;

for x1=0:43/11

for x2=0:59/11

for x3=0:39/11

for x4=0:41/11

for x5=0:27/11

for x6=0:28/11

for x7=0:34/11

for x8=0:21/11

k1=x1*3+x2*3.5+x3*4+x4*4.5+x5*5+x6*5.5+x7*6+x8*6.5;

k2=x1+x2+x3+x4+x5+x6+x7+x8;

if(k1==89)&(k2==20)

fprintf('µÚ%dÖÖ \n %d,%d,%d,%d,%d,%d,%d,%d \n',c,x1,x2,x3,x4,x5,x6,x7,x8)

c=c+1;

end

end

end

end

end

end

end

end

end

 长度 3-3.4 3.5-3.9 4-4.4 4.5-4.9 5-5.4 5.5-5.9 6-6.4 6.5-6.9 方案一 3 4 2 2 5 2 0 2 剩余总根数 1 3 0 2 1 0 1 4 方案二 3 5 2 1 5 1 0 3 剩余总根数 1 0 0 5 1 3 1 1 方案三 3 5 2 2 3 2 0 3 剩余总根数 1 0 0 2 7 0 1 1

Lingo编程：

max=y;

3*x1+3.5*x2+4*x3+4.5*x4+5*x5+5.5*x6+6*x7+6.5*x8=89;

x1+x2+x3+x4+x5+x6+x7+x8=20;

y*x1<=10;

y*x2<=15;

y*x3<=6;

y*x4<=8;

y*x5<=16;

y*x6<=6;

y*x7<=1;

y*x8<=10;

@gin(x1);@bnd(0,x1,10);

@gin(x2);@bnd(0,x2,15);

@gin(x3);@bnd(0,x3,6);

@gin(x4);@bnd(0,x4,8);

@gin(x5);@bnd(0,x5,16);

@gin(x6);@bnd(0,x6,6);

@gin(x7);@bnd(0,x7,1);

@gin(x8);@bnd(0,x8,10);

@gin(y);

Matlab编程：

function y2

c=1;

for x1=0:10/3

for x2=0:15/3

for x3=0:6/3

for x4=0:8/3

for x5=0:16/3

for x6=0:6/3

for x7=0:1/3

for x8=0:10/3

k1=x1*3+x2*3.5+x3*4+x4*4.5+x5*5+x6*5.5+x7*6+x8*6.5;

k2=x1+x2+x3+x4+x5+x6+x7+x8;

if(k1==89)&(k2==20)

fprintf('%d\n %d,%d,%d,%d,%d,%d,%d,%d\n',c,x1,x2,x3,x4,x5,x6,x7,x8)

c=c+1;

end

end

end

end

end

end

end

end

end

 3-3.4 3.5-3.9 4-4.4 4.5-4.9 5-5.4 5.5-5.9 6-6.4 6.5-6.9 11捆 3 4 3 3 1 2 3 1 3捆 3 5 2 1 5 1 0 3

 原料 X23 X24 X25 X26 X27 X28 X29 X30 根数 0 0 0 1 0 0 1 0 剩余总根数 4 5 3 4 1 0 3 0 X31 X32 X33 X34 X35 X36 X37 X38 根数 1 0 2 0 0 0 0 0 剩余总根数 1 10 14 1 7 4 0 16 X39 X40 X41 X42 X43 X44 X45 X46 根数 0 0 0 0 0 0 0 0 剩余总根数 0 2 0 5 0 0 0 1

Lingo编程：

max=y;

14*x1+14.5*x2+15*x3+15.5*x4+16*x5+16.5*x6+17*x7+17.5*x8+18*x9+18.5*x10+19*x11+19.5*x12+20*x13+21*x15+21.5*x16+22*x17+22.5*x18+23*x19+23.5*x20+24*x21+24.5*x22+25*x23+25.5*x24=89;

x1+x2+x3+x4+x5+x6+x7+x8+x9+x11+x12+x13+x14+x15+x16+x17+x18+x19+x20+x21+x22+x23+x24=5;

y*x1<=4;

y*x2<=5;

y*x3<=3;

y*x4<=11;

y*x5<=1;

y*x6<=0;

y*x7<=3;

y*x8<=7;

y*x9<=8;

y*x10<=10;

y*x11<=28;

y*x12<=1;

y*x13<=7;

y*x14<=4;

y*x15<=0;

y*x16<=16;

y*x17<=0;

y*x18<=2;

y*x19<=0;

y*x20<=6;

y*x21<=0;

y*x22<=0;

y*x23<=0;

y*x24<=1;

@gin(x1);@bnd(0,x1,4);

@gin(x2);@bnd(0,x2,5);

@gin(x3);@bnd(0,x3,3);

@gin(x4);@bnd(0,x4,11);

@gin(x5);@bnd(0,x5,1);

@gin(x6);@bnd(0,x6,0);

@gin(x7);@bnd(0,x7,3);

@gin(x8);@bnd(0,x8,7);

@gin(x9);@bnd(0,x9,8);

@gin(x10);@bnd(0,x10,10);

@gin(x11);@bnd(0,x11,28);

@gin(x12);@bnd(0,x12,1);

@gin(x13);@bnd(0,x13,7);

@gin(x14);@bnd(0,x14,4);

@gin(x15);@bnd(0,x15,0);

@gin(x16);@bnd(0,x16,16);

@gin(x17);@bnd(0,x17,0);

@gin(x18);@bnd(0,x18,2);

@gin(x19);@bnd(0,x19,0);

@gin(x20);@bnd(0,x20,6);

@gin(x21);@bnd(0,x21,0);

@gin(x22);@bnd(0,x22,0);

@gin(x23);@bnd(0,x23,0);

@gin(x24);@bnd(0,x24,1);

@gin(x8);

@gin(y);

@bnd(0,y,136);

Matlab编程：

function y34

c=1;

for x1=0:4/7

for x2=0:5/7

for x3=0:3/7

for x4=0:11/7

for x5=0:1/7

for x6=0:0/7

for x7=0:3/7

for x8=0:7/7

for x9=0:8/7

for x10=0:10/7

for x11=0:28/7

for x12=0:1/7

for x13=0:7/7

for x14=0:4/7

for x15=0:0/7

for x16-0:16/7

for x17=0:0/7

for x18=0:2/7

for x19=0:0/7                                                                           for x20=0:6/7                                                                            for x21=0:0/7                                                                             for x22=0:0/7                                                                                    for x23=0:0/7                                                                                      for x24=0:1/7                                                                                       k1=14*x1+14.5*x2+15*x3+15.5*x4+16*x5+16.5*x6+17*x7+17.5*x8+18*x9+18.5*x10+19*x11+19.5*x12+20*x13+20.5*x14+21*x15+21.5*x16+22*x17+22.5*x18+23*x19+23.6*x20+24*x21+24.5*x22+25*x23+25.5*x24;                                                                                      k2=x1+x2+x3+x4+x5+x6+x7+x8+x9+x10+x11+x12+x13+x14+x15+x16+x17+x18+x19+x20+x21+x22+x23+x24;                                                                                    if(k1==89)&(k2==5)                                                                                        fprintf('%d \n %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,\n',c,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24)                                                                                           c=c+1;                                                                                      end                                                                                     end                                                                                   end

end

end

end

end

end

end

end

end

end

end

end

end

end

end

end

end

end

end

end

end

end

 原料 X23 X24 X25 X26 X27 X28 X29 X30 方案一 1 0 0 1 0 0 0 0 方案二 1 0 0 1 0 0 0 0 方案三 1 0 0 0 0 0 0 0 方案四 1 1 0 1 0 0 0 0 X31 X32 X33 X34 X35 X36 X37 X38 方案一 0 0 1 0 1 1 0 0 方案二 0 0 2 0 0 0 0 1 方案三 0 2 2 0 0 0 0 0 方案四 0 0 0 0 0 0 0 1 X39 X40 X41 X42 X43 X44 X45 X46 方案一 0 0 0 0 0 0 0 0 方案二 0 0 0 0 0 0 0 0 方案三 0 0 0 0 0 00 0 0 方案四 0 0 0 1 0 0 0 0

Lingo编程：

max=y;

14*x1+14.5*x2+15*x3+15.5*x4+16*x5+16.5*x6+17*x7+17.5*x8+18*x9+18.5*x10+19*x11+19.5*x12+20*x13+21*x15+21.5*x16+22*x17+22.5*x18+23*x19+23.5*x20+24*x21+24.5*x22+25*x23+25.5*x24=89;

x1+x2+x3+x4+x5+x6+x7+x8+x9+x11+x12+x13+x14+x15+x16+x17+x18+x19+x20+x21+x22+x23+x24=5;

y*x1<=4;

y*x2<=5;

y*x3<=3;

y*x4<=4;

y*x5<=1;

y*x6<=0;

y*x7<=3;

y*x8<=0;

y*x9<=1;

y*x10<=10;

y*x11<=14;

y*x12<=1;

y*x13<=7;

y*x14<=4;

y*x15<=0;

y*x16<=16;

y*x17<=0;

y*x18<=2;

y*x19<=0;

y*x20<=6;

y*x21<=0;

y*x22<=0;

y*x23<=0;

y*x24<=1;

@gin(x1);@bnd(0,x1,4);

@gin(x2);@bnd(0,x2,5);

@gin(x3);@bnd(0,x3,3);

@gin(x4);@bnd(0,x4,4);

@gin(x5);@bnd(0,x5,1);

@gin(x6);@bnd(0,x6,0);

@gin(x7);@bnd(0,x7,3);

@gin(x8);@bnd(0,x8,0);

@gin(x9);@bnd(0,x9,1);

@gin(x10);@bnd(0,x10,10);

@gin(x11);@bnd(0,x11,14);

@gin(x12);@bnd(0,x12,1);

@gin(x13);@bnd(0,x13,7);

@gin(x14);@bnd(0,x14,4);

@gin(x15);@bnd(0,x15,0);

@gin(x16);@bnd(0,x16,16);

@gin(x17);@bnd(0,x17,0);

@gin(x18);@bnd(0,x18,2);

@gin(x19);@bnd(0,x19,0);

@gin(x20);@bnd(0,x20,6);

@gin(x21);@bnd(0,x21,0);

@gin(x22);@bnd(0,x22,0);

@gin(x23);@bnd(0,x23,0);

@gin(x24);@bnd(0,x24,1);

@gin(x8);

@gin(y);

@bnd(0,y,136);

Matlab编程（如上搭配）

 原料 方案一 方案二 方案三 方案四 方案五 方案六 方案七 方案八 X23 0 0 0 0 0 0 0 0 X24 0 0 01 1 1 1 1 1 X25 1 1 0 0 1 1 1 1 X26 1 1 1 1 0 0 0 1 X27 0 0 0 0 0 0 0 0 X28 0 0 0 0 0 0 0 0 X29 0 1 0 1 0 0 1 0 X30 0 0 0 0 0 0 0 0 X31 0 0 0 0 0 0 0 0 X32 0 0 0 0 0 0 0 0 X33 2 0 1 0 1 2 1 0 X34 0 0 0 0 0 0 0 0 X35 0 1 2 0 1 0 0 0 X36 1 0 0 1 1 0 0 1 X37 0 0 0 0 0 0 0 0 X38 0 1 0 1 0 1 0 0 X39 0 0 0 0 0 0 0 0 X40 0 0 0 0 0 0 0 0 X41 0 0 0 0 0 0 0 0 X42 0 0 0 0 0 0 1 1 X43 0 0 0 0 0 0 0 0 X45 0 0 0 0 0 0 0 0 X46 0 0 0 0 0 0 0 0

Lingo编程：

max=y;

14*x1+14.5*x2+15*x3+15.5*x4+16*x5+16.5*x6+17*x7+17.5*x8+18*x9+18.5*x10+19*x11+19.5*x12+20*x13+21*x15+21.5*x16+22*x17+22.5*x18+23*x19+23.5*x20+24*x21+24.5*x22+25*x23+25.5*x24=89;

x1+x2+x3+x4+x5+x6+x7+x8+x9+x11+x12+x13+x14+x15+x16+x17+x18+x19+x20+x21+x22+x23+x24=5;

y*x1<=0;

y*x2<=5;

y*x3<=3;

y*x4<=4;

y*x5<=1;

y*x6<=0;

y*x7<=3;

y*x8<=0;

y*x9<=1;

y*x10<=2;

y*x11<=6;

y*x12<=1;

y*x13<=7;

y*x14<=4;

y*x15<=0;

y*x16<=16;

y*x17<=0;

y*x18<=2;

y*x19<=0;

y*x20<=6;

y*x21<=0;

y*x22<=0;

y*x23<=0;

y*x24<=1;

@gin(x1);@bnd(0,x1,0);

@gin(x2);@bnd(0,x2,5);

@gin(x3);@bnd(0,x3,3);

@gin(x4);@bnd(0,x4,4);

@gin(x5);@bnd(0,x5,1);

@gin(x6);@bnd(0,x6,0);

@gin(x7);@bnd(0,x7,3);

@gin(x8);@bnd(0,x8,0);

@gin(x9);@bnd(0,x9,1);

@gin(x10);@bnd(0,x10,2);

@gin(x11);@bnd(0,x11,6);

@gin(x12);@bnd(0,x12,1);

@gin(x13);@bnd(0,x13,7);

@gin(x14);@bnd(0,x14,4);

@gin(x15);@bnd(0,x15,0);

@gin(x16);@bnd(0,x16,16);

@gin(x17);@bnd(0,x17,0);

@gin(x18);@bnd(0,x18,2);

@gin(x19);@bnd(0,x19,0);

@gin(x20);@bnd(0,x20,6);

@gin(x21);@bnd(0,x21,0);

@gin(x22);@bnd(0,x22,0);

@gin(x23);@bnd(0,x23,0);

@gin(x24);@bnd(0,x24,1);

@gin(x8);

@gin(y);

@bnd(0,y,136);

Matlab编程（如上搭配）

 原料 X23 X24 X25 X26 X27 X28 X29 X30 方案一 0 1 1 0 0 0 0 0 方案二 0 1 1 0 0 0 1 0 X31 X32 X33 X34 X35 X36 X37 X38 方案一 0 0 1 0 0 0 2 0 方案二 0 0 1 0 0 0 0 0 X39 X40 X41 X42 X43 X44 X45 X46 方案一 0 0 0 0 0 0 0 0 方案二 0 0 0 1 0 0 0 0

Lingo编程：

max=y;

14*x1+14.5*x2+15*x3+15.5*x4+16*x5+16.5*x6+17*x7+17.5*x8+18*x9+18.5*x10+19*x11+19.5*x12+20*x13+21*x15+21.5*x16+22*x17+22.5*x18+23*x19+23.5*x20+24*x21+24.5*x22+25*x23+25.5*x24=89;

x1+x2+x3+x4+x5+x6+x7+x8+x9+x11+x12+x13+x14+x15+x16+x17+x18+x19+x20+x21+x22+x23+x24=5;

y*x1<=0;

y*x2<=2;

y*x3<=3;

y*x4<=1;

y*x5<=1;

y*x6<=0;

y*x7<=3;

y*x8<=0;

y*x9<=1;

y*x10<=10;

y*x11<=3;

y*x12<=1;

y*x13<=1;

y*x14<=4;

y*x15<=0;

y*x16<=16;

y*x17<=0;

y*x18<=2;

y*x19<=0;

y*x20<=6;

y*x21<=0;

y*x22<=0;

y*x23<=0;

y*x24<=1;

@gin(x1);@bnd(0,x1,0);

@gin(x2);@bnd(0,x2,2);

@gin(x3);@bnd(0,x3,3);

@gin(x4);@bnd(0,x4,1);

@gin(x5);@bnd(0,x5,1);

@gin(x6);@bnd(0,x6,0);

@gin(x7);@bnd(0,x7,3);

@gin(x8);@bnd(0,x8,0);

@gin(x9);@bnd(0,x9,1);

@gin(x10);@bnd(0,x10,10);

@gin(x11);@bnd(0,x11,3);

@gin(x12);@bnd(0,x12,1);

@gin(x13);@bnd(0,x13,1);

@gin(x14);@bnd(0,x14,4);

@gin(x15);@bnd(0,x15,0);

@gin(x16);@bnd(0,x16,16);

@gin(x17);@bnd(0,x17,0);

@gin(x18);@bnd(0,x18,2);

@gin(x19);@bnd(0,x19,0);

@gin(x20);@bnd(0,x20,6);

@gin(x21);@bnd(0,x21,0);

@gin(x22);@bnd(0,x22,0);

@gin(x23);@bnd(0,x23,0);

@gin(x24);@bnd(0,x24,1);

@gin(x8);

@gin(y);

@bnd(0,y,136);

Matlab编程（如上搭配）

 原料 X23 X24 X25 X26 X27 X28 X29 X30 根数 0 0 1 1 1 0 0 0 剩余总根数 0 0 0 0 0 0 3 0 X31 X32 X33 X34 X35 X36 X37 X38 根数 0 0 1 0 0 0 0 0 剩余总根数 1 0 2 1 1 0 0 16 X39 X40 X41 X42 X43 X44 X45 X46 根数 0 0 0 1 0 0 0 0 剩余总根数 0 2 0 5 0 0 0 1

Lingo编程（如上搭配）

Matlab编程（如上搭配）

 原料 X23 X24 X25 X26 X27 X28 X29 X30 根数 0 0 0 0 0 0 3 0 剩余总根数 0 0 0 0 0 0 0 0 X31 X32 X33 X34 X35 X36 X37 X38 根数 1 0 0 0 1 0 0 0 剩余总根数 0 0 2 1 0 0 0 16 X39 X40 X41 X42 X43 X44 X45 X46 根数 0 0 0 0 0 0 0 0 剩余总根数 0 2 0 5 0 0 0 1

Lingo编程（如上搭配）

Matlab编程（如上搭配）