! File = TES.lng; ! Stock and transport optimization during a year; ! Lohmander Peter 2007-10-09; ! Uppdaterad av Peter Lohmander 121105; ! Definitions: woods = wood stock at road side secs = security stock of wood (at the mill) wbuy = volume of wood bought at the mill trp = wood transport from the road stock to the mill trps = wood transport from the road stock to the security stock trpsi = wood transport from the security stock to the mill prod = wood consumption at the mill harv97 = harvest level (wood) in 1997; model: sets: time/1..12/:woods, secs, wbuy, trp, trps, trpsi, prod, harv97, P, MC; endsets ! The objective is to minimize the present value of the total cost of wood transport, stocks and purchases during a year.; min = PVTOTCOST; PVTOTCOST = trpc + purchc + stockc; ! Rate of interest per year in continuous time; r = 0.07; interest_rate = r; trpc = @sum(time(t): @EXP(-r*t/12)*(50 + .2*(trp(t)+trps(t)+.1*trpsi(t)))* (trp(t)+trps(t)+.1*trpsi(t))); purchc = @sum(time(t):@EXP(-r*t/12)*(150 + .2*wbuy(t)) * wbuy(t)); @for(time(t): P(t) = 150+.2*wbuy(t)); @for(time(t): MC(t) = 150+.4*wbuy(t)); stockc = @sum(time(t): @EXP(-r*t/12)*(12*woods(t)+ 16*secs(t))); ! Initially, the stocks have these levels; woods(1) = 100; secs(1) = 20; ! During May, the wood transport from the forest is constrained because of road problems caused by melting ice.; [MAYROAD]trp(5) + trps(5) <= 60; ! The wood stock balance equations; @for(time(t)|t#GT#1: woods(t) = woods(t-1) + harv97(t-1) - trp(t-1)- trps(t-1)); woods(1) = woods(12) + harv97(12) - trp(12)- trps(12); ! The "security level" of the security stock is specified.; @for(time(t): [SECLEV]secs(t) >= 20); ! Full production in the mill means that a sufficient volume of wood has to arrive there from different sources.; @for(time(t): [woodsup]prod(t) <= wbuy(t) + trp(t) + trpsi(t)); ! The security stock balance equations; @for(time(t)|t#GT#1: secs(t) = secs(t-1) + trps(t-1) - trpsi(t-1)); secs(1) = secs(12) + trps(12) - trpsi(12); ! The average wood consumption (per month) from the own forest equals the average harvest per month from the own forest in 1997; wcons = @sum(time(t):harv97(t))/12; ! The harvest volume from the own forest is sufficient to cover 1/3 of the total industrial wood consumption of the firm.; @for(time(t): prod(t) = 3*wcons); data: harv97 = 213 235 227 230 174 109 51 174 210 239 227 196; @OLE('LagerA_res.XLS')= PVTOTCOST, trpc, purchc, stockc, wcons, interest_rate, woods, secs, wbuy, trp, trps, trpsi, prod, harv97, p, mc; enddata end