1 Optimal Manufacturing Enter: ACCEL basics running a script Time in ACCEL the { … } operator Examples Modeling manufacturing Implementation of a functional model ACCEL - basics
2 intro and PR line-by-line, navigate a script assistance enter a script as text numerical analysis optimization larger view on simulation output Optimal Manufacturing Implementation of a functional model ACCEL - basics
3 p=5 q=slider(10,0,20) r=p+q Example of a script: Every line introduces a quantity Quantities can be constants (p) Quantities can be functions r = f(p,q) Quantities can be user-entered (q) paste into IO/edit box click ‘run’ Optimal Manufacturing Implementation of a functional model ACCEL - basics
4 If something STRANGE happens: don't panic goto IO/edit ctrl-A (select all) ctrl-C (copy all) ctrl-V into text editor to save your script reload ACCEL goto IO/edit ctrl-V to load script into ACCEL retry image: Optimal Manufacturing Implementation of a functional model ACCEL - basics
5 s=slider(10,0,20) // this is a slider r=p+q // this is an expression p=5 // this is a constant q=s+t // this is an expression t=pow(s,3) // this is a standard // function Example of a script with comment: to see values: click ‘show/hide values’ to see dependencies: click on ‘pauze’, next click on any quantity Optimal Manufacturing Implementation of a functional model ACCEL - basics
6 s=slider(10,0,100) z=plot([gr1,gr2]) gr1=[str,[s]] gr2=[str,[s % 10]] str='x:{mode:intp},y:{mode:shift,ref:1}' Example of a script with visual output: plot([graph 1,graph 2,…, graph n ]) plots n graphs graph i = [format,data] format = string, e.g. ' x:{mode:intp},y:{mode:shift,ref:1}' data = one or more quantities Black Magic for now … Optimal Manufacturing Implementation of a functional model ACCEL - basics
7 Why ACCEL? compare to MS Excel, not to BASIC, C++, Matlab, … low threshold for non-programmers follows to-do-list approach from LecturesLectures built-in features Pareto Genetic Optimization Sensitivity Analysis with Condition Numbers.. why NOT ACCEL? Optimal Manufacturing Implementation of a functional model ACCEL - basics
8 all agregation by vectors vectors aggregate arbitrary quantities e.g.: v = [1, 2, 3]; v[1] : 2 e.g.: v = [‘x’:1, ‘y’:2, ‘z’:3]; v[’y’] : 2 (v.y : 2) e.g.: v = [1, [10, 20], 3]; v[0] : 1 v[1] : [10,20] v[1][1] : 20 v[0][1] :undefined … but ACCEL tries not to disappoint its users… but ACCEL tries not to disappoint its users Optimal Manufacturing Implementation of a functional model ACCEL - basics
9 … but ACCEL tries not to disappoint its users… but ACCEL tries not to disappoint its users index1=slider(0,0,10) index2=slider(0,0,10) printB=b printC=c printD=d a=[1,[10,20],3] b=a[index1] c=b[index2] d=a[index1][index2] Optimal Manufacturing Implementation of a functional model ACCEL - basics
10 netherlands=[…,'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area': ] fr=['cap':'leeuwarden','pop':647239,'area': ] dr=['cap':'assen','pop': , 'area': ] ov=['cap':'zwolle','pop': , 'area': ] gl=['cap':'arnhem','pop': , 'area': ] ut=['cap':'utrecht','pop': , 'area': ] nh=['cap':'haarlem','pop': , 'area': ] zh=['cap':'den haag','pop': , 'area': ] zl=['cap':'middelburg','pop':381202, 'area': ] nb=['cap':'den bosch','pop': , 'area': ] li=['cap':'maastricht','pop': , 'area': ] Optimal Manufacturing Implementation of a functional model ACCEL - basics
11 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area': ] …. prov0=p[0] prov1= … prov2= … pop0=prov0.pop pop1= … pop2= … totPop=pop0 + pop1 + … what is the exact population? sum over provinces image: Optimal Manufacturing Implementation of a functional model ACCEL - basics
12 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area': ] …. Alternative: quantified expressions totPop = #(dummy, seq, term, operation) dummy: a quantity that assumes subsequent values from sec sec: a set of values. E.g., vSequence(0,11) = [0,1,2,3,4,5,6,7,8,9,10] term: an expression,perhaps depending on dummy operation: what to do with the values of term Optimal Manufacturing Implementation of a functional model ACCEL - basics
13 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area': ] …. Alternative: quantified expressions totPop = #(dummy, seq, term, operation) totPop = #(i, [1,2,3], i, add) totPop = 6 t = [3,4,5,6,7] totPop = #(i, [1,2,3], t [i], add) totPop = t [1] + t [2] + t [3] = = 15 u = [[1,2],[3,4],[5,6]] totPop = #(i, [0,1,2], u[i][1], add) totPop = ([1,2])[1] + ([3,4])[1] + ([5,6])[1] = = 12 Optimal Manufacturing Implementation of a functional model ACCEL - basics
14 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area': ] …. Alternative: quantified expressions totPop = #(dummy, seq, term, operation) totPop = #(i, vSequence(0,11), p [i]. pop, add) maxPop = #(i, vSequence(0,11), p [i]. pop, max) minArea = #(i, vSequence(0,11), p [i].area, min) … but suppose we need the most spacious province? Optimal Manufacturing Implementation of a functional model ACCEL - basics
15 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area': ] …. spaciousness = area / population Optimal Manufacturing Implementation of a functional model ACCEL - basics
16 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area': ] …. maxSpaciousness = #(i, vSequence(0,11), spaciousness(i), max) … but spaciousness is not a single quantity: depends on i, so takes different values during computation. Quantities that depend on other quantities:user defined functions. spaciousness(i) = p[i]. area / p[i]. pop Notice: i takes various values during the compuation; is not a quantity. Instead i is called a dummy. Optimal Manufacturing Implementation of a functional model ACCEL - basics
17 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area': ] …. maxSpaciousness=#(i,vSequence(0,11),spaciousness(i),max) spaciousness(i)=p[i].area/p[i].pop p=[Pgr,Pfr,Pdr,Pov,Pgl,Put,Pnh,Pzh,Pzl,Pnb,Pli] Pgr=['cap':'groningen','pop':582161,'area': ]... Pli=['cap':'maastricht','pop': ,'area': ] so the most spacious province offers 8900 m 2 /person ! … But which province is that? Optimal Manufacturing Implementation of a functional model ACCEL - basics
18 netherlands=[…, 'provinces':p, …] p=[gr,fr,dr,ov,gl,ut,nh,zh,zl,nb,li] gr=['cap':'groningen', 'pop':582161,'area': ] …. As follows: maxSpaciousness=#(i,vSequence(0,11),spaciousness(i),max) spaciousness(i)=p[i]. area / p[i]. pop mostSpacious=#(i,vSequence(0,11),if(spaciousness(i)==maxSpaciousness,i,0),max) capitalOfMostSpacious=p[mostSpacious]. cap curious for result? Try yourself! Optimal Manufacturing Implementation of a functional model ACCEL - basics
19 idea: expression that is evaluated more than once in a computation: user-defined functions can be used whenever quantities are used can have arbitrary arguments (one or more) … with arbitrary names (no name clashes) can return whatever you want, e.g. myFunc(a,b) = ['x':a,'y':b] p=myFunc(3,4) gives result p=['x':3,'y':4] p=myFunc(3,4)['x'] and myFunc(3,4).x both give result p=3 use to organize your thinking use to keep script readible use to shorten script use to keep formal and conceptual models similar Optimal Manufacturing Implementation of a functional model ACCEL - basics
20 Time proceeds via recursive functions: Q current = f (Q prev, P prev ) Simplest example: time current = time prev + 1 Start conditions: ACCEL initializes all quantities to 0 Optimal Manufacturing Implementation of a functional model Dynamic Behaviour
21 p=t t=t{1}+1 ACCEL uses {1} to access previous value ACCEL uses {n} to access n-th previous value, n>0 ACCEL initializes after modification in script Optimal Manufacturing Implementation of a functional model Dynamic Behaviour
22 p=k k=if(t>0,k{1}+5,0) t=t{1}+1 ACCEL can be forced to re-initialize after nr steps: Optimal Manufacturing Implementation of a functional model Dynamic Behaviour
23 z=plot([gr1,gr2]) gr1=[str1,[s]] gr2=[str2,[50+s-s{1}]] s=50+25*sin(t/10) str1= 'width:{value:10},col_r:{value:255},x:{mode:intp},y:{mode:shift,ref:1}' str2= 'width:{value:10},col_b:{value:255},x:{mode:intp},y:{mode:shift,ref:1}' t=t{1}+1 Implement first derivative image: Optimal Manufacturing Implementation of a functional model Dynamic Behaviour
24 z=plot([gr1,gr2]) gr1=[if(rate<0,str1,str2),[50+10*rate]] gr2=[str3,[50+supply]] rate=slider(0,-0.5,0.5) supply=supply{1}+rate str1=' width:{value:10},col_r:{value:255},x:{mode:intp},y:{mode:shift,ref:1} ' str2= 'width:{value:10},col_g:{value:255},x:{mode:intp},y:{mode:shift,ref:1} ' str3=' width:{value:10},col_b:{value:255},x:{mode:intp},y:{mode:shift,ref:1} ' Implement integral image: Optimal Manufacturing Implementation of a functional model Dynamic Behaviour
25 z=plot([gr1,gr2]) gr1=[str1,[s]] gr2=[str2,[ds]] s=slider(50,0,100) ds=(1-damp)*s+damp*ds{1} damp=slider(0.5,0.01,0.99) str1= 'width:{value:10},col_r:{value:255},x:{mode:intp},y:{mode:shift,ref:1}' str2= 'width:{value:10},col_b:{value:255},x:{mode:intp},y:{mode:shift,ref:1}' Implement damping image: Optimal Manufacturing Implementation of a functional model Dynamic Behaviour
26 z=plot([gr1,gr2]) gr1=[str1,[s]] gr2=[str2,[ds]] s=slider(50,0,100) ds=s{delay} delay=slider(1,1,100) str1= 'width:{value:10},col_r:{value:255},x:{mode:intp},y:{mode:shift,ref:1}' str2= 'width:{value:10},col_b:{value:255},x:{mode:intp},y:{mode:shift,ref:1}' Implement delay image: Optimal Manufacturing Implementation of a functional model Dynamic Behaviour
27 profit=income ; week demand=[[0,0],[75,20],[95,30],[60,45],[90,30]] nrWeeks=5 prod1=['SP':25.0] prod2=['SP':35.0] income=income{1}+#(i,[0,1],thisWeekDemand[i]*prod[i].SP,add) prod=[prod1,prod2] thisWeekDemand=#(i,[0,1],if(week<=nrWeeks,demand[week- 1][i],0),vAppend) week=week{1}+1 Optimal Manufacturing Implementation of a functional model Modeling Manufacturing
28 profit=income deltaWeek=1; week demand=[[0,0],[75,20],[95,30],[60,45],[90,30]];[[unit/week,un it/week],[unit/week,unit/week],[unit/week,unit/week],[unit/w eek,unit/week],[unit/week,unit/week]] nrWeeks=5; week prod1=['SP':25.0]; [SP:dollar/unit] prod2=['SP':35.0]; [SP:dollar/unit] zeroUnits=0; unit income=income{1}+#(i,[0,1],thisWeekDemand[i]*prod[i].SP,add) prod=[prod1,prod2] thisWeekDemand=#(i,[0,1],if(week<=nrWeeks,demand[week- deltaWeek][i],zeroUnits),vAppend) zeroUnits=0; unit week=week{1}+deltaWeek Optimal Manufacturing - dimensions Optimal Manufacturing Implementation of a functional model Modeling Manufacturing
29 profit=income-expenses demand=[[0,0],[75,20],[95,30],[60,45],[90,30]] nrWeeks=5 prod1=['PC':9.0,'SP':25.0] prod2=['PC':14.0,'SP':35.0] expenses=productionCosts income=income{1}+#(i,[0,1],thisWeekDemand[i]*prod[i].SP,add) prod=[prod1,prod2] thisWeekDemand=#(i,[0,1],if(week<=nrWeeks,demand[week- 1][i],0),vAppend) productionCosts=productionCosts{1}+#(i,[0,1],prod[i].PC*thisW eekkDemand[i],add) week=week{1}+1 Optimal Manufacturing – account for production costs Optimal Manufacturing Implementation of a functional model Modeling Manufacturing
30 choice0=slider(0,0,1) + 4 more sliders xpp0=slider(17,0,20) + 4 more sliders p1=paretoMax(paretoHor(profit)) p2=paretoMin(paretoVer(inv[0]+inv[1])) demand=[[0,0],[75,20],[95,30],[60,45],[90,30]] nrHpW=80 nrWeeks=5 prod1=['ST':6.0,'SC':250.0,'PT':0.5,'PC':9.0,'IC':3.0,'FC':15.0,'SP':25.0] prod2=['ST':11.0,'SC':400.0,'PT':0.75,'PC':14.0,'IC':3.0,'FC':20.0,'SP':35.0] choice=[choice0,choice1,choice2,choice3,choice4] expenses=setUpCosts+productionCosts+inventoryCosts+penaltyForUnsatisfiedDemand income=income{1}+#(i,[0,1],thisWeekSold[i]*prod[i].SP,add) thisWeekMade=#(i,[0,1],if(i==thisWeekChoice,thisWeekXpa,0),vAppend) inv=if(week>1,inv{1}-thisWeekSold+thisWeekMade,thisWeekMade) inventoryCosts=inventoryCosts{1}+#(i,[0,1],prod[i].IC*inv[i],add) penaltyForUnsatisfiedDemand=penaltyForUnsatisfiedDemand{1}+#(i,[0,1],prod[i].FC*min(0,thisWeekDemand[i]- thisWeekSold[i]),add) prod=[prod1,prod2] productionCosts=productionCosts{1}+prod[thisWeekChoice].PC*thisWeekXpa profit=income-expenses setUpCosts=setUpCosts{1}+if(week<nrWeeks,prod[thisWeekChoice].SC,0) thisWeekChoice=if(week<nrWeeks,choice[week-1],0) thisWeekDemand=#(i,[0,1],if(week<=nrWeeks,demand[week-1][i],0),vAppend) thisWeekPlanned=if(week<nrWeeks,xppU[week-1],0) thisWeekSold=if(week>1,#(i,[0,1],min(thisWeekDemand[i],inv{1}[i]),vAppend),[0,0]) thisWeekXpa=if(week<nrWeeks,(min((nrHpW-prod[thisWeekChoice].ST)/prod[thisWeekChoice].PT,thisWeekPlanned)),0) week=week{1}+1 xppU=scaleFactor*[xpp0,xpp1,xpp2,xpp3,xpp4] scaleFactor=10 Optimal Manufacturing – account for … much more Optimal Manufacturing Implementation of a functional model Modeling Manufacturing
31 choice0=slider(0,0,1) + 4 more sliders xpp0=slider(17,0,20) + 4 more sliders p1=paretoMax(paretoHor(profit)) p2=paretoMin(paretoVer(inv[0]+inv[1])) demand=[[0,0],[75,20],[95,30],[60,45],[90,30]] nrHpW=80 nrWeeks=5 prod1=['ST':6.0,'SC':250.0,'PT':0.5,'PC':9.0,'IC':3.0,'FC':15.0,'SP':25.0] prod2=['ST':11.0,'SC':400.0,'PT':0.75,'PC':14.0,'IC':3.0,'FC':20.0,'SP':35.0] choice=[choice0,choice1,choice2,choice3,choice4] expenses=setUpCosts+productionCosts+inventoryCosts+penaltyForUnsatisfiedDemand income=income{1}+#(i,[0,1],thisWeekSold[i]*prod[i].SP,add) thisWeekMade=#(i,[0,1],if(i==thisWeekChoice,thisWeekXpa,0),vAppend) inv=if(week>1,inv{1}-thisWeekSold+thisWeekMade,thisWeekMade) inventoryCosts=inventoryCosts{1}+#(i,[0,1],prod[i].IC*inv[i],add) penaltyForUnsatisfiedDemand=penaltyForUnsatisfiedDemand{1}+#(i,[0,1],prod[i].FC*min(0,thisWeekDemand[i]- thisWeekSold[i]),add) prod=[prod1,prod2] productionCosts=productionCosts{1}+prod[thisWeekChoice].PC*thisWeekXpa profit=income-expenses setUpCosts=setUpCosts{1}+if(week<nrWeeks,prod[thisWeekChoice].SC,0) thisWeekChoice=if(week<nrWeeks,choice[week-1],0) thisWeekDemand=#(i,[0,1],if(week<=nrWeeks,demand[week-1][i],0),vAppend) thisWeekPlanned=if(week<nrWeeks,xppU[week-1],0) thisWeekSold=if(week>1,#(i,[0,1],min(thisWeekDemand[i],inv{1}[i]),vAppend),[0,0]) thisWeekXpa=if(week<nrWeeks,(min((nrHpW-prod[thisWeekChoice].ST)/prod[thisWeekChoice].PT,thisWeekPlanned)),0) week=week{1}+1 xppU=scaleFactor*[xpp0,xpp1,xpp2,xpp3,xpp4] scaleFactor=10 Optimal Manufacturing – production takes time Optimal Manufacturing Implementation of a functional model Modeling Manufacturing
32 choice0=slider(0,0,1) + 4 more sliders xpp0=slider(17,0,20) + 4 more sliders p1=paretoMax(paretoHor(profit)) p2=paretoMin(paretoVer(inv[0]+inv[1])) demand=[[0,0],[75,20],[95,30],[60,45],[90,30]] nrHpW=80 nrWeeks=5 prod1=['ST':6.0,'SC':250.0,'PT':0.5,'PC':9.0,'IC':3.0,'FC':15.0,'SP':25.0] prod2=['ST':11.0,'SC':400.0,'PT':0.75,'PC':14.0,'IC':3.0,'FC':20.0,'SP':35.0] choice=[choice0,choice1,choice2,choice3,choice4] expenses=setUpCosts+productionCosts+inventoryCosts+penaltyForUnsatisfiedDemand income=income{1}+#(i,[0,1],thisWeekSold[i]*prod[i].SP,add) thisWeekMade=#(i,[0,1],if(i==thisWeekChoice,thisWeekXpa,0),vAppend) inv=if(week>1,inv{1}-thisWeekSold+thisWeekMade,thisWeekMade) inventoryCosts=inventoryCosts{1}+#(i,[0,1],prod[i].IC*inv[i],add) penaltyForUnsatisfiedDemand=penaltyForUnsatisfiedDemand{1}+#(i,[0,1],prod[i].FC*min(0,thisWeekDemand[i]- thisWeekSold[i]),add) prod=[prod1,prod2] productionCosts=productionCosts{1}+prod[thisWeekChoice].PC*thisWeekXpa profit=income-expenses setUpCosts=setUpCosts{1}+if(week<nrWeeks,prod[thisWeekChoice].SC,0) thisWeekChoice=if(week<nrWeeks,choice[week-1],0) thisWeekDemand=#(i,[0,1],if(week<=nrWeeks,demand[week-1][i],0),vAppend) thisWeekPlanned=if(week<nrWeeks,xppU[week-1],0) thisWeekSold=if(week>1,#(i,[0,1],min(thisWeekDemand[i],inv{1}[i]),vAppend),[0,0]) thisWeekXpa=if(week<nrWeeks,(min((nrHpW-prod[thisWeekChoice].ST)/prod[thisWeekChoice].PT,thisWeekPlanned)),0) week=week{1}+1 xppU=scaleFactor*[xpp0,xpp1,xpp2,xpp3,xpp4] scaleFactor=10 Optimal Manufacturing – … therefore you must plan Optimal Manufacturing Implementation of a functional model Modeling Manufacturing
33 choice0=slider(0,0,1) + 4 more sliders xpp0=slider(17,0,20) + 4 more sliders p1=paretoMax(paretoHor(profit)) p2=paretoMin(paretoVer(inv[0]+inv[1])) demand=[[0,0],[75,20],[95,30],[60,45],[90,30]] nrHpW=80 nrWeeks=5 prod1=['ST':6.0,'SC':250.0,'PT':0.5,'PC':9.0,'IC':3.0,'FC':15.0,'SP':25.0] prod2=['ST':11.0,'SC':400.0,'PT':0.75,'PC':14.0,'IC':3.0,'FC':20.0,'SP':35.0] choice=[choice0,choice1,choice2,choice3,choice4] expenses=setUpCosts+productionCosts+inventoryCosts+penaltyForUnsatisfiedDemand income=income{1}+#(i,[0,1],thisWeekSold[i]*prod[i].SP,add) thisWeekMade=#(i,[0,1],if(i==thisWeekChoice,thisWeekXpa,0),vAppend) inv=if(week>1,inv{1}-thisWeekSold+thisWeekMade,thisWeekMade) inventoryCosts=inventoryCosts{1}+#(i,[0,1],prod[i].IC*inv[i],add) penaltyForUnsatisfiedDemand=penaltyForUnsatisfiedDemand{1}+#(i,[0,1],prod[i].FC*min(0,thisWeekDemand[i]- thisWeekSold[i]),add) prod=[prod1,prod2] productionCosts=productionCosts{1}+prod[thisWeekChoice].PC*thisWeekXpa profit=income-expenses setUpCosts=setUpCosts{1}+if(week<nrWeeks,prod[thisWeekChoice].SC,0) thisWeekChoice=if(week<nrWeeks,choice[week-1],0) thisWeekDemand=#(i,[0,1],if(week<=nrWeeks,demand[week-1][i],0),vAppend) thisWeekPlanned=if(week<nrWeeks,xppU[week-1],0) thisWeekSold=if(week>1,#(i,[0,1],min(thisWeekDemand[i],inv{1}[i]),vAppend),[0,0]) thisWeekXpa=if(week<nrWeeks,(min((nrHpW-prod[thisWeekChoice].ST)/prod[thisWeekChoice].PT,thisWeekPlanned)),0) week=week{1}+1 xppU=scaleFactor*[xpp0,xpp1,xpp2,xpp3,xpp4] scaleFactor=10 Optimal Manufacturing – … you earn by what you sell Optimal Manufacturing Implementation of a functional model Modeling Manufacturing
34 choice0=slider(0,0,1) + 4 more sliders xpp0=slider(17,0,20) + 4 more sliders p1=paretoMax(paretoHor(profit)) p2=paretoMin(paretoVer(inv[0]+inv[1])) demand=[[0,0],[75,20],[95,30],[60,45],[90,30]] nrHpW=80 nrWeeks=5 prod1=['ST':6.0,'SC':250.0,'PT':0.5,'PC':9.0,'IC':3.0,'FC':15.0,'SP':25.0] prod2=['ST':11.0,'SC':400.0,'PT':0.75,'PC':14.0,'IC':3.0,'FC':20.0,'SP':35.0] choice=[choice0,choice1,choice2,choice3,choice4] expenses=setUpCosts+productionCosts+inventoryCosts+penaltyForUnsatisfiedDemand income=income{1}+#(i,[0,1],thisWeekSold[i]*prod[i].SP,add) thisWeekMade=#(i,[0,1],if(i==thisWeekChoice,thisWeekXpa,0),vAppend) inv=if(week>1,inv{1}-thisWeekSold+thisWeekMade,thisWeekMade) inventoryCosts=inventoryCosts{1}+#(i,[0,1],prod[i].IC*inv[i],add) penaltyForUnsatisfiedDemand=penaltyForUnsatisfiedDemand{1}+#(i,[0,1],prod[i].FC*min(0,thisWeekDemand[i]- thisWeekSold[i]),add) prod=[prod1,prod2] productionCosts=productionCosts{1}+prod[thisWeekChoice].PC*thisWeekXpa profit=income-expenses setUpCosts=setUpCosts{1}+if(week<nrWeeks,prod[thisWeekChoice].SC,0) thisWeekChoice=if(week<nrWeeks,choice[week-1],0) thisWeekDemand=#(i,[0,1],if(week<=nrWeeks,demand[week-1][i],0),vAppend) thisWeekPlanned=if(week<nrWeeks,xppU[week-1],0) thisWeekSold=if(week>1,#(i,[0,1],min(thisWeekDemand[i],inv{1}[i]),vAppend),[0,0]) thisWeekXpa=if(week<nrWeeks,(min((nrHpW-prod[thisWeekChoice].ST)/prod[thisWeekChoice].PT,thisWeekPlanned)),0) week=week{1}+1 xppU=scaleFactor*[xpp0,xpp1,xpp2,xpp3,xpp4] scaleFactor=10 Optimal Manufacturing – … time requires a buffer (inventory) Optimal Manufacturing Implementation of a functional model Modeling Manufacturing
35 choice0=slider(0,0,1) + 4 more sliders xpp0=slider(17,0,20) + 4 more sliders p1=paretoMax(paretoHor(profit)) p2=paretoMin(paretoVer(inv[0]+inv[1])) demand=[[0,0],[75,20],[95,30],[60,45],[90,30]] nrHpW=80 nrWeeks=5 prod1=['ST':6.0,'SC':250.0,'PT':0.5,'PC':9.0,'IC':3.0,'FC':15.0,'SP':25.0] prod2=['ST':11.0,'SC':400.0,'PT':0.75,'PC':14.0,'IC':3.0,'FC':20.0,'SP':35.0] choice=[choice0,choice1,choice2,choice3,choice4] expenses=setUpCosts+productionCosts+inventoryCosts+penaltyForUnsatisfiedDemand income=income{1}+#(i,[0,1],thisWeekSold[i]*prod[i].SP,add) thisWeekMade=#(i,[0,1],if(i==thisWeekChoice,thisWeekXpa,0),vAppend) inv=if(week>1,inv{1}-thisWeekSold+thisWeekMade,thisWeekMade) inventoryCosts=inventoryCosts{1}+#(i,[0,1],prod[i].IC*inv[i],add) penaltyForUnsatisfiedDemand=penaltyForUnsatisfiedDemand{1}+#(i,[0,1],prod[i].FC*min(0,thisWeekDemand[i]- thisWeekSold[i]),add) prod=[prod1,prod2] productionCosts=productionCosts{1}+prod[thisWeekChoice].PC*thisWeekXpa profit=income-expenses setUpCosts=setUpCosts{1}+if(week<nrWeeks,prod[thisWeekChoice].SC,0) thisWeekChoice=if(week<nrWeeks,choice[week-1],0) thisWeekDemand=#(i,[0,1],if(week<=nrWeeks,demand[week-1][i],0),vAppend) thisWeekPlanned=if(week<nrWeeks,xppU[week-1],0) thisWeekSold=if(week>1,#(i,[0,1],min(thisWeekDemand[i],inv{1}[i]),vAppend),[0,0]) thisWeekXpa=if(week<nrWeeks,(min((nrHpW-prod[thisWeekChoice].ST)/prod[thisWeekChoice].PT,thisWeekPlanned)),0) week=week{1}+1 xppU=scaleFactor*[xpp0,xpp1,xpp2,xpp3,xpp4] scaleFactor=10 Optimal Manufacturing – … and a buffer costs money Optimal Manufacturing Implementation of a functional model Modeling Manufacturing
36 choice0=slider(0,0,1) + 4 more sliders xpp0=slider(17,0,20) + 4 more sliders p1=paretoMax(paretoHor(profit)) p2=paretoMin(paretoVer(inv[0]+inv[1])) demand=[[0,0],[75,20],[95,30],[60,45],[90,30]] nrHpW=80 nrWeeks=5 prod1=['ST':6.0,'SC':250.0,'PT':0.5,'PC':9.0,'IC':3.0,'FC':15.0,'SP':25.0] prod2=['ST':11.0,'SC':400.0,'PT':0.75,'PC':14.0,'IC':3.0,'FC':20.0,'SP':35.0] choice=[choice0,choice1,choice2,choice3,choice4] expenses=setUpCosts+productionCosts+inventoryCosts+penaltyForUnsatisfiedDemand income=income{1}+#(i,[0,1],thisWeekSold[i]*prod[i].SP,add) thisWeekMade=#(i,[0,1],if(i==thisWeekChoice,thisWeekXpa,0),vAppend) inv=if(week>1,inv{1}-thisWeekSold+thisWeekMade,thisWeekMade) inventoryCosts=inventoryCosts{1}+#(i,[0,1],prod[i].IC*inv[i],add) penaltyForUnsatisfiedDemand=penaltyForUnsatisfiedDemand{1}+#(i,[0,1],prod[i].FC*min(0,thisWeekDemand[i]- thisWeekSold[i]),add) prod=[prod1,prod2] productionCosts=productionCosts{1}+prod[thisWeekChoice].PC*thisWeekXpa profit=income-expenses setUpCosts=setUpCosts{1}+if(week<nrWeeks,prod[thisWeekChoice].SC,0) thisWeekChoice=if(week<nrWeeks,choice[week-1],0) thisWeekDemand=#(i,[0,1],if(week<=nrWeeks,demand[week-1][i],0),vAppend) thisWeekPlanned=if(week<nrWeeks,xppU[week-1],0) thisWeekSold=if(week>1,#(i,[0,1],min(thisWeekDemand[i],inv{1}[i]),vAppend),[0,0]) thisWeekXpa=if(week<nrWeeks,(min((nrHpW-prod[thisWeekChoice].ST)/prod[thisWeekChoice].PT,thisWeekPlanned)),0) week=week{1}+1 xppU=scaleFactor*[xpp0,xpp1,xpp2,xpp3,xpp4] scaleFactor=10 Optimal Manufacturing – … selling NO costs money Optimal Manufacturing Implementation of a functional model Modeling Manufacturing