amr netw707 lect01

31
NETW 7 7 odeling and Simulation Amr El Mougy

Upload: fahadabbas11

Post on 03-Jun-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 1/32

NETW 7

odel

and

Simulat

Amr El Mo

Page 2: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 2/32

People and Resources

• Instructor: Amr El Mougy

• Email: [email protected]

• Office hours: Monday 2:00-3:00, Thursday 3:00-4:00

• Office: C7.312

• TA: Maggie Mashaly

• Email: [email protected]

• Office hours:

• Office:

Page 3: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 3/32

Assessment

Assignments

10%

Quizzes (best 2/3)

10%

Project

15%

Mid-term

25%

Final

40%

Page 4: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 4/32

Pre-Requisites

Probability• MS-Excel

• Programming skills

Page 5: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 5/32

Textbook• Author: Averill M. Law

• Title: “Simulation Modeling and Analysis”, Fourth Edition 

• Publisher: McGraw-Hill Higher Education

• Year: 2007

Notes:

- The codes in this book are written in C++. However, simulationthe course will be done using Excel. Ideas from this book will b

- Part of the contents of the slides are copyrighted to Dr. Akram

- These slides are not meant to be comprehensive lecture noonly remarks and pointers. The material presented here is notstudying for the course. Your main sources for studying are and your own lecture notes

Page 6: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 6/32

Course Outline

• Introduction to simulation

• Simulation examples in Excel spreadsheets

• General principles of simulation

• Statistical models in simulation

• Queuing models• Random number generation

• Random variate generation

• Monte-Carlo simulation

Page 7: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 7/32

Lecture (1) 

Introduction to

Systems andSimulation

Page 8: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 8/32

Systems

Systems: a group of objects joined together in sregular interaction or interdependence towards accomplishment of some purpose

Example: A production system

manufacturing automobiles.Machines, components and

workers operate jointly to

produce vehicles

Page 9: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 9/32

System Environment• A system is affected by changes that occur outside its bound

Such changes are said to occur in the system environment• The boundary  between the system and its environment

depend on the purpose of the study

• Example: Bank System

- There is a limit on the maximum interest rate that can

be paid- For a study of a single bank, this would be an example of a

imposed by the environment

- For a study of the effect of monetary laws on the banking

the setting of the limit would be an activity of the system

Page 10: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 10/32

Entity

Attribute

StateActivity

Event

System Components

System

Object of interest

in the system

Propert

entity

The collection o

necessary to des

at a particular ti

objectives of the

An action that takes place

over a period of specified

length and changes the

state of the system

An instantaneous

occurrence that may

change the state of

the system

Page 11: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 11/32

System Components

Endogenous:Activities and events occurring

within a system

Exogenous:Activities and events occurring outside the sy

Page 12: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 12/32

ExampleAttribu

Balance in the cust

Activity:

Making deposits

State Variables:

# busy tellers, # customers

waiting in line or being served,

arrival time of next customer

Page 13: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 13/32

Examples

System Entities Attributes Activities Events

Railway  Passengers Origin, destination TravelingArrival at station,

arrival at

destination

N

w

Production  MachinesSpeed, capacity,

breakdown rate

Welding,

stampingBreakdown

(

Communications  Messages Length, destination TransmittingArrival at

destination

Inventory  Warehouse Capacity Withdrawal Demand

Page 14: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 14/32

Types of Systems

Discrete CState variables change

instantaneously at

separated points in time

Example: Bank

Number of customerschanges only when

customer arrives or departs

St

co

ti

Ex

Poco

re

Page 15: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 15/32

Note

It is often possible to use discrete event simulatioapproximate the behaviour of a continuous systegreatly simplifies the analysis

“ Few systems in practice are wholly discrete or

continuous. But since one type of change domina

most systems, it will usually be possible to classif

system as being discrete or continuous” [Law, 200

Page 16: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 16/32

Ways to Study a System [Law

System

Experiment

with the

Actual System

Experiment

with a Model

of the System

Physical

Model

Mathematical

Model

Analytical

SolutionSimu

Page 17: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 17/32

Why are Models Used?

It is not possible to experiment with the actual system, e.g.:experiment is destructive

• The system might not exist, i.e. the system is in the design s

Example: Bank

- Reducing the number of tellers to study the effect on the lewaiting lines may annoy the customers such that they will maccounts to a competitor

Page 18: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 18/32

Models

• A model is a representation of a system for the purp

studying that system• It is only necessary to consider those aspects of the s

that affect the problem under investigation

• The model is a simplified representation of the syste

•The model should be sufficiently detailed to permit vconclusions to be drawn about the actual system

• Different models of the same system may be requirepurpose of the investigation changes

Page 19: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 19/32

Types of Models

• A Mathematical Model utilizes symbolic notations and equrepresent a system

- Example: current and voltage equations are mathematical man electric circuit

• A Physical Model is a larger or smaller version of an object

- Example: enlargement of an atom or a scaled version of thesystem

Page 20: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 20/32

Classifications of Simulation Mo

Static Dynamic

Deterministic Stochastic

Discrete Continuous

Page 21: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 21/32

Static and Dynamic Models

Static

• i.e. Monte Carlo

Simulation – Represents

a system at a particular

point in time• Example: Simulation of

a coin toss game

Dynamic

• Represents syst

they change ove

• Example: The

simulation of afrom 9:00am – 4

Page 22: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 22/32

Deterministic and Stochastic Mo

Deterministic

• Contain no random variables

• Has a known set of inputs that

will result in a unique set of

outputs

• Example: Patients arriving at

the dentist’s office exactly at

their scheduled appointments

Stochastic

• Has one or more random

• Random inputs lead to r

outputs

• Random outputsonly

the true characteristics 

• Example: random arriva

Output may be average

waiting customers, aver

time. This output is onlyestimate of the system

Page 23: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 23/32

Discrete and Continuous Mode

Discrete

• Not always used to simulate a

discrete system

• Example: Tanks and pipes may

be modeled discretely, even

though the flow is continuous

Continuou

• Not always used to

continuous system

• The choice of whether to use a discrete or continuous model

on the characteristics of the system and the objectives of the

Page 24: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 24/32

Introduction to Simulation

 Simulation is the imitation of a real-world procsystem over time [Banks et al.]

 It is used for analysis and study of complex syst

 Simulation requires the development of a simu

model  and then conducting computer-based expwith the model to describe, explain, and predictbehaviour of the real system

Page 25: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 25/32

When is Simulation Appropria

Simulation enables the study of, and intewith, the internal actions of a real system

The effects of changes in state variables omodel’s behaviour can be observed 

The knowledge gained from the simulatiomodel can be used to improve the design real system under investigation

Page 26: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 26/32

When is Simulation Appropria

Changing inputs and observing outputs can prvaluable insights about the importance of varia

and how they interact

Simulations can be used to experiment with d

designs and policies before implementation soprepare for what might happen

Simulations can be used to verify analytic solu

Page 27: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 27/32

When is Simulation not Appropr

The problem can be solved by common senseThe problem can be solved analytically

It is less expensive to perform direct experime

Costs of modeling and simulation exceed savi

Resources or time are not available

Lack of necessary data

System is very complex or cannot be defined

Page 28: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 28/32

Advantages of Simulation

Effects of variations in the system parameters can be owithout disturbing the real system

New system designs can be tested without committingfor their acquisition

Hypotheses on how or why certain phenomena occurtested for feasibility

Time can be expanded or compressed to allow for speslow down of the phenomenon under investigationInsights can be obtained about the interactions of var

their importance

Bottleneck analysis can be performed in order to discowork processes are being delayed excessively

Page 29: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 29/32

Disadvantages of Simulation

Model building requires special trainingSimulation results are often difficult to interp

Most simulation outputs are random variableson random inputs – so it can be hard to distingwhether an observation is the result of systemrelationship or randomness

Simulation modeling and analysis can be timeconsuming and expensive

Page 30: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 30/32

Offsetting the Disadvantages Simulation

Utilize simulation packages that only need inptheir operation, e.g.: SIMULINK, MS-Excel

Many simulation packages have output analyscapabilities, e.g. MATLAB, Excel

Simulation has become faster due to advancehardware

St i Si l ti St d

Page 31: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 31/32

Steps in a Simulation Study

Phase I

• Problem formulation: statement of the problem

• Setting of objectives and overall design: questions to be answered by the simulation

Phase II

• Model conceptualization: abstract the essential features of the problem, select and modify basic as

characterize the system, start with a simple model, enrich and elaborate the model

• Data collection: start early because it may take a lot of time

• Model translation: programming

• Verification: is the computer program functioning properly

• Validation: does the model accurately represent the system

Phase III

• Experimental design: which alternatives (designs) to simulate

• Production runs and analysis: to estimate measures of performance for the system designs that hav

Measures of performance may depend on statistical analysis, e.g.: average, probability, frequency, e

• More runs? a sufficient number is needed to guarantee statistical accuracy

Phase IV

• Documentation

• Implementation

Problem Formulation1

Page 32: Amr Netw707 Lect01

8/12/2019 Amr Netw707 Lect01

http://slidepdf.com/reader/full/amr-netw707-lect01 32/32

Setting of Objectives and

Overall Project Plan

Model Conceptualization

Model Translation

Verified

Validated

Experimental Design

Production Runs and Analysis

More Runs

Documentation

and Reporting

Data Collection

Yes

Yes

No

NoNo

2

3 4

5

6

7

8

9

10

11

Yes No