1 Optimal Manufacturing Enter: ACCEL basics running a script Time in ACCEL the { … } operator Examples Modeling manufacturing Implementation of a functional.

Slides:



Advertisements
Similar presentations
Introduction to Programming using Matlab Session 2 P DuffourJan 2008.
Advertisements

Lecture 14 User-defined functions Function: concept, syntax, and examples © 2007 Daniel Valentine. All rights reserved. Published by Elsevier.
259 Lecture 17 Working with Data in MATLAB. Overview  In this lecture, we’ll look at some commands that are useful for working with data!  fzero  sum,
1 EMT 101 – Engineering Programming Dr. Farzad Ismail School of Aerospace Engineering Universiti Sains Malaysia Nibong Tebal Pulau Pinang Week 10.
Excel Objects, User Interface, and Data Entry. ◦ Application Window  Title Bar  Menu Bar  Toolbars  Status Bar  Worksheet Window  Worksheet Input.
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
1 A Core Course on Modeling Organizing concepts trees tables Organizing meaning objects semantics Notation Mapping ACCEL aggregation: vectors quantified.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.6.
Week 6 - Programming I So far, we’ve looked at simple programming via “scripts” = programs of sequentially evaluated commands Today, extend features to:
1 Lab Session-I (A and B) CS-120 Fall 2000 Using Windows Using An Editor Using Visual C++ Using Compiler Writing and Running Programs Lab-1 DUE Fri September.
1 Lab Session-I CSIT120 Spring2001 Using Windows Using An Editor Using Visual C++ Using Compiler Writing and Running Programs Lab-1 continues (Session.
Chapter 2 Querying a Database
Microsoft Access 2010 Chapter 7 Using SQL.
Introduction to Array The fundamental unit of data in any MATLAB program is the array. 1. An array is a collection of data values organized into rows and.
10 Equations in Biology: Michaelis-Menten Kinetics.
Lawson System Foundation 9.0
Introduction to programming in MATLAB MATLAB can be thought of as an super-powerful graphing calculator Remember the TI-83 from calculus? With many more.
EPSII 59:006 Spring Topics Using TextPad If Statements Relational Operators Nested If Statements Else and Elseif Clauses Logical Functions For Loops.
CS123 Engineering Computation Lab Lab 2 Bruce Char Department of Computer Science Drexel University Spring 2010.
Computer Science 1000 Spreadsheets II Permission to redistribute these slides is strictly prohibited without permission.
M-files While commands can be entered directly to the command window, MATLAB also allows you to put commands in text files called M- files. M-files are.
1 Working with MS SQL Server. 2 Objectives You will be able to Use Visual Studio for GUI based interactive access to a Microsoft SQL Server database.
1 A Core Course on Modeling Enter: ACCEL basics running a script Time in ACCEL the { … } operator examples Week 3 – Time for Change.
Operations 343 Spreadsheet Modeling Week 15 Quiz Review Homework Review Course Review Lab session.
Chapter 9 Numerical Integration Flow Charts, Loop Structures Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Visual Solutions, VisSim Overview VisSim program can be used to simulate some of the control problems in the DPCL. Review the following:
Linear Programming: Basic Concepts
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
Computational Biology, Part 12 Spreadsheet Basics I Robert F. Murphy Copyright  1996, All rights reserved.
Nonvisual Arrays and Recursion by Chris Brown under Prof. Susan Rodger Duke University June 2012.
Math 15 Lecture 10 University of California, Merced Scilab Programming – No. 1.
1 Working with MS SQL Server Textbook Chapter 14.
Introduction to Engineering MATLAB – 6 Script Files - 1 Agenda Script files.
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
Numerical Computation Lecture 2: Introduction to Matlab Programming United International College.
University of Sunderland CDM105 Session 6 Dreamweaver and Multimedia Fireworks MX 2004 Creating Menus and Button images.
Chapter 9: MuPAD Programming II Procedures MATLAB for Scientist and Engineers Using Symbolic Toolbox.
Introduction to Matlab’s Graphical User Interface (GUI) Type “guide” “Guide” creates interface on a Figure window and code in an M-file. Some hidden code.
10/24/20151 Chapter 2 Review: MATLAB Environment Introduction to MATLAB 7 Engineering 161.
1 Week 2: Variables and Assignment Statements READING: 1.4 – 1.6 EECS Introduction to Computing for the Physical Sciences.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.12.
Computer Science 1000 Spreadsheets III Permission to redistribute these slides is strictly prohibited without permission.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Scientific Computing Introduction to Matlab Programming.
240-Current Research Easily Extensible Systems, Octave, Input Formats, SOA.
JavaScript III Functions and Abstraction. 2 JavaScript so far statements assignment function calls data types numeric string boolean expressions variables.
Math 15 Lecture 9 University of California, Merced Scilab A Short Introduction – No. 3 Today – Quiz #4.
Recap Saving Plots Summary of Chapter 5 Introduction of Chapter 6.
This guide describes how to: - Register to the HiStory Blog (pages 2-4). - Change the view by zooming in and out (pages 5-6). - Create a new post, including:
ENG 1181 First-Year Engineering Program College of Engineering Engineering Education Innovation Center First-Year Engineering Program MAT - Introduction.
Modeling of Power Converters using Matlab and Simulink
Trinity College Dublin, The University of Dublin GE3M25: Computer Programming for Biologists Python Karsten Hokamp, PhD Genetics TCD, 03/11/2015.
MA/CS 375 Fall 2003 Lecture 3. .* Multiplication We can use the.* operator to perform multiplication entry by entry of two matrices:
MA/CS 375 Fall 2002 Lecture 2. Motivation for Suffering All This Math and Stuff Try the Actor demo from
Introduction to Matlab Patrice Koehl Department of Biological Sciences National University of Singapore
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Trinity College Dublin, The University of Dublin GE3M25: Computer Programming for Biologists Python, Class 2 Karsten Hokamp, PhD Genetics TCD, 17/11/2015.
Announcements Assignment 2 Out Today Quiz today - so I need to shut up at 4:25 1.
Overview Input Input statements Menu statements Output Display statements fprintf statements Message boxes.
FUNCTIONS (C) KHAERONI, M.SI. OBJECTIVE After this topic, students will be able to understand basic concept of user defined function in C++ to declare.
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
EE400D DOCUMENTATION INSTRUCTIONAL SERIES BLOG POSTS.
Functions. What is a Function?  We have already used a few functions. Can you give some examples?  Some functions take a comma-separated list of arguments.
Learning to Program D is for Digital.
Loops CIS 40 – Introduction to Programming in Python
Intro to Mathematica.
Presentation transcript:

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