Top Banner
CS 450 Modeling and Simulation Dr. X CS 450 1
38

CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

Dec 22, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 1

CS 450 Modeling and Simulation

Dr. X

Page 2: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 2

Topics

• Modelling vs Simulation• Applications of Simulation• Why Simulate• How to Simulate

Page 3: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 3

What Is A Model ?

A Representation of an object, a system, or an idea in some form other than that of the entity itself.

(Shannon)

Page 4: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 4

What Is A Model ?

A description of the system you wish to study

Page 5: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 5

Types of Models• Physical

– Scale models, – prototype plants,…

• Mathematical– Analytical queueing models, – linear programs, – Simulation

• Computational– Weather forecasting– Earth Simulator– Flight, Combat Simulator– Molecular simulator– Nuclear simulator

Page 6: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 6

Why do we need models?

Page 7: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 7

Simulation Models

1. Environment2. Interdependency3. Sub-systems4. Organization5. Change

Page 8: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 8

Level of detail

Beard’s Managerial Pyramid

Page 9: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 9

What is Simulation?

Implementation of a model

Page 10: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 10

Why simulate?

• Cost• Safety• Speed• Try before implementing• Creativity• Detailed design• Predictions• Experimentation

Page 11: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 11

Simulation Applications

• Designing and analyzing manufacturing systems• Evaluating H/W and S/W requirements for a computer system• Evaluating a new military weapons system or tactics• Determining ordering policies for an inventory system• Designing communications systems and message protocols for

them

Page 12: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 12

Simulation Applications

• Designing and operating transportation facilities such as freeways, airports, subways, or ports

• Evaluating designs for service organizations such as hospitals, post offices, or fast-food restaurants

• Analyzing financial or economic systems

Page 13: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 13

Steps In Simulation and Model Building

1. Define an achievable goal2. Put together a complete mix of skills on the team3. Involve the end-user4. Choose the appropriate simulation tools5. Model the appropriate level(s) of detail6. Start early to collect the necessary input data

Page 14: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 14

Steps In Simulation and Model Building(cont’d)

7. Provide adequate and on-going documentation8. Develop a plan for adequate model verification

(Did we get the “right answers ?”)9. Develop a plan for model validation

(Did we ask the “right questions ?”)10. Develop a plan for statistical output analysis

Page 15: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 15

Define An Achievable Goal

• “To model the…” is NOT a goal!• “To model the…in order to select/determine feasibility/…” is a

goal.• Goal selection is not cast in concrete• Goals change with increasing insight

Page 16: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 16

Put together a complete mix of skills on the team

We Need:– Knowledge of the system under investigation– System analyst skills (model formulation)– Model building skills (model Programming)– Data collection skills– Statistical skills (input data representation)

Page 17: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 17

Put together a complete mix of skills on the team(continued)

We Need:– More statistical skills (output data analysis)– Even more statistical skills (design of experiments)– Management skills (to get everyone pulling in the same direction)

Page 18: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 18

Involve the end user

• Modeling is a selling job!• Does anyone believe the results?• Will anyone put the results into action?• The End-user (your customer) can (and must) do all of the

above BUT, first he must be convinced!• He must believe it is HIS Model!

Page 19: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 19

Choose The Appropriate Simulation Tools

• Build Model in a General Purpose Language

• Build Model in a General Simulation Language

• Use a Special Purpose Simulation Package

Page 20: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 20

Modelling w/ general purpose languages

• Advantages:– Little or no additional software cost– Maximum customization– Universally available (portable)– No additional training (Everybody knows…(language X) ! )

• Disadvantages:– Every model starts from scratch– Very little reusable code– Long development cycle for each model– Difficult verification phase

Page 21: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 21

Gen. Purpose languages used for simulation

• FORTRAN– Probably more models than any other language.

• C++, Java, C#– Object-oriented programming language

• Python, Perl, Ruby– Interpreted programming languages

Page 22: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 22

Modeling w/ general simulation languages

• Advantages:– Standardized features often needed in modeling– Shorter development cycle for each model– Much assistance in model verification– Very readable code

• Disadvantages:– Higher software cost (up-front)– Additional training required– Limited portability– Limited customization

Page 23: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 23

General purpose simulation languages

• SimPy• Arena• NS3• Csim• ExtendSim• Simio

Page 24: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 24

Special purpose packages used for simulation

• OPNET– Simulator for communication networks, including wireless networks

• Modelica• Matlab Simulink• Other

Page 25: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 25

TERMINOLOGY

• System– 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

Page 26: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 26

TERMINOLOGY (continued)

• Attribute– a property of an entity– E.g., checking account balance

• Activity– Represents a time period of specified length.– Collection of operations that transform the state of an entity– E.g., making bank deposits

Page 27: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 27

TERMINOLOGY (continued)

• Event:– change in the system state.– E.g., arrival; beginning of a new execution; departure

• State Variables– Define the state of the system– Can restart simulation from state variables– E.g., length of the job queue.

Page 28: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 28

TERMINOLOGY (continued)

• Process– Sequence of events ordered on time

• Note: – the three concepts(event, process,and activity) give rise to three

alternative ways of building discrete simulation models

Page 29: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 29

EXAMPLES OF SYSTEMS AND COMPONENTS

System Entities Attributes Activities Events StateVariables

Banking Customers Checkingaccountbalance

Makingdeposits

Arrival;Departure

# of busytellers; # ofcustomerswaiting

Note: State Variables may change continuously (continuous sys.)over time or they may change only at a discrete set of points (discrete sys.) in time.

Page 30: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 30

SIMULATION “WORLD-VIEWS”

• Pure Continuous Simulation• Pure Discrete Simulation– Event-oriented– Activity-oriented– Process-oriented

• Combined Discrete / Continuous Simulation

Page 31: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 31

Examples Of Both Type Models

• Continuous Time and Discrete Time Models:CPU scheduling model vs. number of students attending the class.

Page 32: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 32

Other Models

• Static and Dynamic Models:CPU scheduling model vs. E = mc2

Input

Output

Input

Output

• Deterministic and Probabilistic Models:

Page 33: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 33

START EARLY TO COLLECT THE NECESSARY INPUT DATA

• Data comes in two quantities:TOO MUCH!!TOO LITTLE!!

Page 34: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

Introduction 34

PROVIDE ADEQUATE AND ON-GOING DOCUMENTATION

• In general, programmers hate to document. (They love to program!)

• Documentation is always their lowest priority item. (Usually scheduled for just after the budget runs out!)

• They believe that “only wimps read manuals.”• What can we do?– Use self-documenting languages– Insist on built-in user instructions(help screens)– Set (or insist on) standards for coding style

Page 35: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

Introduction 35

DEVELOP PLAN FOR ADEQUATE MODEL VERIFICATION

• Did we get the “right answers?”(No such thing!!)

• Simulation provides something that no other technique does:Step by step tracing of the model execution.

Page 36: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

Introduction 36

DEVELOP A PLAN FOR MODEL VALIDATION

VALIDATION: “Doing the right thing” Or “Asking the right questions”

Page 37: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

Introduction 37

DEVELOP A PLAN FOR STATISTICAL OUTPUT ANALYSIS

• How much is enough?Long runs versus Replications

• Techniques for Analysis

Page 38: CS 450 Modeling and Simulation Dr. X CS 4501. Topics Modelling vs Simulation Applications of Simulation Why Simulate How to Simulate CS 4502.

CS 450 38

References

• The Guide to Computer Simulations and Games, By Katrin Becker and J.R.Parker, Wiley (Chapter 2)

• Simulation Modeling and Analysis, By Law and Kelton, McGrawHill, (Chapter 1)

• Computer Simulation Techniques: The Definitive Introduction, by Harry Perros, http://www4.ncsu.edu/~hp/simulation.pdf (Chapter 1)