lecture 1

23
Modeling & Simulation Modeling & Simulation Lecture 1 Lecture 1 Basics of Simulation Basics of Simulation Modeling Modeling Instructor: Instructor: Eng. Ghada Al-Mashaqbeh Eng. Ghada Al-Mashaqbeh The Hashemite University The Hashemite University Computer Engineering Department Computer Engineering Department

Upload: ahmad-shdifat

Post on 23-Oct-2014

34 views

Category:

Documents


0 download

DESCRIPTION

slides for Modeling and Simulation , by Eng-Ghada Al-Mashaqbeh

TRANSCRIPT

Page 1: Lecture 1

Modeling & SimulationModeling & SimulationLecture 1Lecture 1

Basics of Simulation Basics of Simulation ModelingModeling

Instructor:Instructor:Eng. Ghada Al-MashaqbehEng. Ghada Al-MashaqbehThe Hashemite UniversityThe Hashemite UniversityComputer Engineering DepartmentComputer Engineering Department

Page 2: Lecture 1

The Hashemite University 2

OutlineOutline• Preview about the course.• What is simulation?• How to study a system?• When to use simulation?• Application areas of simulation• Terminology – system, state, events• Model classification• Types of simulation• Steps in a sound simulation study• Advantages, disadvantages, and pitfalls in a

simulation study

Page 3: Lecture 1

The Hashemite University 3

What is this course about?What is this course about?• 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:– Abstract real-world systems into models– Implement models using software– Experiment design

• Systems modeling requires understanding of: Basic probability, statistics, elementary calculus.

• We will also talk about analytically solved models.

Page 4: Lecture 1

The Hashemite University 4

What is simulation?• Simulation – is imitation of the operation of

a facility or process, usually using a computer– Facility being simulated is also called a “system”– Assumptions/approximations, both logical and

mathematical, which are called the system model, are made about how the system works

• Models used in simulation have many applications and can answer questions such as:– Why does my Web performance suffer when my

roommate starts using the WiFi connection?– What will be the path of a hurricane? etc.

Page 5: Lecture 1

The Hashemite University 5

Why simulation?• The objectives of simulation most of

the time include:– To understand how a system operates.– To gain some insight(توقعات) into the

relationship between the various components of a system.

– To predict(توقع) the performance of the system under some new conditions.

– To check the validity of the design before the actual (physical) implementation.

Page 6: Lecture 1

The Hashemite University 6

Analytical Solution vs. Simulation• Simple systems where a mathematical

model of their relations exist may be analyzed mathematically, i.e. using calculus and math concepts.

• Such solutions gives exact results.• However, simulation gives estimates

of the results that are enough to predict and analyze the behavior of the system.

Page 7: Lecture 1

The Hashemite University 7

When to use simulation?• Simulation can be used:

– To study complex systems, 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 itself??

• It could be very costly to change the system.– To reinforce/verify(تحقق) analytic solutions.

• Simulation should not be used (alone):– If model assumptions are simple such that mathematical

methods can be used to obtain exact answers (analytical solutions).

Page 8: Lecture 1

The Hashemite University 8

Application Areas• Design and performance evaluation of computer systems

– Determining hardware requirements or protocols for communications networks.

– Studying CPU Scheduling algorithms.– Evaluation of Web caching policies.

• Design and analysis of manufacturing systems– Operation of a production line

• Evaluating designs for service organizations– Study call centers, fast-food restaurants, hospitals, and post

offices• Evaluating military weapons systems or their logistics

requirements• Designing and operating transportation systems such as

airports, freeways, ports, and subways• Analyzing financial or economic systems.

Page 9: Lecture 1

The Hashemite University 9

Terminology• System: A collection of objects that act and interact

together toward some logical end, Examples of systems:– Hospitals– Telecommunications system– Highways– Computer Networks– Airport check in and Boarding facilities.– A Fast food restaurant

• State of a system: Collection of variables and their values necessary to characterize a system at a particular time– Might depend on desired objectives & performance

measures• Event: Usually a change in system state

– Customer arrival, start of service, and customer departure

Page 10: Lecture 1

The Hashemite University 10

Example -- Bank• System: a bank is a system where its main objects

or entities include customers and tellers. Behaviors include the required services such as deposit or withdraw money and there is a queue for waiting the required service.

• State of a system: the number of tellers, the number of customers waiting in the queue for service, the queueing delay for each customer, the service time for each teller, etc.

• Event: Customer arrival change the queue length, for example, and also customer departure.

Page 11: Lecture 1

The Hashemite University 11

How to study a system?

Representing a system in terms of logical and quantitative relationships.

Page 12: Lecture 1

The Hashemite University 12

System Model• A model is the set of assumptions, logical

and mathematical relations that describe the system under study.

• Models classifications: can be classified among five different dimensions:– Continuous-event vs. discrete-event models– Deterministic vs. probabilistic models– Static vs. dynamic models– Linear vs. non-linear models– Open vs. closed models

Page 13: Lecture 1

The Hashemite University 13

Continuous and Discrete-event Models- Sometimes are called: continuous-time and discrete-time systems.

- Continuous-event: system state variables values change continuously with time, i.e. there is an event at every instance of time.

- Discrete-event: system state variables values change at discrete points of time, i.e. there is a countable number of events.

Page 14: Lecture 1

The Hashemite University 14

Deterministic and Stochastic Models• Deterministic models:

– Inputs to the simulation are known values– No random variables are used– Produce deterministic (exact) results– The output is known once the input values are determined

and only it needs processing time to find the output.– E.g.: chemical reactions.

• Stochastic or probabilistic models:– 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 since the output itself is also random.

– Need to repeat experiments number of times and need to have confidence in results.

– E.g.: transportation system, banking system, etc.

Page 15: Lecture 1

The Hashemite University 15

More on Models• Static and dynamic models

– Static models – system state independent of time (time does not change the state of the system)

– Dynamic models - system state change with time• Linear and non-linear models

– Linear models – output is a linear function of input parameters

– Applied for models that are described with mathematical relations.

• Open and closed models

Page 16: Lecture 1

The Hashemite University 16

But, which model to use?But, which model to use?• Then, if you want to model a system which

model will you select?– This depends on the simulation process or study

objectives not on the nature of the system under study.– For example, to study the system of products in a factory

if you want to study the state of each individual product alone then your model will be discrete (the state of the product changes at discrete points of time).

– On the other hand, if you want to study the production flow as a whole then your system will be continuous (definitely at each point of time there is a change in the state of at least one product which changes the state of the production in general).

• And remember, a system may fall under more than one category from the specified earlier.

Page 17: Lecture 1

The Hashemite University 17

Steps in a Simulation Study I

Page 18: Lecture 1

The Hashemite University 18

Steps in a Simulation Study II

Page 19: Lecture 1

The Hashemite University 19

Types of Simulation I• Monte Carlo simulation

– No time element (usually)– Used for evaluating non-probabilistic expressions

(e.g., an integral) using probabilistic methods, i.e. apply stochastic approaches to solve deterministic problems.

– Wide variety of mathematical problems• Spreadsheet simulation

– Simply use excel to implement the required simulation scenario where random variables needed to generate the inputs and output analysis tools (such as figures) are available.

– Many limitations: only simple problems, take longer execution time, data storage is limited.

Page 20: Lecture 1

The Hashemite University 20

Types of Simulation II• Trace-driven simulation

– Inputs values are determined in advance and during simulation are read from a trace file (which could be a text file).

– Most of the time, such traces are universal benchmarks which put the system under heavy load (i.e. study its behavior under the worst case conditions).

– Extensively used in computer systems performance evaluation; e.g., paging algorithms

– Advantages: credibility, easy validation, less randomness, accurate workload

– Disadvantages: complexity, only a snap-shot representation, single point of validation

Page 21: Lecture 1

The Hashemite University 21

Types of Simulation III• Discrete-event simulation: (defined in slide 13)

– E.g., Widely used for studying computer systems such as wired and wireless networks.

• Continuous-event simulation: (defined in slide 13)– E.g., Widely used in chemical/pharmaceutical studies

• Combined discrete-continuous simulation.– E.g., a continuous state variables (changes with time)

when reach a threshold value cause an event to occur (so, the event is discrete and it is independent of time).

• Our focus will be on discrete-event systems.

Page 22: Lecture 1

The Hashemite University 22

Advantages, disadvantages, and pitfalls of simulation

• 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

Page 23: Lecture 1

The Hashemite University 23

Additional NotesAdditional Notes• Check the Black Board to get your

copy of the lecture.• The lecture covers the following

sections from the textbook:– Chapter 1: Sections 1.1, 1.2, 1.7, 1.8,

and 1.9