Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GreenLogProb=optimproblem('ObjectiveSense','minimize');
- q=optimvar('q',15,11, 'LowerBound',0);
- v=optimvar('v', 11,4,'LowerBound',0);
- w=optimvar('w', 11,4,'LowerBound',0);
- z=optimvar('z', 11,3,'LowerBound',0);
- u=optimvar('u', 8,15,'LowerBound',0); %Remove
- y=optimvar('y',11, 'Type','integer','LowerBound',0,'UpperBound',1);
- x=optimvar('x',8, 'Type','integer','LowerBound',0,'UpperBound',1); %remove
- n= 1:3 %incineradors
- j= 1:15 %clientes
- k=1:11 %centros de recolección
- l=1:4 %metal
- m=1:4 %plastico
- i=1:8 %plantas
- %Costo de transporte del cliente j al centro de recoleccion k [Rials]
- a = [54 66 36 24 84 78 75 126 114 69 78
- 48 52.8 54 60 46.8 66 60 108 21 60 30
- 66 66 90 96 36 66 66 102 21 66 42
- 69 51 99 105 46.8 42 45 0 90 52.8 78
- 75 48 84 93 49.2 42 45 18 87 52.8 84
- 18 12 30 36 21 12 12 36 48 9 27
- 72 51 84 90 24 30 33 36 39 36 72
- 6 4.8 21 27 18 12 10.8 48 33 6 10.8
- 15 9 33 39 12 0 3 36 45 6 21
- 21 12 36 42 9 13.2 12 45 34.8 21 18
- 9 3 24 30 12 7.2 6 42 40.8 3 16.8
- 18 18 45 48 18 66 60 78 1.2 51 15
- 3 7.2 15 21 18 17.4 15.6 54 27 9 10.8
- 150 132 180 186 126 120 123 102 150 126 156
- 210 192 240 246 198 168 171 66 240 174 222]
- %Costo de transporte del c.r. k al centro de reciclaje de metales [Rials]
- b(k,l) =[2.5 8 3 2.5
- 2.5 8.8 3 1.5
- 6.5 9 7.5 5.2
- 7 10 8 6.2
- 2.5 7.8 3 2.2
- 10 11 11 0.2
- 9.5 10 10 0.5
- 12 18 13 6.2
- 1.8 3.5 0.2 7.5
- 8 10 8.5 1
- 2 5 2.5 3.5]
- %Costo de transporte del c.r k al centro de reciclaje de plástico m [Rials]
- h(k,m) =[1 6 2 18
- 2.4 8 2.4 22
- 5 8 5 12
- 7 8 7 8
- 6 13 3 28
- 5.8 11 5 26
- 5.2 10 5 25
- 18 14 20 42
- 9 13 7 38
- 3 3 9 23
- 3.6 8 1 26]
- o(k,n) = [3.9 1.5 4.5
- 0 3.6 1.5
- 10.8 7.5 12
- 13.5 10.5 15
- 6 9 6
- 5.4 8.7 3.6
- 5.4 7.8 3
- 23.4 27 21
- 18.6 13.5 20.4
- 1.5 4.5 1.5
- 5.4 5.4 8.4]%costo de transporte del centro de recoleccion k al centro de incineración n
- copen(k)=[17400 17900 17400 17200 18300 18100 17800 18000 17500 17900 17700]
- prosm(m,1)= [5 3 3.5 4.5]
- prosl(l,1)= [1 1 0.8 1.1]
- prosn(n,1)=[0.5 0.8 0.5]
- capn(n,1)=[4300 3550 4400]
- capl(l,1)=[2850 4450 8450 3000]
- capm(m,1)=[3450 2850 3550 6450]
- ejk(j,k)=[1.44 1.76 0.96 0.64 2.24 2.08 2 3.36 3.04 1.84 2.08
- 1.28 1.408 1.44 1.6 1.248 1.76 1.6 2.88 0.56 1.6 0.8
- 1.76 1.76 2.4 2.56 0.96 1.76 1.76 2.72 0.56 1.76 1.12
- 1.84 1.36 2.64 2.8 1.248 1.12 1.2 0.12 2.4 1.408 2.08
- 2 1.28 2.24 2.48 1.312 1.12 1.2 0.48 2.32 1.408 2.24
- 0.48 0.32 0.8 0.96 0.56 0.32 0.32 0.96 1.28 0.24 0.72
- 1.92 1.36 2.24 2.4 0.64 0.8 0.88 0.96 1.04 0.96 1.92
- 0.16 0.128 0.56 0.72 0.48 0.32 0.288 1.28 0.88 0.16 0.288
- 0.4 0.24 0.88 1.04 0.32 0.02 0.08 0.96 1.2 0.16 0.56
- 0.56 0.32 0.96 1.12 0.24 0.352 0.32 1.2 0.928 0.56 0.48
- 0.24 0.08 0.64 0.8 0.32 0.192 0.16 1.12 1.088 0.08 0.448
- 0.48 0.48 1.2 1.28 0.48 1.76 1.6 2.08 0.032 1.36 0.4
- 0.08 0.192 0.4 0.56 0.48 0.464 0.416 1.44 0.72 0.24 0.288
- 4 3.52 4.8 4.96 3.36 3.2 3.28 2.72 4 3.36 4.16
- 5.6 5.12 6.4 6.56 5.28 4.48 4.56 1.76 6.4 4.64 5.92]%Data of environmental impact of shipping a unit of used product from customer zone j to collection center k and processing it at collection center k (i.e., ), ( = 0.012 millipoints) - (millipoints)
- ekl(k,l)= [0.0051 0.0271 0.0071 0.0051
- 0.0051 0.0303 0.0071 0.0011
- 0.0211 0.0311 0.0251 0.0159
- 0.0231 0.0351 0.0271 0.0199
- 0.0051 0.0263 0.0071 0.0039
- 0.0351 0.0391 0.0391 -0.0041
- 0.0331 0.0351 0.0351 -0.0029
- 0.0431 0.0671 0.0471 0.0199
- 0.0023 0.0091 -0.0041 0.0251
- 0.0271 0.0351 0.0291 -0.0009
- 0.0031 0.0151 0.0051 0.0091]
- ekm(k,m)=[-1.62 -1.52 -1.6 -1.28
- -1.592 -1.48 -1.592 -1.2
- -1.54 -1.48 -1.54 -1.4
- -1.5 -1.48 -1.5 -1.48
- -1.52 -1.38 -1.58 -1.08
- -1.524 -1.42 -1.54 -1.12
- -1.536 -1.44 -1.54 -1.14
- -1.28 -1.36 -1.24 -0.8
- -1.46 -1.38 -1.5 -0.88
- -1.58 -1.58 -1.46 -1.18
- -1.568 -1.48 -1.62 -1.12]
- ekn(k,n)=[0.1518 0.0238 0.1838
- -0.0562 0.1358 0.0238
- 0.5198 0.3438 0.5838
- 0.6638 0.5038 0.7438
- 0.2638 0.4238 0.2638
- 0.2318 0.4078 0.1358
- 0.2318 0.3598 0.1038
- 1.1918 1.3838 1.0638
- 0.9358 0.6638 1.0318
- 0.0238 0.1838 0.0238
- 0.2318 0.2318 0.3918]
- c(i,j) =[90 75 110 115 125 30 120 10 25 35 15 35 5 250 350
- 110 88 110 85 80 20 85 8 15 20 5 30 12 220 320
- 60 90 150 165 140 50 140 35 55 60 40 75 25 300 400
- 100 60 80 125 135 40 120 18 35 30 25 28 12 260 360
- 140 78 60 78 82 35 40 30 20 15 20 30 30 210 330
- 130 110 110 70 70 20 50 20 0 20 10 100 28 200 280
- 115 100 110 85 85 12 60 10 10 35 0 90 18 210 290
- 135 75 50 65 110 55 50 25 30 25 28 38 28 200 300
- ] %BORRAR
- demand(j)=[254.5 330.6 124 108.8 110 263.4 63.5 93 118.5 42.6 211 285 240 344 215]
- rreturn(j)=[0.75 0.75 0.75 0.65 0.65 0.75 0.65 0.8 0.75 0.75 0.75 0.8 0.8 0 0]
- caprec(k)=[2450 2450 2550 2550 2250 2350 2250 2050 2250 2150 2300]
- eij(i,j)=[12.244 11.584 13.124 13.344 13.784 9.604 13.564 8.724 9.384 9.824 8.944 9.824 8.504 19.284 23.684
- 13.124 12.156 13.124 12.024 11.804 9.164 12.024 8.636 8.944 9.164 8.504 9.604 8.812 17.964 22.364
- 10.924 12.244 14.884 15.544 14.444 10.484 14.444 9.824 10.704 10.924 10.044 11.584 9.384 21.484 25.884
- 12.684 10.924 11.804 13.784 14.224 10.044 13.564 9.076 9.824 9.604 9.384 9.516 8.812 19.724 24.124
- 14.444 11.716 10.924 11.716 11.892 9.824 10.044 9.604 9.164 8.944 9.164 9.604 9.604 17.524 22.804
- 14.004 13.124 13.124 11.364 11.364 9.164 10.484 9.164 8.284 9.164 8.724 12.684 9.516 17.084 20.604
- 13.344 12.684 13.124 12.024 12.024 8.812 10.924 8.724 8.724 9.824 8.284 12.244 9.076 17.524 21.044
- 14.224 11.584 10.484 11.144 13.124 10.704 10.484 9.384 9.604 9.384 9.516 9.956 9.516 17.084 21.484
- ]
- copenpro(i)=[145000 147000 148000 140000 147000 147000 148000 0]
- cappro(i)=[2000 2000 2100 1800 2000 2000 2000 1800]
- prosi(i) =[158 162 165 165 165 165 170 160]
- RestDem1= sum(u)>=demand
- RestDem2= sum(q,2)'>=(demand.*rreturn)
- RestFlujo1=sum(q,1)==(sum(w,2)+sum(z,2))'
- RestFlujo2=sum(w,2)'==(sum(v,2))'
- RestCap1=sum(u,2)'<=(x.*cappro')'
- RestCap2=sum(q,1)<=(y.*caprec')'
- RestCap3=sum(v,1)<=capl'
- RestCap4=sum(w,1)<=capm'
- RestCap5=sum(z,1)<=capn'
- f1=sum(copenpro*x,1)...
- +sum(copen*y,1)+sum(sum((c'+prosi).*u'))+sum(sum(a.*q))...
- +sum(sum((b'+prosl).*v'))+sum(sum((h'+prosm).*w'))+sum(sum((o'+prosn).*z'))
- f2=sum(sum(eij.*u))+sum(sum(ejk.*q))+sum(sum(ekn.*z))...
- +sum(sum(ekl.*v))+sum(sum(ekm.*w))
- GreenLogProb.Constraints.R1=RestCap1;
- GreenLogProb.Constraints.R2=RestCap2;
- GreenLogProb.Constraints.R3=RestCap3;
- GreenLogProb.Constraints.R4=RestCap4;
- GreenLogProb.Constraints.R5=RestCap5;
- GreenLogProb.Constraints.R6=RestDem1;
- GreenLogProb.Constraints.R7=RestDem2;
- GreenLogProb.Constraints.R8=RestFlujo1;
- GreenLogProb.Constraints.R9=RestFlujo2;
- GreenLogProb.Objective=(f1);
- [sol,fval,exitflag,output]=solve(GreenLogProb)
- Sol1=fval
- GreenLogProb.Objective=(f2);
- [sol,fval,exitflag,output]=solve(GreenLogProb)
- Sol2=fval
- Sol1
- Sol2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement