Introduction to Simulation

31,223 views

Published on

Published in: Education, Technology
2 Comments
22 Likes
Statistics
Notes
No Downloads
Views
Total views
31,223
On SlideShare
0
From Embeds
0
Number of Embeds
105
Actions
Shares
0
Downloads
1,864
Comments
2
Likes
22
Embeds 0
No embeds

No notes for slide

Introduction to Simulation

  1. 1. INTRODUCTION TO SIMULATION
  2. 2. WHAT IS SIMULATION? <ul><li>The imitation of the operation of a real-world process or system over time… </li></ul><ul><ul><li>Most widely used tool (along LP) for decision making </li></ul></ul><ul><ul><li>Usually on a computer with appropriate software </li></ul></ul><ul><ul><li>An analysis (descriptive) tool – can answer what if questions </li></ul></ul><ul><ul><li>A synthesis (prescriptive) tool – if complemented by other tools </li></ul></ul><ul><li>Applied to complex systems that are impossible to solve mathematically </li></ul><ul><li>This course focuses on one form of simulation modelling – discrete-event simulation modelling. </li></ul>
  3. 3. APPLICATIONS <ul><li>Systems – facility or process, actual or planned </li></ul><ul><li>Examples </li></ul><ul><ul><li>Manufacturing facility </li></ul></ul><ul><ul><li>Bank operation </li></ul></ul><ul><ul><li>Airport operations (passengers, security, planes, crews, baggage) </li></ul></ul><ul><ul><li>Transportation/logistics/distribution operation </li></ul></ul><ul><ul><li>Hospital facilities (emergency room, operating room, admissions) </li></ul></ul><ul><ul><li>Computer network </li></ul></ul><ul><ul><li>Freeway system </li></ul></ul><ul><ul><li>Business process (insurance office) </li></ul></ul><ul><ul><li>Criminal justice system </li></ul></ul><ul><ul><li>Chemical plant </li></ul></ul><ul><ul><li>Fast-food restaurant </li></ul></ul><ul><ul><li>Supermarket </li></ul></ul><ul><ul><li>Theme park </li></ul></ul><ul><ul><li>Emergency-response system </li></ul></ul>
  4. 4. SYSTEM <ul><li>A set of interacting components or entities operating together to achieve a common goal or objective. </li></ul><ul><li>Examples: </li></ul><ul><ul><li>A manufacturing system with its machine centers, inventories, conveyor belts, production schedule, items produced. </li></ul></ul><ul><ul><li>A telecommunication system with its messages, communication network servers. </li></ul></ul><ul><ul><li>A theme park with rides, workers, … </li></ul></ul>REAL WORLD SYSTEMS OF INTEREST ARE HIGHLY COMPLEX!!!
  5. 5. WHY & HOW TO STUDY A SYSTEM System Experiment with the actual system Experiment with a mathematical model of the system Mathematical Analysis Simulation Measure/estimate performance Improve operation Prepare for failures IE 325 IE 202 IE 303 … IE 324 Experiment with a physical model of the system
  6. 6. MATHEMATICAL MODEL <ul><li>An abstract and simplified representation of a system </li></ul><ul><li>Specifies </li></ul><ul><ul><li>Important components </li></ul></ul><ul><ul><li>Assumptions/approximations about how the system works </li></ul></ul><ul><li>Not an exact re-creation of the original system! </li></ul><ul><li>If model is simple enough, study it with Queueing Theory, Linear Programming, Differential Equations... </li></ul><ul><li>If model is complex, Simulation is the only way!!! </li></ul>
  7. 7. GETTING ANSWERS FROM MODELS MODEL <ul><li>Operating Policies </li></ul><ul><li>Single queue, parallel servers </li></ul><ul><li>FIFO </li></ul><ul><li>Input Parameters </li></ul><ul><li>No of servers </li></ul><ul><li>Inter-arrival Time Distribution </li></ul><ul><li>Service Time Distributions </li></ul><ul><li>Output Parameters </li></ul><ul><li>Waiting Times </li></ul><ul><li>System Size </li></ul><ul><li>Utilizations </li></ul>(X) (Y) Y = f (X) ACTUAL SYSTEM
  8. 8. STOCHASTIC MODELS <ul><li>Randomness or uncertainty is inherent </li></ul><ul><li>Example: Bank with customers and tellers </li></ul>ACTUAL SYSTEM    QUEUEING MODEL  IE325
  9. 9. CLASSIFICATION OF SIMULATION MODELS Static (Monte Carlo) Dynamic Systems Represents the system at a particular point in time IID observations <ul><li>Represents the system behaviour over time </li></ul><ul><li>Continuous Simulation: </li></ul><ul><li>(Stochastic) Differential Equations </li></ul><ul><li>Discrete Event Simulation: </li></ul><ul><li>System quantities (state variables) change with events </li></ul><ul><li>Estimation of  </li></ul><ul><li>Risk Analysis in Business </li></ul><ul><li>Water Level in a Dam </li></ul><ul><li>Queueing Systems </li></ul><ul><li>Inventory Systems </li></ul>
  10. 10. HOW TO SIMULATE <ul><li>By hand </li></ul><ul><ul><li>Buffon Needle and Cross Experiments (see Kelton et al.) </li></ul></ul><ul><li>Spreadsheets </li></ul><ul><li>Programming in General Purpose Languages </li></ul><ul><ul><li>Java </li></ul></ul><ul><li>Simulation Languages </li></ul><ul><ul><li>SIMAN </li></ul></ul><ul><li>Simulation Packages </li></ul><ul><ul><li>Arena </li></ul></ul><ul><li>Issue: Modeling Flexibility vs. Ease of Use </li></ul>
  11. 11. ADVANTAGES OF SIMULATION <ul><li>When mathematical analysis methods are not available, simulation may be the only investigation tool </li></ul><ul><li>When mathematical analysis methods are available, but are so complex that simulation may provide a simpler solution </li></ul><ul><li>Allows comparisons of alternative designs or alternative operating policies </li></ul><ul><li>Allows time compression or expansion </li></ul>
  12. 12. DISADVANTAGES OF SIMULATION <ul><li>For a stochastic model, simulation estimates the output while an analytical solution, if available, produces the exact output </li></ul><ul><li>Often expensive and time consuming to develop </li></ul><ul><li>An invalid model may result with confidence in wrong results. </li></ul>
  13. 13. STEPS IN A SIMULATION STUDY Problem formulation Setting of objectives and overall project plan Model conceptualization Data collection Model translation Verified? No Validated? No No Experimental Design Production runs and analysis More runs? Documentation and reporting No Implementation Yes Yes Yes Yes
  14. 14. PROBLEM FORMULATION <ul><li>A statement of the problem </li></ul><ul><ul><li>the problem is clearly understood by the simulation analyst </li></ul></ul><ul><ul><li>the formulation is clearly understood by the client </li></ul></ul>
  15. 15. SETTING OF OBJECTIVES & PROJECT PLAN <ul><li>Project Proposal </li></ul><ul><li>Determine the questions that are to be answered </li></ul><ul><li>Identify scenarios to be investigated </li></ul><ul><li>Decision criteria </li></ul><ul><li>Determine the end-user </li></ul><ul><li>Determine data requirements </li></ul><ul><li>Determine hardware, software, & personnel requirements </li></ul><ul><li>Prepare a time plan </li></ul><ul><li>Cost plan and billing procedure </li></ul>
  16. 16. STEPS IN A SIMULATION STUDY Problem formulation Setting of objectives and overall project plan Model conceptualization Data collection Model translation Verified? No Validated? No No Experimental Design Production runs and analysis More runs? Documentation and reporting No Implementation Yes Yes Yes Yes
  17. 17. MODEL CONCEPTUALIZATION Assumed system Conceptual model Real World System Logical model
  18. 18. CONCEPTUAL MODEL <ul><li>Abstract essential features </li></ul><ul><ul><li>Events, activities, entities, attributes, resources, variables, and their relationships </li></ul></ul><ul><ul><li>Performance measures </li></ul></ul><ul><ul><li>Data requirements </li></ul></ul><ul><li>Select correct level of details (assumptions) </li></ul>
  19. 19. LEVELS OF DETAIL <ul><li>Low levels of detail may result in lost of information and goals cannot be accomplished </li></ul><ul><li>High levels of detail require: </li></ul><ul><ul><li>more time and effort </li></ul></ul><ul><ul><li>longer simulation runs </li></ul></ul><ul><ul><li>more likely to contain errors </li></ul></ul>
  20. 20. Accuracy of the model Scope & level of details Scope & level of details Cost of model
  21. 21. COMPONENTS OF A SYSTEM <ul><li>Entity : is an object of interest in the system </li></ul><ul><ul><li>Dynamic objects — get created, move around, change status, affect and are affected by other entities, leave (maybe) </li></ul></ul><ul><ul><li>Usually have multiple realizations floating around </li></ul></ul><ul><ul><li>Can have different types of entities concurrently </li></ul></ul>Example: Health Center Patients Visitors
  22. 22. COMPONENTS OF A SYSTEM <ul><li>Attribute : is a characteristic of all entities, but with a specific value “local” to the entity that can differ from one entity to another . </li></ul>Example: Patient Type of illness, Age, Sex, Temperature, Blood Pressure
  23. 23. COMPONENTS OF A SYSTEM <ul><li>Resources : what entities compete for </li></ul><ul><ul><li>Entity seizes a resource, uses it, releases it </li></ul></ul><ul><ul><li>Think of a resource being assigned to an entity , rather than an entity “belonging to” a resource </li></ul></ul><ul><ul><li>“ A” resource can have several units of capacity which can be changed during the simulation </li></ul></ul>Example: Health Center Doctors, Nurses X-Ray Equipment
  24. 24. COMPONENTS OF A SYSTEM <ul><li>Variable : A piece of information that reflects some characteristic of the whole system, not of specific entities </li></ul><ul><ul><li>Entities can access, change some variables </li></ul></ul>Example: Health Center Number of patients in the system, Number of idle doctors, Current time
  25. 25. <ul><li>State : A collection of variables that contains all the information necessary to describe the system at any time </li></ul>COMPONENTS OF A SYSTEM Example: Health Center {Number of patients in the system, Status of doctors (busy or idle), Number of idle doctors, Status of Lab equipment, etc}
  26. 26. <ul><li>Event : An instantaneous occurrence that changes the state of the system </li></ul>COMPONENTS OF A SYSTEM Example: Health Centre Arrival of a new patient, Completion of service (i.e., examination) Failure of medical equipment, etc.
  27. 27. COMPONENTS OF A SYSTEM <ul><li>Activity : represents a time period of specified length. </li></ul>Example: Health Center Surgery, Checking temperature, X-Ray.
  28. 28. LOGICAL (FLOWCHART) MODEL <ul><li>Shows the logical relationships among the elements of the model </li></ul>Q(t)> 0 ? 3 YES NO 2 Departure event Q(t)=Q(t)-1 B(t)=0 Generate service & schedule new departure Collect & update statistics TB, TQ, TL, N L(t)=L(t)-1 L : # of entities in system Q : # of entities in queue B : # of entities in server
  29. 29. STEPS IN A SIMULATION STUDY Problem formulation Setting of objectives and overall project plan Model conceptualization Data collection Model translation Verified? No Validated? No No Experimental Design Production runs and analysis More runs? Documentation and reporting No Implementation Yes Yes Yes Yes
  30. 30. DATA COLLECTION & ANALYSIS <ul><li>Collect data for input analysis and validation </li></ul><ul><li>Analysis of the data </li></ul><ul><ul><li>Determine the random variables </li></ul></ul><ul><ul><li>Fit distribution functions </li></ul></ul>
  31. 31. STEPS IN A SIMULATION STUDY Problem formulation Setting of objectives and overall project plan Model conceptualization Data collection Model translation Verified? No Validated? No No Experimental Design Production runs and analysis More runs? Documentation and reporting No Implementation Yes Yes Yes Yes
  32. 32. MODEL TRANSLATION <ul><li>Simulation model executes the logic contained in the flow-chart model </li></ul>Coding General Purpose Language Special Purpose Simulation Language/Software JAVA, C++, Visual BASIC Examples: SIMAN, ARENA, EXTEND Examples:
  33. 33. ARENA EXAMPLE
  34. 34. JAVA EXAMPLE <ul><li>public static void main( String argv[]) </li></ul><ul><li>{ </li></ul><ul><li>Initialization(); </li></ul><ul><li>//Loop until first &quot;TotalCustomers&quot; have departed </li></ul><ul><li>while (NumberofDepartures < TotalCustomers) </li></ul><ul><li>{ </li></ul><ul><li>Event evt = FutureEventList[0]; //get imminent event </li></ul><ul><li>removefromFEL(); //be rid of it </li></ul><ul><li>Clock = evt.get_time(); //advance in time </li></ul><ul><li>if (evt.get_type() == arrival) ProcessArrival(); </li></ul><ul><li>else ProcessDeparture(); </li></ul><ul><li>} </li></ul><ul><li>ReportGeneration(); </li></ul><ul><li>} </li></ul>
  35. 35. STEPS IN A SIMULATION STUDY Problem formulation Setting of objectives and overall project plan Model conceptualization Data collection Model translation Verified? No Validated? No No Experimental Design Production runs and analysis More runs? Documentation and reporting No Implementation Yes Yes Yes Yes
  36. 36. VERIFICATION AND VALIDATION <ul><li>Verification : the process of determining if the operational logic is correct. </li></ul><ul><ul><li>Debugging the simulation software </li></ul></ul><ul><li>Validation : the process of determining if the model accurately represents the system. </li></ul><ul><ul><li>Comparison of model results with collected data from the real system </li></ul></ul>
  37. 37. VERIFICATION AND VALIDATION Conceptual model Logical model Simulation model Real World System VERIFICATION VALIDATION
  38. 38. STEPS IN A SIMULATION STUDY Problem formulation Setting of objectives and overall project plan Model conceptualization Data collection Model translation Verified? No Validated? No No Experimental Design Production runs and analysis More runs? Documentation and reporting No Implementation Yes Yes Yes Yes
  39. 39. EXPERIMENTAL DESIGN <ul><li>Alternative scenarios to be simulated </li></ul><ul><li>Type of output data analysis (steady-state vs. terminating simulation analysis) </li></ul><ul><li>Number of simulation runs </li></ul><ul><li>Length of each run </li></ul><ul><li>The manner of initialization </li></ul><ul><li>Variance reduction </li></ul>
  40. 40. ANALYSIS OF RESULTS <ul><li>Statistical tests for significance and ranking </li></ul><ul><ul><li>Point Estimation </li></ul></ul><ul><ul><li>Confidence-Interval Estimation </li></ul></ul><ul><li>Interpretation of results </li></ul><ul><li>More runs? </li></ul>
  41. 41. STEPS IN A SIMULATION STUDY Problem formulation Setting of objectives and overall project plan Model conceptualization Data collection Model translation Verified? No Validated? No No Experimental Design Production runs and analysis More runs? Documentation and reporting No Implementation Yes Yes Yes Yes
  42. 42. DOCUMENTATION & REPORTING <ul><li>Program Documentation </li></ul><ul><ul><li>Allows future modifications </li></ul></ul><ul><ul><li>Creates confidence </li></ul></ul><ul><li>Progress Reports </li></ul><ul><ul><li>Frequent reports (e.g. monthly) are suggested </li></ul></ul><ul><ul><li>Alternative scenarios </li></ul></ul><ul><ul><li>Performance measures or criteria used </li></ul></ul><ul><ul><li>Results of experiments </li></ul></ul><ul><ul><li>Recommendations </li></ul></ul>
  43. 43. IMPLEMENTATION FAILURE SUCCESS ?

×