Professional Documents
Culture Documents
Simulation
1. Introduction
Simulation
Outline Administrative issues and course goals Simulation as a method of systems study
Course Staff
Lecturer: Dr.Igor Sheinman
Simulation
Literature
A.M. Law and W.D. Kelton, Simulation, Modeling and Analysis, 3rd edition, McGraw Hill, 2000. Harry Perros. Computer Simulation Techniques:The definitive introduction
http://www.csc.ncsu.edu/faculty/perros/simulation.pdf
Simulation
Course Goals
By three methods we may learn wisdom: first, by reflection, which is noblest; second, by imitation, which is easiest; and third, by experience, which is the most bitter. Confucius, 551-449 BC
.1
Simulation 6
Course Goals
Methods of system performance evaluation:
Experiments: Use a concrete example of a system and try to measure its performance Analysis: Construct a mathematical abstraction of the system and derive equations describing the systems performance Simulation: Build a model (a representation) of the system, along with its operations, and use this model to numerically evaluate system performance usually with the help of computers
Course Goals
At the end of the course you should:
Know principles of discrete event simulation Gain hands-on experience in developing models of a realworld systems (mainly computer networks but not only). Know basic traffic and queuing models used in network simulations Be familiar with NS-2 network simulator Be able to design, program, run and analyze the simulations Be familiar with basic statistical approaches to output analysis
Course Outline
Introduction. Working with AWK NS-2 (including networks in a nutshell) Network performance metrics Simulation Principles Overview. A Simple Example Review of probability and statistics. Elementary queuing theory Output data analysis Traffic Models Variance reduction techniques and rare events simulation
Simulation 9
31.10.2012
14.11.2012 21.11.2012 28.11.2012 5.12.2012 12.12.2012 19.12.2012 26.12.2012 2.01.2013 9.01.2013 16.01.2013
Reports
Simulation 10
Final Exam
Outline Administrative issues and course goals Simulation as a method of systems study
What is Simulation
Representation of the operation or features of one process or system through the use of another
The American Heritage Dictionary of the English Language, Fourth Edition
Origin simulare (Latin) : copy, represent In computer science: the technique of representing the real world by a computer program; "a simulation should imitate the internal processes and not merely the results of the thing being simulated"
WordNet 2.0, 2003 Princeton University
System Simulation (Modeling) Paradigm that creates simplified representations of complex systems Generates system histories and observes system behavior and statistics over time Goals are understanding system performance and improving system design
Simulation 14
Systems and Models System: is a set of entities (machines, humans) that act and interact together towards the completion of certain task. Model: is a set of mathematical and logical relationships that represent the structure and the dynamics of the system.
Simulation
15
Mathematical Analysis
Simulation
Exact mathematical analysis Differential calculus, Probability theory Queuing theory Algebraic methods, etc.
Simulation
16
Queueing theory (we will actually examine this later) Differential equations Linear programming
But complex systems can seldom be validly represented by a simple analytic model
Danger of over-simplifying assumptions model validity? The simplified model can provide valid bounds
Often, a complex system requires a complex model, and analytical methods dont apply what to do?
Simulation 17
Computer Simulation
Computer simulation or a computer model is a computer program that attempts to simulate an abstract model of a particular system.
Use software to imitate the systems operations and characteristics, often over time
Can be used to study simple models but should not usually if an analytical solution is available Real power of simulation is in studying complex models Simulation can tolerate complex models since we dont even try to find an analytical solution
Simulation 18
Simulation
19
Simulation
20
Signal digitization Fluid flow model for queuing system Flow model of the traffic chemical processes are actually random (quantum mechanics), deterministic models (which is usually appropriate because of the large number of particles involved)
Systems Overview
Model
Simulation
24
Simulation
25
Outline Administrative issues and course goals Simulation as a method of systems study
Brief History
1940s: Monte Carlo method is developed by physicists working on Manhattan project to study neutron scattering. Researchers include John von Neumann, Stanislaw Ulan, Edward Teller, Herman Kahn 1950s: First special-purpose simulation languages developed 1970s: Research initiated on mathematical foundations of simulation 1980s: PC-based simulation software developed, graphical user interfaces, object-oriented programming 1990s: Web-based simulation, fancy animated graphics, simulation-based optimization
Simulation
27
Monte-Carlo Method Monte-Carlo method provides approximate solutions to a variety of mathematical problems by performing statistical sampling experiments on a computer.
http://en.wikipedia.org/wiki/Monte_Carlo_method
Simulation
28
Simulation
29
The experiment : dropping a needle on a hardwood floor. The event of interest : the needle crosses a crack between floorboards. The probability of this event leads to a statistical estimate of the number !
Georges Louis Leclerc Comte de Buffon 1707-1788 Buffon, G. "Essai d'arithmtique morale." Histoire naturelle, gnrale e particulire, Supplment 4, 46-123, 1777.
Simulation 30
P=
Simulation 31
Simulation Example
Gambling game : a fair coin is repeatedly flipped until |#heads - #tails| = 3. The player receives $8.99 at the end of the game but must pay $1 for each coin flip. (No quitting in the middle of the game.) Is this game a good bet over the long run? That is, what is the expected reward? There are three ways to find out: 1. Try to compute the answer analytically (not easy). 2. Experiment by playing the game a number of times. Use the average reward over all of the games as an estimate of the expected reward (rather time-consuming). 3. Use the power of the computer to experiment, and use the average reward as an estimate of the expected reward. AKA - Simulation!
(Examle from Peter J. Haas Introduction to Simulation Course at Stanford University) Simulation 33
Outline Administrative issues and course goals Simulation as a method of systems study
Why do Engineers Simulate? (1/3) To evaluate decisions before implementation It is less costly and disruptive than experimenting with the real system
Why do Engineers Simulate? (2/3) To see and understand behavior of a system over time To investigate the impact of variation on the system To obtain information on multiple measures of effectiveness of the system To compress the time required to get information
Simulation 36
Why do Engineers Simulate? (3/3) To try out different ideas for improving a system To force attention to detail in design of a system or process To gain an understanding of the system or process
Simulation
37
Model conceptualization
No
Problem formulation
Model translation No
Yes Verified? Validated? Production runs and analysis Yes Yes More runs? No Documentation and reporting
Data collection
No
Implementation
Problem Formulation
A statement of the problem
Project Proposal
Determine the questions that are to be answered Identify scenarios to be investigated Decision criteria Determine the end-user Determine data requirements Determine hardware, software, & personnel requirements Prepare a time plan Cost plan and billing procedure
Model conceptualization
No
Problem formulation
Model translation No
Yes Verified? Validated? Production runs and analysis Yes Yes More runs? No Documentation and reporting
Data collection
No
Implementation
Model Conceptualization
Real World System
Assumed system
Conceptual model
Logical model
Level of Details Low level of details may result in lost of information and goals cannot be accomplished High level of details require:
more time and effort longer simulation runs more likely to contain errors
Level of Details
Accuracy of the model
Cost of model
Dynamic objects get created, move around, change status, affect and are affected by other entities, leave (maybe) Usually have multiple realizations Can have different types of entities concurrently Patients Visitors
Patient
Type of illness, Age, Sex, Temperature Blood Pressure
Arrival of a new patient, Completion of service (i.e., examination) Failure of medical equipment, etc.
Simulation
52
Model Translation
Coding
Verification and Validation Verification: the process of determining if the operational logic is correct.
Simulation
54
Assumed system
Conceptual model
VALIDATION
Logical model
VERIFICATION
Simulation model
Simulation 55
Model conceptualization
No
Problem formulation
Model translation No
Yes Verified? Validated? Production runs and analysis Yes Yes More runs? No Documentation and reporting
Data collection
No
Implementation
Simulation
57
Experimental Design
Alternative scenarios to be simulated Type of output data analysis (steady-state vs. terminating simulation analysis) Number of simulation runs Length of each run The manner of initialization Variance reduction Will be discussed in details later
Simulation
58
When is Simulation Appropriate? The system of interest is too complex, and analytical results are not tractable. There is a need to reinforce analytical solution methodologies or verify analytical solutions There is a need to visualize system performance (using animations).
Simulation
59
Simulation
60
But now have better modeling software more general, flexible, but still (relatively) easy to use But now have faster, bigger, cheaper hardware to allow for much better studies than just a few years ago this trend will continue However, simulation will also continue to push the envelope on computing power in that we ask more and more of our simulation models Theres a lot more to a simulation study than just coding a model in some software and running it to get the answer Need careful design and analysis of simulation models simulation methodology
Simulation 61
Academic level
Winter Simulation Conference (600-700 people every year) Is one of the three important operations-research techniques (in surveys related to the use of operations research techniques: math programming, statistics, simulation) The second only to math programming among 13 techniques considered (in 1294 papers from the journal Interfaces from 1970 through 1992)
Simulation
62
Simulation: Application Areas Examples (1/2) Determining hardware requirements or protocols for communications networks Determining hardware and software requirements for a computer system Designing and analyzing manufacturing systems Evaluating military weapons systems or their logistics requirements
Simulation
63
Simulation: Application Areas Examples (2/2) Designing and operating transportation systems such as airports, freeways, ports, and subways Evaluating designs for service organizations such as call centers, fast-food restaurants, hospitals, and post offices Reengineering of business processes Determining ordering policies for an inventory system Analyzing financial or economic systems
Simulation 64
How much does it cost? PCs are now powerful enough to run most simulation models The software can be expensive ($500 $40,000+) Very large and complex models may require engineering workstations (>$8000) (e.g. communications networks, large 3D factory designs with animation) Development efforts
Simulation 65
Outline Administrative issues and course goals Simulation as a method of systems study
Advantages of simulation (1/2) Simulation allows to study the operation of very complicated systems experiment with systems in the planning stage (without building a real system or a prototype)
Advantages of simulation (2/2) Simulation allows to examine the behavior of an existing system under different operation conditions
study the behavior of the system over longer periods of time (in a compressed time scale) or conversely very fast events (in a slowed down time scale)
Simulation
68
Common pitfalls in simulation (1/2) The goals of the simulation are not clearly defined
the system or important questions are not understood well enough lets simulate, the problem will become clearer
Simulation
69
Common pitfalls in simulation (2/2) Inappropriate level of detail (too many / too few details)
Focus on the simulation program as if the task is solely to write a demanding program Lack of expertise on the system, performance analysis, statistical analysis Use of wrong tools Will be discussed in details later
Simulation 70
Outline Administrative issues and course goals Simulation as a method of systems study
Typical questions to be answered by computer networks simulation How does the network behave with increasing load? How many and how fast links / switches or how big buffers are needed in a WAN network? What are the consequences of a link failure? Which protocol gives the best performance? What is the most advantageous network structure?
Simulation
72
Typical questions to be answered by computer networks simulation What happens if the number workstations attached to a network is increased? How do new applications affect the LAN? Should one divide the LAN in smaller segments? Does one obtain the desired performance with a client server architecture? How many satellites are needed for a certain quality of service between two earth stations?
Simulation
73