Simulation of Discrete Event Systems Unit 1 Introduction to Discrete Event Systems Fall Winter 2016/2017 Dr.-Ing. Dipl.-Wirt.-Ing. Sven Tackenberg Univ.-Prof. Dr.-Ing. Dipl.-Wirt.-Ing. Christopher M. Schlick Chair and Institute of Industrial Engineering and Ergonomics RWTH Aachen University Bergdriesch 27 52062 Aachen phone: 0241 80 99 440 email: des@iaw.rwth-aachen.de
Schedule of Lectures (L), Exercises (E), and Examination Unit Date Topics Instructor 1 (2L + 2E) 21./28.10.2016 Introduction to Discrete Event Systems Nelles, J. 2 (2L + 2E) 21./28.10.2016 Languages and Automata Harlacher, M. 3 (2L + 2E) 04./04.11.2016 Statecharts Witt, O. (extern) 4 (2L + 2E) 11./18.11.2016 Petri Nets (I): Foundations of Net Models Theis, S. 5 (2L + 2E) 11./18.11.2016 Petri Nets (II): Analysis of Net Models Latos, B. 6 (2L + 2E) 25.11/02.12.2016 Timed Models Mertens, A. 7 (2L + 2E) 25.11/02.12.2016 Stochastic Timed Automata Faber, M. 8 (2L + 2E) 09./16.12.2016 Markov Chains Rasche, P. 9 (2L + 2E) 09./16.12.2016 Queueing Models Czerniak, J. 10 (2L + 2E) 13./20.01.2017 Bayesian Networks Faber, M. 11 (2L + 2E) 13./20.01.2017 Dynamic Bayesian Networks Petruck, H. 12 (2L + 2E) 27./27.01.2017 Variable Length Markov Chains Winkelholz, C. (extern) 13 (2L + 2E) 03./03.02.2017 Event Scheduling Scheme and Output Analysis Petruck, H. The written / oral exams take place on the 08 th of March 2017. For organizational questions regarding the examination please feel free to contact our exams-team: mail: pruefungen@iaw.rwth-aachen.de 1-2
Rooms for Lectures (L) and Exercises (E) Lecture (L4): Fridays, 03:45 p.m. 07:45 p.m. Lecture hall: 3990/005 (RS 5) Rochusstraße 2 14 alternating with Exercise (E4): Fridays 03:45 p.m. 07:45 p.m., Lecture hall: 3990/005 (RS 5) Rochusstraße 2 14 On November 4 th, 2016, January 27 th, 2017 and February 3 rd, 2017 lecture and the corresponding exercise are held on a single date On November 4 th, 2016 and January 27 th, 2017 the lectures and exercises are held by the extern lecturers Oliver Witt and Carsten Winkelholz In case of questions regarding the syllabus please contact Henning Petruck, M.Sc., E-Mail: h.petruck@iaw.rwth-aachen.de 1-3
Textbook for Lectures and Exercises Cassandras, C.,G.; Lafortune, S. (2008): Introduction to Discrete Event Systems. 2 nd edition Springer Science+Business Media 1-4
Simulation of Discrete Event Systems Unit 1 Introduction to Discrete Event Systems Fall Winter 2016/2017 Univ.-Prof. Dr.-Ing. Dipl.-Wirt.-Ing. Christopher M. Schlick Dr.-Ing. Sven Tackenberg Chair and Institute of Industrial Engineering and Ergonomics RWTH Aachen University Bergdriesch 27 52062 Aachen phone: 0241 80 99 440 email: des@iaw.rwth-aachen.de
Contents 1. Simulation in Engineering Science 2. Definition of a Discrete Event System and Simple Modeling Examples 3. Levels of Abstraction in Model Development and Advanced Industrial Example 4. Generic Process Model of Simulation Studies 1-6
1. Simulation in Engineering Science 1. Simulation in Engineering Science 1-7
The role of simulation in engineering science Definition Application the term simulation refers to: process of designing a model of a real system conducting experiments with this model for the purpose either of understanding the behavior of the system and its underlying causes evaluating various designs of an artificial system or strategies for the operation of the system German standard VDI 3633, Shannon (1973) Computer-aided simulation of man-made systems is one of the main methodological approaches in engineering science, besides classic analytical methods and empirical experiments under controlled laboratory conditions. The behavior of a system over time can be studied by a simulation model The simulation of dynamic systems has a tradition of more than 40 years in mechanical and electrical engineering and therefore has a high level of accuracy and maturity Pictures: Rechenzentrum, RWTH Aachen 1-8
When is simulation the appropriate tool? Simulation can be used for the following purposes Simulation enables the study as well as experimentation of the behavior of a complex system Informational, organizational and environmental changes can be simulated, and the effect of these alterations on the model s behavior can be observed. By changing simulation inputs and observing the resulting outputs, valuable insights may be obtained into which variables are most important and how variables interact. Simulation can be used to verify analytic solutions By simulating different capabilities for a machine, requirements can be determined The modern systems are so complex that the interactions can be treated only through simulation 1-9
Advantages and disadvantages of simulation Simulation has many advantages, and even some disadvantages Advantages New policies, operating procedures etc. can be explored without disrupting the real system A new design can be tested without committing resources Hypotheses about certain phenomena occur can be tested Insights can be obtained about the interactions and the importance of variables Bottleneck analysis can be performed indicating where work processes or information are excessively delayed Disadvantages Model building requires special training and experience A model is always based on the individual knowledge of the modeler Simulation results may be difficult to interpret due to the fact of random variables Simulation modeling and analysis can be time consuming and expensive 1-10
Basic classification scheme of simulation models model static dynamic Time-varying Time-invariant linear nonlinear continuous states time-driven discrete states event-driven Focus of lecture series deterministic stochastic discrete-time continuous-time 1-11
Models of Discrete Event Systems Classification of a model for a Discrete Event System Logical Models (Automata, Petri nets) Fundamental form of a discrete event model System behavior as a finite set of discrete states Which state transitions and events can occur? Timed Models Stochastic Models At which time interval the states and events occur? (Timed Automata, Timed Petri nets) (Stochastic Automata, Markov Chains) Which states and events occur more or less frequent? Timed Stochastic Models (Semi-Markov Chains) Based on the probability theory regarding state transitions. How long is the residence time in a specific condition? The identification of the entirety of states of a model can be achieved by analytical methods or if the model has a high complexity, simulation studies have to be processed. 1-12
Graphical representation of a dynamical system Block Diagram Input v Discrete Event System z w Output Arrows: Signals Blocks: Dynamic System Each signal defines a direction of action Autonomous System z w Output 1-13
Lecture embedded exercise Discrete Event System Passenger information system Technical Process Continuous signals Discrete signals Generator of Events Sequence of events Modern busses and trams have a passenger information system which shows the next stops on display modules automatically Task: Consider the passenger information system as a discrete event system which responds to an event with the correct name of the next stop. Create a diagram of the system based on picture above Which signals have to be measured? How can these signals generate the input of the passenger information system? 1-14
Time-driven versus event-driven systems Continuous-state systems: State changes as time advances With every clock tick the state is expected to change State variables continuously change with time Mentioned as time-driven systems The time variable t is a natural independent variable appearing as the argument of all input, state transition and output functions Discrete-time models: The state changes only at certain points in time through instantaneous transitions An event can be associated with each transition. Assumption: There is an universal clock through which we will measure: 1. At every clock tick an event e is to be selected from the event set E. If no event takes places, we use a null event as a member of E, whose property is that it causes no state change. State transitions are synchronized by the universal clock. There is a clock tick, an event is selected, the state changes, and the process repeats. 2. At various time instants (not necessarily known in advance and also not necessarily coinciding with clock ticks), some event e announces that it is occurring Every event e E defines a distinct process through. The occurrence of e defines the time instant. State transitions are the result of combining the asynchronous and concurrent event processes. 1-15
Example of time-driven discrete system: A random walk An event causes transitions which lead to a change from one state value to another. Such changes occur instantaneously. An event occurs when a specific action is taken (e.g., somebody presses a button) or a spontaneous occurrence dictated by nature is happened. Example Consider a random walking agent on a plane in two dimensions (four directions: north, west, south east). We can visualize this walk as one step in time. A step leads to a movement in one of the directions. The direction is chosen at random and is independent of the present position. The state of the system is the absolute position in the graph (x 1, x 2 ). The state space is the position in the graph X = {(i, j): i, j =,-1,0,1, }. The event set is simply E = {N, S, W, E}. The initial state is: (0, 0) Sample Path (t=9) (t=7) (t=6) (t=1) (t=4) (t=2) 1-16
Example of event-driven discrete system: A different random walk The random walk on the left is a time-driven system. Given a clock, with every clock tick there is one single player who moves the agent (particle) in one of the directions by selecting an event of E. Alternative View Event driven System Four different players: Each is responsible for moving the particle in a single direction (N, S, W, or E). Each player acts by occasionally issuing a signal to move the particle in his direction. Example (two events never take place at the same time) Player N issues signals at discrete-time instants {7, 9}, Player S issues signals at {2,10}, Player W issues signals at {4, 6}, Player E issues signals at {1, 11}. Timing Diagram 1-17
Comparison of observable behavior of time-driven and event-driven systems Metric state-space Continuous-Variable Dynamic Systems (CVDS) State space X is the set of real numbers R, x(t) can take any value from this set. Function x(t) is the solution of a differential equation of the general form x (t) = f(x(t), u(t), t), where u(t) is the input. State-space with no intrinsic order (categorial) Discrete Event Simulation (DES) For DES it is typical that their state can only change at discrete points in time, which physically correspond to occurrences of asynchronously generated discrete events. The state space is defined by the set X = {s1, s2, s3, s4, s5, s6}. The sample path can only jump from one state to another whenever an event occurs. Note that an event may take place, but not cause a state transition, as in the case of e3. The class of discrete-time systems contains both CVDS and DES. 1-18
2. Definition of a Discrete Event System and Modeling Examples 2. Definition of a Discrete Event System and Modeling Examples 1-19
Definition of a discrete event system Definition A discrete event system (DES) is a system with discrete states s i that are elements of a finite state set X (s i X, i = 1 X ) and discrete events e j that are elements of a finitary event set E (e j E, j = 1 E ), which is event-driven and therefore the state changes are caused by the occurrence of asynchronous events over time through instantaneous transitions. Discrete Event Systems (DES) vs. Time-Driven Systems In contrast to time-driven systems the state transitions of DES are not synchronized with the help of an external clock. In other words, an element e j of the event set can represent a dynamic process of its own right that is triggered, if the event e j occurs. The state transitions in an DES are effects of these asynchronous and often concurrent processes. The phenomenon time in DES is no more longer the driving force (or order parameter) of system dynamics. Sample path of a queueing system with queue length x(t) e 3... e 2 e 1 1-20
Simple DES example: Counter (C) of defective parts integrated in a measurement machine Functional sketch: Good part (g) measurement machine counter reset button (r) Defective part (d) belt conveyor Simple DES model of counter: Event set: E = {g, d, r} State set: X = {0, 1, 2,..., n} State transition diagram: r r r r d d 0 1 2 d 3... d n g g g g g 1-21
Implementation of the example counter with the help of a computer-aided simulator (n = 5) Interactive demonstration of simulator software!!! 1-22
Lecture embedded exercise Simple DES model of counter: Event set: E = {g, d, r} State set: X = {0, 1, 2,..., n} State transition diagram: r r r r d d 0 1 2 d 3... d n g g g g g Consider a state set X = {0, 1, 2,..., 99} for the counter example above. Task How can the cardinality of the state set be reduced, if we can use a concurrent automata model represented by two interacting state transition diagrams? 1-23
Solution: Two digit decimal counter with carry Event set: E = {g, d, r, c} State sets: X lsd ={0, 1, 2,... 9, C } X msd ={0, 1, 2,... 9 } r r r r Least significant digit 0 d 1 d 2 g g g d 3 g... d 9 g d C generate carry event c on entry of state C r Most significant digit r r 0 c 1 c 2 r c 3... c 9 1-24
Implementation of the two digit counter Interactive demonstration of simulator software!!! 1-25
3. Levels of Abstraction in Model Development and Application Example 3. Levels of Abstraction in Model Development and Advanced Industrial Example 1-26
Levels of abstraction in model development 1. Logical Modeling of event sequences: (e j(1), e j(2),..., e j(t) ) (e j E) Pro: Algebraic analysis and verification of system behavior possible Contra: Often too abstract for detailed engineering phases in system development 2. Modeling of time-stamped event sequences: ((e j(1), t 1 ), (e j(2), t 2 ),..., (e j(t), t T )) (e j E, t R + ) Pro: High validity for completely digitized manufacturing systems Contra: Often too deterministic for simulation of human factors and process disturbances 3. Modeling of time-stamped event sequences with stochastic dependencies: P(X 3 = e j(3) at t 3 given that e j(2) at t 2 and e j(1) at t 1 occurred previously) P(X 3 = e j(3) at t 3 ) Pro: Sufficient validity and reliability for modeling of socio-technical systems Contra: Risk of false design decisions due to inaccurate parameter estimation 1-27
Appl. example for the 2nd level of abstraction: Simulation of Flexible Manufacturing System Interactive demonstration of simulator software!!! 1-28
4. Generic Process Model of Simulation Studies 4. Generic Process Model of Simulation Studies 1-29
Flowchart of Generic Process Model (I) 1 2 Problem Formulation Development Entwicklung konzeptuelles of Conceptual Modells 3 Development of 4 Computerized Model Data Collection 5 Model Integration No 6 Verified? Yes No 7 Validated? No Reference: Banks 2000 Yes (continued on the next slides) 1-30
Insertion: Verification and validation of a DES simulation model (Quelle: Sargent 2003) 1-31
Flowchart of Generic Process Model (II) 8 9 Experimental Design Production Runs and Analysis Yes 10 More Runs? Yes 11 Documentation and Reporting 12 Model Implementation Reference: Banks 2000 1-32
Generic process model step 1: Problem formulation 1. Initial empirical analysis of the problem domain together with the customer 2. Problem statement in terms of hypotheses and definition of dependent variables (cycle time, resource consumption etc.) 3. Choice of level of detail to be modeled and simulated 4. Alignment of formulated hypotheses and modeling level of detail concerning the expected results of the customer 5. Choice of conceptual modeling language (Petri nets, queueing models etc.) and data modeling methods (class diagrams, data dictionary, lists etc.) 1-33
Generic process model step 2: Development of conceptual model 1. Detailed interactive analysis with the customer regarding the elements and relations of the conceptual model to be simulated 2. Conceptual modeling of elements and relations with the help of the chosen conceptual modeling language (graphical or textual) 3. Definition of system alternatives and therefore the independent variables in the simulation study (alternative layouts of manufacturing systems etc.) 4. Choice of programming language and simulation software package to be used for transforming the conceptual model into a computerized model 5. Specification of input requirements of the developed conceptual model 1-34
Generic process model step 3: Development of computational model 1. Initial programming of small, simple model components and objects based on the conceptual model, then step-by-step module accumulation and integration into main model 2. Focusing on problem statement and hypotheses, not on compilable and executable models 3. Coping with computational complexity: abstraction from real-life details; tests of runtime behavior of critical components 4. Code reviewing with regard to reuse, reliability, and inline documentation of components 5. Integration of behavior and attributes into a consistent structure of objects 6. Quality control of final released modules by an independent expert 1-35
Generic process model step 4: Data collection 1. Test of completeness and consistency of existing databases. 2. Collection of additionally required data with the help of objective and reliable methods and techniques 3. Preprocessing and data integration into simulation database 4. Review of theoretical approaches to data generation such as mathematical process and sensor models 1-36
Generic process model step 5, 6, 7: model integration, verification, and validation 1. Integration of simulation model code and data base, programming of connectors and wrappers 2. Systematic management of changes in conceptual model, computerized model, and data base due to code integration 3. Verification of computerized model with regard to the conceptual model 4. Successive refinement of validation levels: - theoretical validation - structural validation ( sensitivity analysis), - replicated validation (comparison real data simulation data) 1-37
Generic process model step 8: Experimental design 1. Choice of appropriate methods of inferential statistics (analysis of variance, linear regression, cluster analysis etc.) to test the formulated hypotheses on the basis of the dependent and independent variables 2. Critical review of the generated simulation data concerning required probability distributions of dependent variables in inferential statistics 3. Estimation of number of replications to be computed for each system alternative in order to fulfill the requirements of inferential statistics 4. Test of simulation model boundaries and comparison with simulated problem domain boundaries 4. Unambiguous preparation and parameterization of system alternatives for production runs 1-38
Generic process model step 9, 10: Production runs and analysis 1. Calculation of production runs for the prepared system alternatives 2. Critical review of generated simulation data concerning the layers of validity 3. Measurement and optimization of simulation performance of developed computerized model 4. If additional scenarios need to be simulated more production runs have to be carried out 5. Calculation of point and interval estimates of dependent variables given the levels of the independent variables (conditional means, standard deviations etc.) 6. Computation of test statistic variables for inferential statistics and comparison with critical values 1-39
Generic process model step 11: documentation and reporting 1. Consideration of reporting and documentation standards (conceptual model, dependent variables etc.) for domain independent comparisons of system alternatives 2. Documentation of computation procedure in the production runs 3. Documentation of statistical test results and thorough interpretation of significant effects 4. Limitation of model and results according to the verified and validated variable ranges 5. Model and data maintenance for future improvements and adaptations 1-40
Focus of lectures and exercices Problem Formulation 2 Development Entwicklung konzeptuelles of Conceptual Modells Focus of lectures and exercices 3 Development of 4 Computerized Model Data Collection 5 Model Integration No 6 Verified? Yes No 7 Validated? No 1-41
References Cassandras, C.,G.; Lafortune, S. (2008): Introduction to Discrete Event Systems. 2 nd edition. Springer Science+Business Media Banks, J.B. (Ed.) (1998): Handbook of Simulation. New York (NY):John Wiley & Sons. 1-42
Questions? Open Questions??? 1-43