1 CS 214 Modeling and Simulation Modeling. TERMINOLOGY lSystem –A group of objects that are joined together in some regular interaction or interdependence.

Slides:



Advertisements
Similar presentations
McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. A PowerPoint Presentation Package to Accompany Applied Statistics.
Advertisements

Discrete Event (time) Simulation Kenneth.
Simulation - An Introduction Simulation:- The technique of imitating the behaviour of some situation or system (economic, military, mechanical, etc.) by.
Introduction into Simulation Basic Simulation Modeling.
Parallel and Distributed Simulation
Modeling & Simulation. System Models and Simulation Framework for Modeling and Simulation The framework defines the entities and their Relationships that.
Lecture 3 Concepts of Discrete-Event Simulation. 2 Discrete Event Model  In the discrete approach to system simulation, state changes in the physical.
Decision Making: An Introduction 1. 2 Decision Making Decision Making is a process of choosing among two or more alternative courses of action for the.
Discrete-Event Simulation: A First Course Steve Park and Larry Leemis College of William and Mary.
1 Queueing Theory H Plan: –Introduce basics of Queueing Theory –Define notation and terminology used –Discuss properties of queuing models –Show examples.
Discrete Event Simulation Event-Oriented Simulations By Syed S. Rizvi.
1 Validation and Verification of Simulation Models.
Lab 01 Fundamentals SE 405 Discrete Event Simulation
Feedback Control Systems (FCS)
CS 450 Modeling and Simulation
Queuing Theory (Waiting Line Models)
Modeling and Simulation
Introduction to Discrete Event Simulation Customer population Service system Served customers Waiting line Priority rule Service facilities Figure C.1.
(C) 2009 J. M. Garrido1 Object Oriented Simulation with Java.
Chapter 1 Introduction to Simulation
1 Validation & Verification Chapter VALIDATION & VERIFICATION Very Difficult Very Important Conceptually distinct, but performed simultaneously.
CS433: Modeling and Simulation Dr. Anis Koubâa Al-Imam Mohammad Ibn Saud University 27 February 2010 Lecture 02: Modeling.
1 Performance Evaluation of Computer Networks: Part II Objectives r Simulation Modeling r Classification of Simulation Modeling r Discrete-Event Simulation.
 1  Outline  stages and topics in simulation  generation of random variates.
Capacity analysis of complex materials handling systems.
Verification & Validation
BsysE595 Lecture Basic modeling approaches for engineering systems – Summary and Review Shulin Chen January 10, 2013.
Modeling & Simulation: An Introduction Some slides in this presentation have been copyrighted to Dr. Amr Elmougy.
Introduction to Operations Research
NETE4631:Capacity Planning (2)- Lecture 10 Suronapee Phoomvuthisarn, Ph.D. /
Decision Making.
Modeling and simulation of systems Model building Slovak University of Technology Faculty of Material Science and Technology in Trnava.
Queuing Theory Basic properties, Markovian models, Networks of queues, General service time distributions, Finite source models, Multiserver queues Chapter.
Entities and Objects The major components in a model are entities, entity types are implemented as Java classes The active entities have a life of their.
1 Elements of Queuing Theory The queuing model –Core components; –Notation; –Parameters and performance measures –Characteristics; Markov Process –Discrete-time.
Chap. 5 Building Valid, Credible, and Appropriately Detailed Simulation Models.
Discrete Event (time) Simulation. What is a simulation? “Simulation is the process of designing a model of a real system and conducting experiments with.
Chapter 10 Verification and Validation of Simulation Models
ECE 466/658: Performance Evaluation and Simulation Introduction Instructor: Christos Panayiotou.
Fall 2011 CSC 446/546 Part 1: Introduction to Simulation.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
Discrete Event Simulation
Dr. Anis Koubâa CS433 Modeling and Simulation
(C) J. M. Garrido1 Objects in a Simulation Model There are several objects in a simulation model The activate objects are instances of the classes that.
Queuing Theory.  Queuing Theory deals with systems of the following type:  Typically we are interested in how much queuing occurs or in the delays at.
Advantages of simulation 1. New policies, operating procedures, information flows and son on can be explored without disrupting ongoing operation of the.
CS433 Modeling and Simulation Lecture 09 – Part 02 Discrete Events Simulation Dr. Anis Koubâa 27 Dec 2008 Al-Imam.
MA354 Math Modeling Introduction. Outline A. Three Course Objectives 1. Model literacy: understanding a typical model description 2. Model Analysis 3.
 Simulation enables the study of complex system.  Simulation is a good approach when analytic study of a system is not possible or very complex.  Informational,
Introduction The objective of simulation – Analysis the system (Model) Analytically the model – a description of some system intended to predict the behavior.
1 CS 214 Modeling and Simulation Introduction. 2 Goals of This Course lIntroduce Modeling lIntroduce Simulation lDevelop an Appreciation for the Need.
MODELING AND SIMULATION CS 313 Simulation Examples 1.
Simulation Examples And General Principles Part 2
Queuing Theory Simulation & Modeling.
Building Valid, Credible & Appropriately Detailed Simulation Models
Simulation Modeling & Simulation 33.  Simulation: It is a numerical technique for conducting experiments with certain types of mathematical models.
Chapter 1 What is Simulation?. Fall 2001 IMSE643 Industrial Simulation What’s Simulation? Simulation – A broad collection of methods and applications.
Introduction To Modeling and Simulation 1. A simulation: A simulation is the imitation of the operation of real-world process or system over time. A Representation.
Modelling & Simulation of Semiconductor Devices Lecture 1 & 2 Introduction to Modelling & Simulation.
Introduction to Simulation What is a simulation? A system that represents or emulates the behavior of another system over time; a computer simulation is.
CS433 Modeling and Simulation Lecture 02 Modeling 1 Dr. Anis Koubâa Al-Imam Mohammad Ibn Saud University 20 Oct.
Traffic Simulation L2 – Introduction to simulation Ing. Ondřej Přibyl, Ph.D.
Monte Carlo Simulation Random Number Generation
OPERATING SYSTEMS CS 3502 Fall 2017
Prepared by Lloyd R. Jaisingh
Modeling and Simulation (An Introduction)
ADVANTAGES OF SIMULATION
Modeling and Simulation CS 313
Chapter 10 Verification and Validation of Simulation Models
Parallel and Distributed Simulation
Presentation transcript:

1 CS 214 Modeling and Simulation Modeling

TERMINOLOGY lSystem –A group of objects that are joined together in some regular interaction or interdependence toward the accomplishment of some purpose. –Entity –An object of interest in the system. –E.g., customers at a bank

TERMINOLOGY (continued) lAttribute –a property of an entity –E.g., checking account balance lActivity –Represents a time period of specified length. –Collection of operations that transform the state of an entity –E.g., making bank deposits

TERMINOLOGY (continued) lEvent: –change in the system state. –E.g., arrival; beginning of a new execution; departure lState Variables –Define the state of the system –Can restart simulation from state variables –E.g., length of the job queue.

TERMINOLOGY (continued) lProcess –Sequence of events ordered on time WNote: –the three concepts(event, process,and activity) give rise to three alternative ways of building discrete simulation models

What is modelling? 6  A Model is a simplification of a real system  Modelling is the process of representing a system with a specific tool to study its behaviour  A model can be  Analytic when a mathematical approach is feasible (e.g. Queuing Model)  A simulation model used for complex systems

Model 7  A Model is a pattern, plan, representation (especially in miniature), or description designed to show the main object or workings of an object, system, or concept.  Model may also refer to:  Abstractions, concepts, and theories  representations of objects  human and animal behavior  occupations  history and culture  lighting  In geography …

Examples 8  In general, modelling is used for systems with some sort of uncertainty  Waiting time in a restaurant/Aiport  Time to go from home to the University  Response time and Throughput of a web server  The productivity of manufacturing systems  Design of multi-processor machine

Examples: Movement 9  Consider a system when a given object move  This system can be modelled by the equation S= V * t Where S is the distance run through V is the speed of the object t is the time that has been observed.  This is simplification of the real world  Another model can take into account the direction of movement, or the three dimension coordinate …  It is therefore to study the behaviour of the system based on a specific model

Examples: Model of a particle in a potential-field (Physics) 10  In this model we consider a particle as being a point of mass m which describes a trajectory  The trajectory is modeled by a function x : R → R 3 given its coordinates in space as a function of time.  The potential field is given by a function V:R 3 → R and the trajectory is a solution of the differential equation  Note this model assumes the particle is a point mass, which is certainly known to be false in many cases we use this model, for example, as a model of planetary motion.

Examples: Radio Propagation Model A radio propagation model is an empirical mathematical formulation for the characterization of radio wave propagation as a function of frequency, distance and other conditions. Different types of models –Models for outdoor environments: Ground wave, Sky wave, Environmental Attenuation, Point-to-Point propagation models, Terrain models, City Models –Models for indoor environments Free Path Loss Model (Mathematical Model) 11 Empirical Model of Radio Channel Source: Kannan Srinivasan and Philip Levis, RSSI is Under Appreciated, ACM Workshop on Embedded Networked Sensors (EmNets 2006),

A SYSTEM is a collection of entities (e.g., people or machines) that act and interact together toward the accomplishment of some logical end. SYSTEM Experiment with the Actual System Experiment with a Model of the System Analytical SolutionSimulation Too costly or disruptive Not appropriate for the design There is always the question of whether it actually reflects the system. Mathematical Model Make assumptions that take the form of mathematical or logical relationships If the model is simple enough. E.g., calculus, algebra, probability theory Highly complex systems Performance Evaluation of a System

Simulation versus Analytical Modeling  Simulation is not used when a suitable mathematical model exists  Simulations are often complex error-prone pieces of software  Simulation can take a LONG time to execute  Mathematical models are less flexible, but they are exact and efficient The problem is what model represents better the real world?

1. Static vs. Dynamic Models: 2. Deterministic vs. Stochastic Models: Represents a system as it evolves over time (e.g., a conveyor system in a factory) Involves random variables, probabilities (e.g., most queueing and inventory systems) Time plays no role; represents a system at a particular point in time (e.g., Monte-Carlo methods) No probabilistic components (e.g., worst-case analysis of a system) Classification of Models

Static (Monte Carlo)Dynamic Systems Represents the system at a particular point in time Represents the system behaviour over time Continuous Simulation: (Stochastic) Differential Equations Discrete Event Simulation: System quantities (state variables) change with events Estimation of  Risk Analysis in Business Water Level in a Dam CLASSIFICATION OF SIMULATION MODELS Queueing Systems Inventory Systems

3. Continuous vs. Discrete Models : The state of the system changes only at discrete points in time. The state of the system changes continuously (e.g., chemical processes) # of cars in a parking lot time Bit Arrival in a Queue Discrete Model Continuous Model Classification of Models time bit

SIMULATION “WORLD-VIEWS” lPure Continuous Simulation lCPU scheduling model lPure Discrete Simulation –Event-oriented / Activity-oriented / Process-oriented –number of students attending the class lCombined Discrete / Continuous Simulation

The Modeling Process

 Building a model is an iterative (repetitive) process,   Some steps need to be repeated   First, define goals and objectives   What is the objective of building a model for the system?  What are the properties of the system that need to be considered to reach the goal?  Second, collect available information about the system  gather data by doing some measurement, or assuming empirical data Goals and Objectives

 After studying the available information and with the goals in mind, we start identifying our system in its three main dimensions:  Spatial,  Temporal and  Structural  By answering the basic questions about space, time and structures, we describe the conceptual model of the system. The Conceptual Model

 What is the specific size of the object that we need to analyze?   How far spatially does that system extend (scalability)?   How does the system evolve in space?  Is it static, or dynamic? Goals and Objectives The Space Dimension

 What are the elements and processes in our system?  How much detail about them we need and can afford?  Do we have enough information about all of them or some of them are entirely unknown?  Which are the limiting ones, where are the gaps in our knowledge? ?  What are the interactions between the elements ? Goals and Objectives The Structural Dimension

 What is the time duration we should observe the system?  Are we looking at it over years, days, hours, or seconds?  Which processes are so slow that they may be considered constant during the observed time?  Do we need to see how does the system evolve in time, like in a movie, or we just need a snapshot of the reality, like on a photo?  Static or Dynamic ?  If the system is evolving, how does it change from one state to another?  Is it a continuous process or a discrete process?  Is the transition from one state of the system to another stochastic or deterministic? Goals and Objectives The Time Dimension

 A conceptual model may be a mental model, a flow diagram.  Building the right conceptual model is half the way to success.  In the conceptual model, you should clearly identify the following components of the system: Boundaries Variables Parameters Forcing functions Control functions The Conceptual Model

 Boundaries: specify what elements are included in the system and those not.  They distinguish the system from the outside world.  What material and information flows into and out of the system?  What processes are internal and which ones are external.  State Variables: They characterize the elements in the system. These quantities represent the evolution of the system, that you analyze and report as a result of the modeling exercise.  Parameters: They also characterize the elements of the system, but they are constant throughout the modeling process. Parameters can either be measured by direct experiments or may be borrowed from analyses of similar systems performed previously. The Conceptual Model

 Forcing functions: They describe the effect of the outside world upon system.  The forcing functions may change in time, but they do not respond to changes within the system.  Control functions: They are actually parameters, except that you allow them to change to see how their change affects your system dynamics.  It is like the tuning button on your radio set. At every time it is dialed to a certain position, but you know that it may vary and result in different performance of the system. The Conceptual Model

 The conceptual model can be analyzed using some mathematical tools (Probability, Algebra, Differential equations, Queuing theory, etc …)  The model must be formalized (the formalization step).  Formalization is finding the adequate mathematical equations/formulation to represent the real system.  Instead of concepts, words, images, you need to come up with equations and formulas.  Formalization is not always possible and there is no one-to-one correspondence between a conceptual model and its mathematical formalization. There are only certain rules and recommendations, but no ultimate procedure known. Mathematical Model

 Sensitivity Analysis: the study of how the variation in the output of a model can be distributed (qualitatively or quantitatively) to different sources of input variation.  Sensitivity Analysis offer valid tools for characterizing the uncertainty associated with a model.  Methodology: there are several technique, but the most common is sampling-based sensitivity analysis.  With sampling-based sensitivity analysis, the model is executed repeatedly for combinations of values sampled from the distribution (assumed known) of the input factors. Sensitive Analysis

 Calibration is often regarded as including the process of adjusting the output or indication on a measurement instrument to agree with value of the applied standard, within a specified accuracy.  After formulization of the model, adjust the behavior of mathematical model to fit the behavior of the real system by tuning some parameters of the model.  Solving the equations and generate trajectories for the variables.  The Calibration process consists in adjusting the results of the analysis of the mathematical model with the data available. Calibration

 Verification is a quality process used to evaluate whether or not a model complies with the specification of the real system.  Validation is the process of establishing documented evidence that provides a high degree of assurance that a model complies with the real system. validation you built the right modelverification you built it right  It is sometimes said that validation ensures that ‘you built the right model’ and verification ensures that ‘you built it right’. Verification and Validation

Case Study Problem Description A certain airport contains a single runway on which arriving aircraft must land. Once an aircraft is cleared to land, it will use the runway, during which time no other aircraft can be cleared to land. Once the aircraft has landed, the runway is available for use by other aircraft. The landed aircraft remains on the ground for a certain period of time before departing. The objective is to determine: The average time an aircraft must wait when arriving at an airport before they are cleared to land The maximum number of aircraft that will be on the ground at one time

Observations The output metrics suggest focusing on –Waiting process –Number of aircraft on the ground We could develop a detailed model keeping track of the position of each aircraft every second, but this is not necessary to derive the desired output metrics Queueing models are a natural abstraction for modeling systems like these that include –Customers competing to use limited resources –Waiting (queueing) to use the resource –Primary metrics of interest have to do with resource utilization, time customer is being served or waiting –Details of what customer is doing while waiting are not important

Conceptual Model: Single Server Queue  Customer (aircraft)  Entities utilizing the system/resources  Server (runway)  Resource that is serially reused; serves one customer at a time  Queue  Buffer holding aircraft waiting to land customer queue server

Queueing Network Applications Queueing networks useful for many applications  Customers utilizing business services (e.g., bank, hospital, restaurant …)  Manufacturing: assembly lines  Supply chains  Transportation (aircraft, vehicles)  Computer communication networks  Computer systems (jobs being processes by a set of compute servers; I/O systems)

Specification Model (Queueing Networks) Customers –What is the arrival process? Schedule of aircraft arrivals, e.g., log from specific dates (trace driven) Often, probability distribution defines time between successive customer arrivals (interarrival time) –Assumes interarrival times independent, and identically distributed (iid) –Not always true (e.g., customers may leave if lines are too long!) –Customer attributes? Sometime different flavors, e.g., priorities or other properties Servers –How much service time is needed for each customer? May use probability distribution to specify customer service time (iid) –How many servers? Queue –Service discipline - who gets service next? First-in-first-out (FIFO), Last-in-first-out (LIFO), random … May depend on a property of the customer (e.g., priority, “smallest” first) Preemption? –Queue capacity? What if the queue overflows?

Specification Model (cont.) Our assumptions: Customers –Assume arrivals are iid, following an exponential distribution for interarrival times with mean A –Assume all customers are identical (no specific attributes) Servers –Assume customer service time is iid, exponentially distributed, mean L –Assume one server (one runway) Queue –Assume first-in-first-out queue (first-come-first-serve) discipline –Assume queue has unlimited capacity How do we model aircraft after they have landed? –Could use a second (trivial) server, with service time indicating time one ground, and an unlimited number of servers Implicitly assume “conservative” server; server never idle if there is a customer waiting in queue

Computational Model A computer simulation is a computer program that models the behavior of a physical system over time. To do this, we must Define a computer representation of the state of the system, i.e., define state variables that encode the current state of the physical system Determine the state of the system over all points in time in which we are interested (compute a sample path) –Define a simulation program that modifies state variables to model the evolution of the physical system over time. Key questions What are the state variables? How does the state change (what rules are used)?

State Variables State:  InTheAir: number of aircraft either landing or waiting to land  OnTheGround: number of landed aircraft  RunwayFree: Boolean, true if runway available customer queue server

Evolving System State Given the current state of the system, how do we determine the new system state? At which points in time (in the simulated system) do we need to compute the system state? –Fixed time increments (time stepped simulation) –Irregular time increments (typically, when the state changes)

Time Step Implementation /* ignore aircraft departures */ Float InTheAir : # aircraft landing or waiting to land Float OnTheGround : # landed aircraft Boolean RunwayFree : True if runway available Float NextArrivalTime : Time the next aircraft arrives Float NextLanding : Time next aircraft lands (if one is landing) For (Now = 1 to EndTime) { /* time step size is 1.0 */ if (Now >= NextArrivalTime) { /* if aircraft just arrived */ InTheAir := InTheAir + 1; NextArrivalTime := NextArrivalTime + RandExp(A); if (RunwayFree) { RunwayFree := False; NextLanding := Now + RandExp(L); } if (Now >= NextLanding) { /* if aircraft just landed */ InTheAir := InTheAir - 1; OnTheGround := OnTheGround + 1; if (InTheAir > 0) NextLanding := Now + RandExp(L) else {RunWayFree := True; NextLanding := EndTime+1;} }