You are on page 1of 23

Modeling & Simulation Lecture 1

Basics of Simulation Modeling


Instructor: Eng. Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department

Outline
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
The Hashemite University 2

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.
The Hashemite University

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.
The Hashemite University 4

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.
The Hashemite University 5

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.
The Hashemite University 6

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 doesnt 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).
The Hashemite University 7

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. Operation of a production line

Design and analysis of manufacturing systems

Evaluating designs for service organizations

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.
The Hashemite University

Study call centers, fast-food restaurants, hospitals, and post offices

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 Event: Usually a change in system state
The Hashemite University

Might depend on desired objectives & performance measures

Customer arrival, start of service, and customer departure


9

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.
The Hashemite University 10

How to study a system?


Representing a system in terms of logical and quantitative relationships.

The Hashemite University

11

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
The Hashemite University

12

Continuous and Discreteevent 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.

The Hashemite University

13

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. 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.
The Hashemite University 14

Stochastic or probabilistic models:

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 models output is a linear function of input parameters Applied for models that are described with mathematical relations.

Linear and non-linear models

Open and closed models

The Hashemite University

15

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.
The Hashemite University

16

Steps in a Simulation Study I

The Hashemite University

17

Steps in a Simulation Study II

The Hashemite University

18

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
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.
The Hashemite University 19

Spreadsheet simulation

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

The Hashemite University

20

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.

The Hashemite University

21

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

Pitfalls

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 Failure to identify objectives clearly up front In appropriate level of detail (both ways) Inadequate design and analysis of simulation experiments Inadequate education, training
The Hashemite University 22

Additional 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

The Hashemite University

23

You might also like