510 likes | 732 Views
SYSTEM SIMULATION AND MODELLING Course Code: MCA 52 Faculty : Sailaja Kumar k. What is this course about?(1/3). Simulation is a technique to analyze and predict the behavior of existing or proposed systems by experimenting with representative models of the systems.
E N D
SYSTEM SIMULATION AND MODELLINGCourse Code: MCA 52Faculty : Sailaja Kumar k K.Sailaja Kumar
What is this course about?(1/3) • Simulation is a technique to analyze and predict the behavior of existing or proposed systems by experimenting with representative models of the systems. • This course is primarily about imitating the operation of real-world systems using computer programs. Our focus will be on “discrete-event” simulations. K.Sailaja Kumar
What is this course about?(2/3) • We will learn how to: • Abstract real-world systems into models • Implement models using software • Experiment design • Systems modeling requires understanding of • Basic probability, statistics, elementary calculus K.Sailaja Kumar
What is this course about?(3/3) • In practice simulation models are mostly built on computer systems. Several languages and software packages facilitate the model building and experimentation process. • The Unified Modeling Language (UML) will be used for modeling and documentation when appropriate. K.Sailaja Kumar
Course Outline • Introduction to Simulation • Simulation Examples • General Principles & Queuing Models • Generating Random-Numbers • Generating Random-Variates • Input Modelling • Verification and Validation of Simulation Models • Output Analysis for a Single Model K.Sailaja Kumar
Books • Lecture material primarily drawn from: • Discrete-Event System Simulation (Third Edition), Banks, Carson, Nelson, and Nicol, Prentice-Hall, 2007. • References • Simulation Modeling and Analysis. (Fourth Edition), Averill M Law,W David Kelton, McGraw Hill • Discrete – Event Simulation: A First Course Lawrence M. Leemis, Stephen K. Park: Pearson / Prentice-Hall, 2006. K.Sailaja Kumar
Introduction to Modeling and Simulation • What is simulation? • Systems and system Environment • Components of a system • Discrete and continuous Systems • Model of a system • Types of models • Discrete-Event System Simulation • When Simulation is the appropriate Tool • When Simulation is not appropriate • Advantages and Disadvantages of Simulation • Application areas of simulation • Steps in a simulation study K.Sailaja Kumar
What is a simulation?(1/2) • Simulation – is imitation of the operation of a real world process or system over a time period, usually using a computer • The behavior of a system over a time period is studied by developing a simulation model • Simulation modeling can be used • As an analysis tool for predicting the effect of changes to existing systems • As a design tool to predict the performance of new systems under varying sets of circumstances. K.Sailaja Kumar
What is a simulation?(2/2) • A simple Simulation model can be developed by mathematical methods. • Many real world systems models are developed using numerical computer-based simulation methods. • The simulation-generated data is used to estimate the measures of performance of the system. K.Sailaja Kumar
When simulation is the appropriate tool (1/3) • To study and experiment with the internal interactions of a complex system or subsystem • To study the effect of informational, organizational and environmental changes on a system • Knowledge gained in designing a simulation model may help to suggest improvements • Changing inputs and observing resulting outputs reveals which variables are most important and how they interact • As a pedagogical device to reinforce analytic solution methodologies • To experiment with new designs or policies prior to implementation • To verify analytic results K.Sailaja Kumar
When simulation is the appropriate tool (2/3) • Simulation can be used for the following purposes: • Simulation enables the study of experiments with internal interactions • Informational, organizational, and environmental changes can be simulated to see the model’s behavior • Knowledge from simulations can be used to improve the system • Observing results from simulation can give insight to which variables are the most important ones • Simulation can be used as pedagogical device to reinforce the learning material • Simulations can be used to verify analytical results, e.g. queueing systems • Animation of a simulation can show the system in action, so that the plan can be visualized K.Sailaja Kumar
When to use simulations?(3/3) • Simulations can be used: • To study complex system, i.e., systems where analytic solutions are infeasible. • To compare design alternatives for a system that doesn’t exist. • To study the effect of alterations to an existing system. Why not change the system?? • To reinforce/verify analytic solutions. K.Sailaja Kumar
When simulation is not appropriate (1/2) Simulation should not be used, in the case • when problem is solvable by common sense • when the problem can be solved mathematically • when direct experiments are easier • when the simulation costs exceed the savings • when the simulation requires time, which is not available • when no (input) data is available, but simulations need data • when the simulation cannot be verified or validated • when the system behavior is too complex or unknown Example: human behavior is extremely complex to model K.Sailaja Kumar
When simulation is not appropriate(2/2) Simulations should not be used: • If model assumptions are simple such that mathematical methods can be used to obtain exact answers (analytical solutions) K.Sailaja Kumar
Advantages of simulation(1/3) • Policies, procedures, decision rules, information flows can be explored without disrupting the real system • New hardware designs, physical layouts, transportation systems can tested without committing resources • Hypotheses about how or why a phenomena occur can be tested for feasibility • Time can be compressed or expanded - Slow-down or Speed-up • Insight can be obtained about the interaction of variables K.Sailaja Kumar
Advantages of simulation(2/3) • Insight can be obtained about the importance of variables to the performance of the system • Bottleneck analysis can be performed to detect excessive delays • Simulation can help to understand how the system operates rather than how people think the system operates • “What if” questions can be answered K.Sailaja Kumar
Advantages of simulation(3/3) • Once a model is built, it can be used repeatedly • Simulation data can be less costly to obtain than data from the real system • Simulation methods can be easier to apply than analytical methods • Simulation models be more general and require fewer assumptions than analytical models • Sometimes simulation is the only way to derive a solution to a problem K.Sailaja Kumar
Disadvantages of simulation • • Model building requires training, it is like an art. - Compare model building with programming. • • Simulation results can be difficult to interpret - Most outputs are essentially random variables - Thus, not simple to decide whether output is randomness or system behavior • • Simulation can be time consuming and expensive - Skimping in time and resources could lead to useless/wrong results K.Sailaja Kumar
Disadvantages of simulation • The disadvantages are offset as follows • • Simulation packages contain models that only need input data • • Simulation packages contain output-analysis capabilities • • Sophistication in computer technology improves simulation times • • For most of the real-world problems there are no closed form solutions K.Sailaja Kumar
Disadvantages of simulation • 1. Developing non-trivial simulation models may be costly • 2. Simulation is sometimes used when analytic techniques will suffice • 3. It is possible to become over-confident with the simulated results K.Sailaja Kumar
Advantages, disadvantages, and pitfalls in a simulation study • Advantages • Simulation allows great flexibility in modeling complex systems, so simulation models can be highly valid • Easy to compare alternatives • Control experimental conditions • Can study system with a very long time frame • Disadvantages • Stochastic simulations produce only estimates – with noise • Simulation models can be expensive to develop • Simulations usually produce large volumes of output – need to summarize, statistically analyze appropriately • Pitfalls • Failure to identify objectives clearly up front • In appropriate level of detail (both ways) • Inadequate design and analysis of simulation experiments • Inadequate education, training K.Sailaja Kumar
Systems and System Environment • System: A collection of objects that are joined together in some regular interaction or interdependence toward some purpose • E.g. A production system manufacturing automobiles. • Here the machines, component parts, and workers operate jointly to produce a high quality vehicle. • System Environment: changes occurring outside the system but affecting the system. K.Sailaja Kumar
Components of a System • Entity:Is an object of interest in the system. • E.g. Banking System • Customers. • Attribute:It is a property of an entity • E.g. Checking balance in their account. • Activity:Represents a time period of specified length. • E.g. Making deposits. K.Sailaja Kumar
Components of a System • State : Is the collection of variables necessary to describe the system at any time, relative to the objectives of the study. • E.g. State variables for a Bank are • Number of busy tellers, • The number of customers waiting in line to be served • and Arrival Time of next customer K.Sailaja Kumar
Components of a System • Event: It is an instantaneous occurrence that changes the state of the system. E.g. the arrival of a new customer. • Endogenous:used to describe activities and events occurring within a system. E.g. the completion of service of a customer • Exogenous:used to describe activities and events occurring in the environment that affect the system. E.g. the arrival of a customer K.Sailaja Kumar
How to study a system? K.Sailaja Kumar
Model of a System(1/2) • Model : It is defined as a representation of a system for the purpose of studying the system. • It is a simplification of the system. • Model represents only those aspects of the system that affect the problem under investigation • Model should be sufficiently detailed to permit valid conclusions to be drawn about the real system. K.Sailaja Kumar
Model of a System(2/2) • Model contains only those components that are relevant to the study • Different models of the same system are required for the purpose of investigation changes. • It is used to • study a system to understand the relationships between its components • Predict how the system will operate under a new policy. K.Sailaja Kumar
System vs. Its Model • Simplification • Abstraction • Assumptions Model Real System K.Sailaja Kumar
Model Classification • Continuous-time vs. discrete-time models • Continuous-event vs. discrete-event models • Deterministic vs. probabilistic models • Static vs. dynamic models • Linear vs. non-linear models • Open vs. closed models K.Sailaja Kumar
Physical model • Prototype of a system for the purpose of study. • Mathematical Model: • Uses symbolic notation and mathematical equations to represent a system. • E.g. A Simulation Model • Simulation Models: • Static vs. Dynamic • Deterministic vs. Stochastic • Discrete vs. Continuous K.Sailaja Kumar
Model Classification • Physical (prototypes) • Analytical (mathematical) • Computer (Monte Carlo Simulation) • Descriptive (performance analysis) • Prescriptive (optimization) K.Sailaja Kumar
Types of Simulation Models • Static/Dynamic • A static simulation model, sometimes called a Monte Carlo simulation, represent a system at a particular point in time. • A dynamic simulation model represents a system as it changes over time. K.Sailaja Kumar
Types of Simulation Models • Deterministic/Stochastic • Simulation models that contain no random variables are classified as deterministic • Deterministic models have a known set of inputs that will result in a unique set of outputs. • A stochastic simulation model has one or more random variables as inputs. K.Sailaja Kumar
Types of Simulation Models • Deterministic models produce deterministic results • Stochastic or probabilistic models are subject to random effects • Typically, they have one or more random inputs (e.g., arrival of customers, service time etc.). • Outputs from stochastic models are “estimates” of the true characteristics of the system • Need to repeat experiments number of times • Need to have confidence in the results K.Sailaja Kumar
Types of Simulation Models • Discrete/Continuous • State variables change instantaneously at separated points in time E.g Bank model: State changes occur only when a customer arrives or departs • State variables change continuously as a function of time E.g. Airplane flight: State variables like position, velocity change continuously K.Sailaja Kumar
Types of Simulation Models • Continuos systemsin which the changes are predominantly smooth in time • Natural events (rain, change of climate etc.) • Mechanical systems • Electrical systems • Discrete systemsin which the state variable(s) change only at a discrete set of points in time • Banks • Manufacturing • Computer systems K.Sailaja Kumar
Types of Simulation Models • Discrete systems:Is one in which the state variables change only at a discrete set of points in time. E.g. Banking system The number of customers changes only at discrete points in time K.Sailaja Kumar
Types of Simulation Models • Continuous systems: Is one in which the state variables change continuously over a time. E.g. The head of water behind a dam The head of water behind the dam, changes for this continuous system K.Sailaja Kumar
Number of cust. in queue Time Continuous and Discrete-event models Distance traveled by plane Time (b) Discrete-event (a) Continuous-event K.Sailaja Kumar
Types of Simulation Models • Continuous simulation – Typically, solve sets of differential equations numerically over time – May involve stochastic elements – Some specialized software available; some discrete-event simulation software will do continuous simulation as well • Combined discrete-continuous simulation – Continuous variables described by differential equations – Discrete events can occur that affect the continuously- changing variables – Some discrete-event simulation software will do combined discrete-continuous simulation as well K.Sailaja Kumar
Types of Simulation Models • Discrete-event simulation: a simulation using a discrete-event (also called discrete-state) model of the system • E.g., Widely used for studying computer systems • Continuous-event simulation: uses a continuous-state models • E.g., Widely used in chemical/pharmaceutical studies • Our focus will be on discrete-event systems. K.Sailaja Kumar
Discrete-event system simulation • Discrete and continuous models are defined similarly. • However, a discrete simulation model is not always used to model a discrete system, nor is a continuous model always used to model a continuous system. • Discrete-Event System Simulation • Discrete-event system simulation is widely used and is the focus of this course. • Discrete-event system simulation is the modeling of the systems in which the state variables change only at a discrete set of points in time. K.Sailaja Kumar
Discrete-event system simulation Modeling of a system as it evolves over time by a representation where the state variables change instantaneously at separated points in time More precisely, state can change at only a countable number of points in time These points in time are when events occur Event: Instantaneous occurrence that may change the state of the system Sometimes get creative about what an “event” is … e.g., end of simulation, Make a decision about a system’s operation Can in principle be done by hand, but usually done on computer K.Sailaja Kumar
More on models • Static and dynamic models • Static models – system state independent of time • Dynamic models - system state change with time • Linear and non-linear models • Linear models – output is a linear function of input parameters • Open and closed models (b) Closed Model (a) Open Model K.Sailaja Kumar
Areas of Application Application areas of simulation • • Manufacturing applications • • Semiconductor manufacturing • • Construction engineering and project management • • Military applications • • Logistics, supply chain and distribution applications • • Transportation models and traffic • • Business process simulation • • Health care • • Call-center • • Computers and Networks • • Games • • Human Systems K.Sailaja Kumar
Steps in a simulation study • 1. Problem formulation • 2. Setting objectives of study • 3. Model building • 4. Data collection • 5. Implementation • 6. Verification – is the implementation bug-free? • 7. Validation – is the model accurate? • 8. Experimental design • 9. Production runs & analysis • 10. Evaluate if results are satisfactory • 11. Report results K.Sailaja Kumar
Steps in a Simulation Study • 1. Problem formulation • Clearly understand problem • Reformulation of the problem • 2. Setting of objectives and overall project plan • Which questions should be answered? • Is simulation appropriate? • Costs? • 3. Model conceptualization • No general guide • Modeling tools in research, e.g. UML • 4. Data collection • How to get data? • Are random distributions appropriate? • 5. Model translation • Program K.Sailaja Kumar
Steps in a Simulation Study • 6. Verified? • Does the program that, what the model describes? • 7. Validated? • Do the results match the reality? • In cases with no real-world system, hard to validate • 8. Experimental design • Which alternatives should be run? • Which paramters should be varied? • 9. Production runs and analysis • 10. More runs? • 11. Documentation and reporting • Program documentation – how does the program work • Progress documentation – chronology of the work • 12. Implementation K.Sailaja Kumar