ShortSim1

download ShortSim1

of 54

Transcript of ShortSim1

  • 8/13/2019 ShortSim1

    1/54

    A Brief Introduction to Discrete-Event

    Simulation Modeling and Analysis

    Ming Zhou, PhD., Associate Professor

    Indiana State University, Terre Haute, IN 47809, USA

    (812)237-3983; [email protected]

  • 8/13/2019 ShortSim1

    2/54

    Slide 1: Introduction to Simulation

    Systems and models of a systemConcept of a system (input, output, process,resources, behavior, performance measures)Interest of studying a system (design, planning,control, improvement, and optimization)Models of a system: representation of real systems

    Physical modelsLogical or mathematical models

  • 8/13/2019 ShortSim1

    3/54

    System and models of system

    System

    Study/experiment

    with theactual system

    Study/experiment

    with a model ofthe system

    Physical

    model

    Mathematical or

    logical model

    Simulationmodel

    Analyticalmodel

  • 8/13/2019 ShortSim1

    4/54

    Studying a system via analytical model v.s. simulationmodel (prescriptive v.s. descriptive models)

    Analytical model Performance measures areexpressed as mathematical functions of inputparameters, result is exact and close form solution,applicable only to simple problems .

    Simulation model a logical model that isevaluated (numerically) over a time period ofinterest, Performance measures are estimated frommodel-generated data with statistical procedures,applicable to systems of any complexity .

    Slide 2: Introduction to Simulation

  • 8/13/2019 ShortSim1

    5/54

    Slide 3: Introduction to Simulation

    Why use simulation models? It is often of interest to study a real-world system togenerate knowledge on its behavior or dynamics. However

    it is usually necessary to use a simulation model for thefollowing reasons:

    Experimentation with the real system is often disruptive (e.g. study of a flow-line manufacturing process)Experimentation with the real system is not cost-effective (e.g. study of large logistic/distribution center) Experimentation with the real system is simply impossible (e.g. study of space rocket launching operations)

  • 8/13/2019 ShortSim1

    6/54

    Definition of simulation The process of designing and creating a computerizedmodel of a real or proposed system for the purpose ofnumerical experiment to develop better understanding ofthe behavior/dynamics of that system under a given setof conditions.Simulation is a powerful tool for design, modeling,analysis, and optimization of systems . It is one of thetarget technologies for the 21 st century identified by theNRC, NIST, NSF, IIE, SME, ASME and many others

    Slide 4: Introduction to Simulation

  • 8/13/2019 ShortSim1

    7/54

    Types of simulationStatic v.s. dynamic (Is time a factor?)Continuous v.s. discrete (nature of change along time)

    Deterministic v.s. stochastic (Is randomnessimportant?)

    Application of simulation (See demos of application )

    - Manufacturing - Logistics & transportation system- Healthcare - Service systems- Military systems - Telecommunication- Entertainment - Robotics simulation

    Slide 5: Introduction to Simulation

  • 8/13/2019 ShortSim1

    8/54

  • 8/13/2019 ShortSim1

    9/54

    Implementation of simulationBy hand (for small problems, e.g. Buffon Needleproblem)By computers with software ( 3 levels ofabstraction ):

    Programming in general-purpose language (e.g., C/C++,Pascal, Fortran)Simulation language (SIMAN, GPSS, SLAM)

    High level simulators (GUI based, menu-driven,such as ARENA, AutoMod, ProModel)

    Issues of modeling efficiency, flexibility and ease ofimplementation, hierarchical structure.

    Slide 7: Introduction to Simulation

  • 8/13/2019 ShortSim1

    10/54

    Issues related to level of modeling constructs: modeling

    efficiency versus modeling flexibility

    Level of modelingabstraction hierarchy

    ModelingefficiencyModeling flexibility

  • 8/13/2019 ShortSim1

    11/54

    Consider a simple example:

    Simulation of a single server processing system (e.g.,an M/M/1 queuing system )

    System components and their relations (needs forabstraction)

    System states and constraintsProblem statement (goal of the study: whatoutput/performance measures to be collected orcomputed?)

    Slide 8: Introduction to Simulation

  • 8/13/2019 ShortSim1

    12/54

    Slide 9: Introduction to Simulation A graphical model of a M/M/1 system

    Arrivals

    Waiting line

    (queue)

    Server Departures

    Arrival time and service time are random variables

  • 8/13/2019 ShortSim1

    13/54

    Elements of a simulation model:

    Entities : items being processed by and flow throughthe system, e.g. parts, cars, customers

    Attributes : properties/characteristics assigned toentities, e.g. part types, time arrived in a queueVariables : changeable quantities defined to reflect thecharacteristics of the system, e.g. we may define twostate variables for a M/M/1 system:

    Server status (states) : idle or busyNumber of items waiting in queue

    Slide 10: Introduction to Simulation

  • 8/13/2019 ShortSim1

    14/54

    Events : an event is an occurrence of something thatchanges the state of the system (e.g. arrival ordeparture of a customer in a M/M/1 system)

    Resources : means by which to process entities (e.g.machines, operators, fork-trucks)Queues (buffers, waiting lines): storage space forentities waiting for required resource)

    Activities/processes : an activity is a period of timeduring which an entity (entities) is serviced (e.g.processed or transferred). The duration of an activityis known a priori, and can be scheduled (e.g.processing time, transfer time)

    Slide 11: Introduction to Simulation

  • 8/13/2019 ShortSim1

    15/54

    Statistical accumulators : variables that collect andkeep track of statistics during the progress ofsimulation to obtain required output performance

    measures.Simulation clock : a mechanism to keep track ofcurrent (simulated) time in a simulation. It lurchesfrom the time of one event to the time of next event.

    Slide 12: Introduction to Simulation

    arrival2 arrival3 departure1

    t1 t2 t3

    Jumps of simulation clock

  • 8/13/2019 ShortSim1

    16/54

    Event-driven simulation : simulation is centered aroundevents that occur as a consequence of activities ordelays. Simulation keeps track of events that are

    assumed to occur in (simulated) future, and updatesystem states and move the simulation clock asevents occur sequentially. Need a mechanism todetermine and control:

    What type of event to occur ? (adding new event)Which event should be scheduled to occur next?What to do when an event occurs? (e.g. updatingsystem states and statistical accumulators)

    Slide 13: Introduction to Simulation

  • 8/13/2019 ShortSim1

    17/54

    Event transition/interaction diagram

    Event-driven simulation logic flow chart

    Slide 14: Introduction to Simulation

    Arrival Departure

  • 8/13/2019 ShortSim1

    18/54

    Process-oriented simulation : this approach emulatesthe flow of an entity through the system, i.e. centerson the process that the entity undergoes. Considermain steps that an entity goes through a single serverM/M/1 simulation process:

    Create itself (mark the time-in)Wait in queue for a resourceSeize the resource (take itself out of the queue)

    Delay a duration equal to its service timeRelease the resourceIncrement production-counter/accumulator andtally flow time

    Dispose itself and leave the system

    Slide 15: Introduction to Simulation

  • 8/13/2019 ShortSim1

    19/54

    Process-oriented method is intuitive and simple forunderstanding, and is popularly used in modeling.

    Most simulation combines both approaches: using anevent-scheduling approach to control the executionbut allowing user to model the system in process-oriented front-end (user interface), e.g. ARENA.

    Randomness in simulation- Random input and therefore random output- Replications of random experiment

    Slide 16: Introduction to Simulation

  • 8/13/2019 ShortSim1

    20/54

    General steps in a simulation study

    Understand the system Define problem (goals/objectives, constraints, scope)

    Formulate a simulation model (conceptual design) Implement the model (translate into modeling software) Verify and Validate the model (Pilot runs) Design the experiments

    Run the experiments (Production runs) with the model Analyze outputs/results Interpret, document, present and implement the results

    Slide 17: Introduction to Simulation

  • 8/13/2019 ShortSim1

    21/54

    Slide 18: Simulation with ARENA

    What is ARENA ? Arena is a Microsoft Windows based application

    package for simulation modeling and analysis. It is aproduct of Rockwell Software, Inc .Current version: 7.0 (2003)

    ARENAs User interface: GUI, interactive and menudriven.

  • 8/13/2019 ShortSim1

    22/54

    Structure of an ARENA simulation model: an ARENAsimulation model consists of two types of modules (i.e.fundamental building blocks):

    Logic modules ( flowchart modules ): perform logicalfunctions of a simulation model, and control thelogic of how entities flow through the system

    Data modules : define the characteristics of process

    elements (e.g. Entities and Resources ), specify andimplement experimental conditions of simulationmodels (number of replications, run length, etc.)Modules are placed in groups called panels

    Slide 19: Simulation with ARENA

  • 8/13/2019 ShortSim1

    23/54

    Some logic modules in the Basic Process Panel :

    Create module: Create entities (generate arrivals ofentities) and define characteristics of entity arrivals(time between arrivals, entity type, batch size, etc.)Process module: Process entities through requiredoperations. This module includes a resource, itsqueue and a processing time.Dispose module: Represent entities leaving thesystem and dispose the entities. It alsoaccumulates basic statistics for output reporting.

    Slide 20: Simulation with ARENA

  • 8/13/2019 ShortSim1

    24/54

    Some Data modulesEntity data module: define detailed propertiesassociated with an entity typeResource data module: define characteristics of aresource (capacity, capacity change pattern)Queue data module: define characteristics of a queueassociated with a resource (e.g. queuing disciplineFIFO, LIFO, etc.)

    Connection of logic modules : logic modules must beconnected in right order through two types of connection:Connect : instant transfer of entities between modules(zero travel time), or Route : model non-zero travel time transfer of entities

    Slide 21: Simulation with ARENA

  • 8/13/2019 ShortSim1

    25/54

    Animation utilities : ARENA provides utilities toanimate entity flows and resources used in a

    simulation model.Dynamic plots (graphical representation of outputperformance measures): select data object selectinformation type select display mode

    Set up running conditions of a simulation modelthrough Run/Setup dialogue window

    Slide 22: Simulation with ARENA

  • 8/13/2019 ShortSim1

    26/54

    Generating (output) summary report on the results ofa simulation: 3 types of information/statistics arecollected and reported:

    Tally variables (e.g., flow/cycle-time, wait-in-queuetime, etc., time intervals )Discrete-Change Variables : time-persistentstatistics such as resource utilization, time-average number in queue, etc.Counters : integral counts by part status (e.g.number of salvaged parts)

    Slide 23: Simulation with ARENA

  • 8/13/2019 ShortSim1

    27/54

    Output performance measures :Total production

    Average and maximum waiting time in queue Average and maximum flow time (cycle time) ofentities

    Average queue length (time-average number of

    parts in queue)Maximum queue lengthUtilization of the machine (proportion of time busy)

    Slide 24: Simulation with ARENA

  • 8/13/2019 ShortSim1

    28/54

    Slide 25: Simulation with ARENA

    Establishing modelingPurpose/objectives

    ModelAnalyzeoutputs

    System

    data

    Modeler

    Decisions

    Policies

    Problem Model-basedProblem solving

  • 8/13/2019 ShortSim1

    29/54

    A basic simulation modeling approach :Dividing system into sub-models (functions or moduledesign to capture all the logical activities)Developing a control/flow logic to define interactionsand the configuration of the modulesSpecify input distribution and data structuresSelecting ARENA modules to model the activities ofthe system at proper level of details.

    Connecting logic modules in right order to establishthe logic flow of the simulation modelSelecting data module(s) to specify and implementexperimental conditions, data structure definitions, andoutput requirement

    Slide 26: Simulation with ARENA

  • 8/13/2019 ShortSim1

    30/54

    An example: Simulation of an electronic assembly andtest system (EAT):

    Two part types with different arrival rates Two part types share one Sealer station, the

    processing time at this station depends on part type Parts are transferred between stations with non-

    zero travel time Parts are routed (after Sealer or Rework station) to

    different destinies based on inspection result ( pass or fail according to certain probabilities)

    Slide 27: Simulation with ARENA

  • 8/13/2019 ShortSim1

    31/54

    Part A Prep

    Slide 28: Simulation with ARENA

    Part B Prep

    Sealer

    ReworkPart A

    Part B

    Expo(5)

    Expo(30)Batch 4

    9%

    Part ATRIA(1,3,4)

    Part BWEIB(2.5,5.3)

    Scrapped

    Salvagedandshipped

    Shipped

    91%

    20%

    80%

    Example : an electronic assembly and testing system

    Tria(1,4,8)

    Tria(3,5,10)

    Expo(45)

  • 8/13/2019 ShortSim1

    32/54

    ARENA concepts

    Attributes and assignment of attributes : attributes areproperties that can be defined to characterize anentity type through a logic construct called Assignmodule (e.g. we can define an attribute called Sealerprocessing time for each part type, then use the valueof this attribute as processing time when the part

    arrives in Sealer station)Decision making : for simple binary decision making(only two results possible), we can use a Decide module to model the needs of routing parts based onthe result of a pass/fail inspection.

    Slide 29: Simulation with ARENA

  • 8/13/2019 ShortSim1

    33/54

    Decision making: route entities based on condition v.s.based on probability; two-way v.s. N -way decisionmaking

    Modeling strategy for the EAT system:Use two Create modules to model the two streams(one for each part type) of arriving partsUse Assign module to define Sealer processing time

    as an attribute for each part type createdUse Decide module to model the binary decisionmaking after Sealer and Rework operations (routingparts based on inspection result: pass or fail withspecified probabilities)

    Slide 30: Simulation with ARENA

  • 8/13/2019 ShortSim1

    34/54

    Demonstration

    Constructing simulation model (Model4-01)

    Running the model

    Viewing results and some discussion

    Slide 31: Simulation with ARENA

  • 8/13/2019 ShortSim1

    35/54

    Slide 32: Enhanced Resource Representation

    Assumptions about resource

    Fixed capacity (single resource with capacity of 1)

    Resource is 100% reliable (no failure/downtime)

    Practical characteristics of resource (e.g. machines)

    Capacity changes over time (e.g. number ofoperators per shift, scheduled breaks ) Failures/breakdown of resources (e.g. machinefailures that occur randomly)

  • 8/13/2019 ShortSim1

    36/54

    Advanced resource representation:

    Schedule: an ARENAs built -in construct that allowsmodeler to vary the capacity of a resource over

    time, i.e. to model planned capacity changes. A schedule is defined by a sequence of time-dependent capacity changes.

    A resource schedule can be defined in either

    Resource or Schedule data module .States : ARENAs built -in constructs to representthe status of a resource in terms of capacity,particularly to model Failures and Downtimes .

    Slide 33: Enhanced Resource Representation

  • 8/13/2019 ShortSim1

    37/54

    ARENA defines a resource with 4 states :Idle : no entity has seized the resource, it isavailable.Busy : some entity seizes the resource, it is notavailable.Inactive : the resource is made unavailable forallocation, e.g. scheduled break-time (capacitydecreases to zero)Failed : resource is unavailable and requires arepair time

    Slide 34: Enhanced Resource Representation

  • 8/13/2019 ShortSim1

    38/54

    Failures of a resource can also be modeled as asequence of characterized random time intervals , e.g.we can define a capacity of 1 for the uptimes and 0 forrepair or downtimes (both are random intervals)

    Slide 35: Enhanced Resource Representation

    Capacity

    1

    0

    uptime

    downtime Time

  • 8/13/2019 ShortSim1

    39/54

    Random failures (where uptime and downtime arerandom variables) of a resource can be modeledusing Failure construct, a data module used to

    model the random events that cause the resourcebecome unavailable (e.g. machine breakdown)Count-based v.s. time-dependent failures (e.g.tooling/bulb failures, machine breakdowns)Uptime v.s. downtime distributions: time betweenmachine breakdowns is usually a random variablefollowing a probability distribution. We have to useeither a theoretical or an empirical distribution tomodel the behavior of downtime (uptime).

    Slide 36: Enhanced Resource Representation

  • 8/13/2019 ShortSim1

    40/54

  • 8/13/2019 ShortSim1

    41/54

    Saving statistical data/informationNeeds for saving and post-processing datagenerated from simulation runs.Mechanism: Statistics module a data module(from Advanced Process panel ) that definesstatistical data to be collected and saved intofiles (for post-analysis).Three types of data file (.dat files):

    Time-persistent (or Discrete-Change) statisticsTally observation dataCounters and frequency data

    Slide 38: Enhanced Resource Representation

  • 8/13/2019 ShortSim1

    42/54

    Practice with enhanced model (Model 4-02)

    Results of running enhanced model (Summary report

    from)

    Output analyzer : post-run analysis of simulation data.It analyze, display and draw statistical conclusions

    based on the simulation results.

    Slide 39: Enhanced Resource Representation

  • 8/13/2019 ShortSim1

    43/54

    Slide 40: Modeling Entity Type Dependent Flow

    A small manufacturing system example with newcharacteristics:

    Different part types flow through the same system Entities flow based on their types (e.g. parts arerouted by different processing plans)Multiple resources with different capacities in thesame workstation

    Entities transfer between stations with nonzerotransfer time

    Study objectives: Average flow time (cycle time) of eachpart type, resource utilization, time and number in queue.

  • 8/13/2019 ShortSim1

    44/54

    Slide 41: Modeling Entity Type Dependent Flow

    Parts

    arrival

    Cell 1 Cell 2

    Cell 4 Cell 3

    Departure

    A small manufacturing system

  • 8/13/2019 ShortSim1

    45/54

  • 8/13/2019 ShortSim1

    46/54

    Performance measures- Cycle times of three part types- Utilization of resources- Work-in-process (WIP) of parts

    Slide 43: Modeling Entity Type Dependent Flow

  • 8/13/2019 ShortSim1

    47/54

  • 8/13/2019 ShortSim1

    48/54

    New modeling concept/construct: Sequence

    Sequence is a data module that can route entities

    according to a predetermined sequence of stationvisitations. We use Sequence to model parts flow withdifferent process plans.

    Sequence consists of a list of destination stations andoptional assignment of attributes (e.g. processing time )at each station in the sequence.

    Slide 45: Modeling Entity Type Dependent Flow

  • 8/13/2019 ShortSim1

    49/54

    New modeling concept: Stations and station transfers . Tomodel the sequence dependent flow, we need to clearlydefine the boundary of a workstation (e.g. entry and leavingpoints of a station) and a mechanism to route entitiesbetween stations based on their sequencing requirements.Station module ( Advanced Transfer panel ): model thephysical location of a process and define an entry point forthe station so that it can be recognized by different entity

    routings (i.e. sequences) in a simulation model.Route module ( Advanced Transfer panel ): model entityroutings based different sequencing requirements withnonzero transfer time.

    Slide 46: Modeling Entity Type Dependent Flow

  • 8/13/2019 ShortSim1

    50/54

    How to implement Sequence dependent flow ?Define Stations for all processes using Stationmodules .Define sequences for all entity/part types using aSequence module .

    Associate each sequence (i.e. a process plan)with each arriving entity through the assignment ofan entity attribute, i.e. assigning each entity asequence attribute (use an Assign module ).Route entities between stations using a Route module.

    Slide 47: Modeling Entity Type Dependent Flow

  • 8/13/2019 ShortSim1

    51/54

    Each work cell will be modeled as aStation-Process-Route module sequence.

    Slide 48: Modeling Entity Type Dependent Flow

    Cell 1 Station(entry point)

    Cell 1 ProcessCell 1 Route

    (leaving point)

    Example: logic modules for Cell 1 (also see Model5-01)

  • 8/13/2019 ShortSim1

    52/54

    How to model a station that has multiple machines of thesame type with different processing time ? (e.g. Cell 3 )Use a Set of resource, not a single resource. Define a

    resource set Cell 3 Machines with two members(New machine and Old machine) for Cell 3. Defaultrule for resource selection is cyclical .

    Assign each machine an index and define a variableFactor as a function of machine index.Define processing time as variable using expressions,e.g. Process time = ProcessingTime * Factor(Index), where ProcessTime is defined through Sequence.In Process module, select Resource Set

    Slide 49: Modeling Entity Type Dependent Flow

  • 8/13/2019 ShortSim1

    53/54

    Practice and demonstration with an Example:Small Manufacturing System (Model 6-02)

    Define logic modules: part arrivals, stations/cells,part departures;Define data modules: use Sequence module tocontrol parts flow; use a Record module and a Setmodule to collect part cycle times.Define experimental conditions;Run the simulation model and discuss results.

    Show BLOCK diagram of Model

    Slide 50: Modeling Entity Type Dependent Flow

  • 8/13/2019 ShortSim1

    54/54

    Slide 51: Modeling Entity Type Dependent Flow

    Arrival

    Cell 1 Cell 2

    Cell 4

    Member 1Cell 3 New

    Member 2Cell 3 Old

    Depart

    Cell 3

    Resourceset: Cell 3machinesA block diagram

    model of SMS