CPSC 531 Introduction to Systems Modeling and Simulation

  • Slides: 20
Download presentation
CPSC 531: Introduction to Systems Modeling and Simulation Instructor: Anirban Mahanti Office: ICT 745

CPSC 531: Introduction to Systems Modeling and Simulation Instructor: Anirban Mahanti Office: ICT 745 Email: mahanti@cpsc. ucalgary. ca Class Location: TRB 101 Lectures: TR 15: 30 – 16: 45 hours Class web page: http: //pages. cpsc. ucalgary. ca/~mahanti/teaching/F 05/CPSC 531/ Notes derived from “Simulation Modeling and Analysis” by A. Law and W. Kelton, Third edition, Mc. Graw Hill, 2000. CPSC 531: Introduction 1

What is this course about? r This course is primarily about imitating the operation

What is this course about? r This course is primarily about imitating the operation of real-world systems using computer programs. Our focus will be on “discrete-event” simulations. We will learn how to: m Abstract real-world systems into models m Implement models using software m Experiment design r Systems modeling requires understanding of m Basic probability, statistics, elementary calculus r We will also talk about analytically solving models CPSC 531: Introduction 2

Tentative topics and schedule r Introduction (1 week) r General Principles and Examples (1.

Tentative topics and schedule r Introduction (1 week) r General Principles and Examples (1. 5 weeks) r Statistical Models (1. 5 weeks) r Queuing Models (2 weeks) r Generating Random-Numbers (1 week) r Generating Random-Variates (1 week) r Input Modelling (1 week) r Output Data Analysis (1 week) r Experiment Design and Analysis (1. 5 weeks) r Simulation of Computer Systems (1 week) - time permitting CPSC 531: Introduction 3

Books and software r Lecture material primarily drawn from: m Discrete-Event System Simulation (Fourth

Books and software r Lecture material primarily drawn from: m Discrete-Event System Simulation (Fourth Edition), Banks, Carson, Nelson, and Nicol, Prentice -Hall, 2005. Henceforth, referred to as [BCNN 05]. m Simulation Modeling and Analysis (Third Edition), Law and Kelton, Mc. Graw Hill, 2000. Henceforth, referred to as [LK 00]. m Other texts – see class web pages. r Software: C/C++, Unix, CSIM simulation tool m Learn CSIM on your own; TAs will provide help. CPSC 531: Introduction 4

Assignment, exams, and grading r Four assignments – programming in C/C++/CSIM, problem-solving questions m

Assignment, exams, and grading r Four assignments – programming in C/C++/CSIM, problem-solving questions m Need to cumulatively obtain a passing grade in the assignment component of the course r Midterm examination – closed book/notes r Final examination – closed book/notes m Need to obtain a passing grade in the final exam r Grading – moderate (class average ~ B? ) r Conclusion – need to work hard; read the text; attend classes and tutorials; learn a lot! CPSC 531: Introduction 5

Basics of Modeling and Simulation r What is simulation? r How to study a

Basics of Modeling and Simulation r What is simulation? r How to study a system? r When to use simulations? r Application areas of simulation r Terminology – system, state, events r Model classification r Types of simulation r Steps in a simulation study r Advantages, disadvantages, and pitfalls in a simulation study CPSC 531: Introduction 6

What is a simulation? r Simulation – is imitation of the operation of a

What is a simulation? r Simulation – is imitation of the operation of a facility or process, usually using a computer m Facility being simulated is also called a “system” m Assumptions/approximations, both logical and mathematical, are made about how the system works m These assumptions form a model of the system r Models have many applications and can answer questions such as: m Why does my Web performance suffer when my room-mate starts using the Wi. Fi connection? m What will be the path of a hurricane? Etc. CPSC 531: Introduction 7

How to study a system? CPSC 531: Introduction 8

How to study a system? CPSC 531: Introduction 8

When to use simulations? r Simulations can be used: m To study complex system,

When to use simulations? r Simulations can be used: m To study complex system, i. e. , systems where analytic solutions are infeasible. m To compare design alternatives for a system that doesn’t exist. m To study the effect of alterations to an existing system. Why not change the system? ? m To reinforce/verify analytic solutions. r Simulations should not be used: m If model assumptions are simple such that mathematical methods can be used to obtain exact answers (analytical solutions) CPSC 531: Introduction 9

Application Areas r Design and performance evaluation of computer systems m Determining hardware requirements

Application Areas r Design and performance evaluation of computer systems m Determining hardware requirements or protocols for communications networks m Studying CPU Scheduling algorithms m Evaluation of Web caching policies r Design and analysis of manufacturing systems m Operation of a production line r Evaluating designs for service organizations m Study call centers, fast-food restaurants, hospitals, and post offices r Evaluating military weapons systems or their logistics requirements r Designing and operating transportation systems such as airports, freeways, ports, and subways r Analyzing financial or economic systems CPSC 531: Introduction 10

Terminology r System: A collection of objects that act and interact together toward some

Terminology r System: A collection of objects that act and interact together toward some logical end m E. g. Determine number of cashiers needed to provide express service to customers with 10 or less item at a superstore – system consists of express cashiers and customers with 10 or less items r State of a system: Collection of variables and their values necessary to characterize a system at a particular time m m Might depend on desired objectives, performance measures SS Example: # of express cashiers, time of arrival of customers with 10 or less items, etc. r Event: A change in system state m Customer arrival, start of service, and customer departure CPSC 531: Introduction 11

Model Classification [Jain 91] r Continuous-time vs. discrete-time models r Continuous-event vs. discrete-event models

Model Classification [Jain 91] r Continuous-time vs. discrete-time models r Continuous-event vs. discrete-event models r Deterministic vs. probabilistic models r Static vs. dynamic models r Linear vs. non-linear models r Open vs. closed models CPSC 531: Introduction 12

Continuous and Discrete-time models Number of students in cpsc 531 Number of cust. in

Continuous and Discrete-time models Number of students in cpsc 531 Number of cust. in queue Time (a) Continuous-time Time (b) Discrete-time CPSC 531: Introduction 13

Continuous and Discrete-event models Distance traveled by plane Number of cust. in queue Time

Continuous and Discrete-event models Distance traveled by plane Number of cust. in queue Time (a) Continuous-event Time (b) Discrete-event CPSC 531: Introduction 14

Deterministic and Stochastic Models r Deterministic models produce deterministic results r Stochastic or probabilistic

Deterministic and Stochastic Models r Deterministic models produce deterministic results r Stochastic or probabilistic models are subject to random effects m Typically, they have one or more random inputs (e. g. , arrival of customers, service time etc. ). m Outputs from stochastic models are “estimates” of the true characteristics of the system m Need to repeat experiments number of times m Need to have confidence in the results CPSC 531: Introduction 15

More on models r Static and dynamic models m Static models – system state

More on models r Static and dynamic models m Static models – system state independent of time m Dynamic models - system state change with time r Linear and non-linear models m Linear models – output is a linear function of input parameters r Open and closed models (a) Open Model (b) Closed Model CPSC 531: Introduction 16

Types of Simulation (1/2) r Monte Carlo simulation m No time element (usually) m

Types of Simulation (1/2) r Monte Carlo simulation m No time element (usually) m Used for evaluating non-probabilistic expressions (e. g. , an integral) using probabilistic methods m Wide variety of mathematical problems r Trace-driven simulation m Extensively used in computer systems performance evaluation; e. g. , paging algorithms m Advantages: credibility, easy validation, less randomness, accurate workload m Disadvantages: complexity, only a snap-shot, representative? , single point of validation CPSC 531: Introduction 17

Types of Simulation (2/2) r Monte Carlo simulation r Trace-driven simulation r Discrete-event simulation:

Types of Simulation (2/2) r Monte Carlo simulation r Trace-driven simulation r Discrete-event simulation: a simulation using a discrete-event (also called discrete-state) model of the system m E. g. , Widely used for studying computer systems r Continuous-event simulation: uses a continuous -state models m E. g. , Widely used in chemical/pharmaceutical studies r Our focus will be on discrete-event systems. CPSC 531: Introduction 18

Steps in a Simulation Study CPSC 531: Introduction 19

Steps in a Simulation Study CPSC 531: Introduction 19

Advantages, disadvantages, and pitfalls in a simulation study r Advantages m Simulation allows great

Advantages, disadvantages, and pitfalls in a simulation study r Advantages m Simulation allows great flexibility in modeling complex systems, so simulation models can be highly valid m Easy to compare alternatives m Control experimental conditions m Can study system with a very long time frame r Disadvantages m Stochastic simulations produce only estimates – with noise m Simulation models can be expensive to develop m Simulations usually produce large volumes of output – need to summarize, statistically analyze appropriately r Pitfalls m Failure to identify objectives clearly up front m Inappropriate level of detail (both ways) m Inadequate design and analysis of simulation experiments m Inadequate education, training CPSC 531: Introduction 20