0% found this document useful (0 votes)
160 views91 pages

BU - FCAI - SCC430 - Modeling&Simulation - Ch01 2

Modelling and simulation
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
160 views91 pages

BU - FCAI - SCC430 - Modeling&Simulation - Ch01 2

Modelling and simulation
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 91

SCC430

Modeling and Simulation


Chapter 01
Introduction
Dr. Ahmed Hagag
Faculty of Computers and Artificial Intelligence
Benha University
Fall 2020
Introduce Myself

Dr. Ahmed Hagag


Scientific Computing Department,
Faculty of Computers and Artificial Intelligence,
Benha University.

Email: ahagag@fci.bu.edu.eg

©Ahmed Hagag Modeling and Simulation 2


Course Syllabus

➢ Chapter 1: Introduction.
➢ Chapter 2: Probability as Using in Simulation.
➢ Chapter 3: Queueing Simulation.
➢ Chapter 4: Inventory Simulation.
➢ Chapter 5: Random-Number Generation.
➢ Chapter 6: Input Modeling.
➢ Chapter 7: Output Analysis.

©Ahmed Hagag Modeling and Simulation 3


Lectures References (1/4)

Discrete-Event System Simulation


Banks Carson II Nelson Nicol
Fifth Edition

©Ahmed Hagag Modeling and Simulation 4


Lectures References (2/4)

Simulation Modeling and Analysis


Averill M. Law
Fifth Edition

©Ahmed Hagag Modeling and Simulation 5


Lectures References (3/4)

Modeling and Simulation in Python


Allen B. Downey
Version 1.0.2

©Ahmed Hagag Modeling and Simulation 6


Lectures References (4/4)

Modeling and Simulation of Systems


Using MATLAB and Simulink
Devendra K. Chaturvedi

©Ahmed Hagag Modeling and Simulation 7


Project (1/2)

Activity Notes
Project Self-Study

• 5-6 students per group (Send me at: ahagag@fci.bu.edu.eg)


• Due date: 22-4-2020
• Follow up the groups in the lectures.
• Final discussion at the end of the semester.
- Documentation (CD+PPT).
- Discussion.

©Ahmed Hagag Modeling and Simulation 8


Project (2/2)

Simulation Software

You can find documents and https://www.anylogic.com/


tutorials at this website

©Ahmed Hagag Modeling and Simulation 9


Chapter 1: Introduction (1/2)

• General Introduction.
✓ Important Definitions.
✓ When Simulation is the Appropriate Tool.
✓ When Simulation is Not Appropriate.
✓ Advantages and Disadvantages of Simulation.
• Areas of Application.

©Ahmed Hagag Modeling and Simulation 10


Chapter 1: Introduction (2/2)

• Systems and System Environment.


• Components of a System.
• Classification of Systems.
• Steps in a Simulation Study.

©Ahmed Hagag Modeling and Simulation 11


General Introduction (1/10)

Modeling and simulation


of physical systems

©Ahmed Hagag Modeling and Simulation 12


General Introduction (2/10)

Important Definitions (1/4):


• The system is something in the real world we are
interested in. Often, it is something complicated, so we
must decide which details can be simplified or abstracted
away.

©Ahmed Hagag Modeling and Simulation 13


General Introduction (2/10)

Important Definitions (2/4):


• There result of abstraction is a model that includes the
features we think are essential. A model can be
represented in the form of diagrams and equations,
which can be used for mathematical analysis. It can also
be implemented in the form of a computer program,
which can run simulations.
• A simulation is the imitation of the operation of a real-
world process or system over time.

©Ahmed Hagag Modeling and Simulation 14


General Introduction (2/10)

Important Definitions (3/4):


• A model is a simplification of a real system.
• Modeling is the process of representing a system with a
specific tool to study its behavior.
• A model can be:
➢ Analytic: when a mathematical approach is feasible.
➢ Simulation: model used for complex systems.
➢ Experimental: when the real system already exists.

©Ahmed Hagag Modeling and Simulation 15


General Introduction (2/10)

Important Definitions (4/4):


• The result of analysis and simulation can be a prediction
about what the system will do, an explanation of why it
behaves the way it does, or a design intended to achieve
a purpose.
• We can validate predictions and test designs by taking
measurements from the real world and comparing the
data we get with the results from analysis and
simulation.

©Ahmed Hagag Modeling and Simulation 16


General Introduction (3/10)

Goal of Modeling and Simulation (1/2):


• A model can be used to investigate a wide verity of
“what if” questions about real-world system.
o Potential changes to the system can be simulated and
predicate their impact on the system.
o Find adequate parameters before implementation.

©Ahmed Hagag Modeling and Simulation 17


General Introduction (3/10)

Goal of Modeling and Simulation (2/2):


• So, simulation can be used as
o Analysis tool for predicating the effect of changes.
o Design tool to predicate the performance of new system.

• It is better to do simulation before implementation.

©Ahmed Hagag Modeling and Simulation 18


General Introduction (4/10)

Simulation Language
You can use:
• MATLAB®
• Python
• Java
• C/C++
• Others …

©Ahmed Hagag Modeling and Simulation 19


General Introduction (5/10)

Simulation Software
Some of important:
• AnyLogic
• Arena
• AutoMod
• ExtendSim
• Flexsim
• ProModel
• SIMUL8
• Others …

©Ahmed Hagag Modeling and Simulation 20


General Introduction (5/10)

Simulation Software
You can use:
• AnyLogic
• Arena
• AutoMod
• ExtendSim
• Flexsim
• ProModel https://www.anylogic.com/

• SIMUL8
• Others … Use in the project!

©Ahmed Hagag Modeling and Simulation 21


General Introduction (6/10)

When Simulation is the Appropriate


Tool?

©Ahmed Hagag Modeling and Simulation 22


General Introduction (7/10)

When Simulation is the Appropriate Tool? (1/3)


• Simulation enable the study of internal interaction of a
subsystem with complex system.
• Environmental changes can be simulated and find their
effects.
• A simulation model help us to gain knowledge about
improvement of system.
• Finding important input parameters with changing
simulation inputs.

©Ahmed Hagag Modeling and Simulation 23


General Introduction (7/10)

When Simulation is the Appropriate Tool? (2/3)


• Simulation can be used with new design before
implementation.
• Simulating different capabilities for a machine can help
determine the requirement.
• Risky: Risk involved in experimentation is another
factor. In some systems there is a risk of damaging the
system, or a risk of life.

©Ahmed Hagag Modeling and Simulation 24


General Introduction (7/10)

When Simulation is the Appropriate Tool? (3/3)


• A plan can be visualized with animated simulation.
• The modern system is too complex that its internal
interaction can be treated only by simulation.
• Too expensive: Experimenting with a real system is an
extremely costly affair.
➢ For example, the physical experimentation of a complex
system like the satellite system is quite expensive and time-
consuming.

©Ahmed Hagag Modeling and Simulation 25


General Introduction (8/10)

When Simulation is Not Appropriate ?

©Ahmed Hagag Modeling and Simulation 26


General Introduction (9/10)

When Simulation is Not Appropriate?


• When the problem can be solved by common sense.
• When the problem can be solved analytically.
• If it is easier to perform direct experiments.
• If cost exceed savings.
• If resource or time are not available.

©Ahmed Hagag Modeling and Simulation 27


General Introduction (9/10)

Advantages of Simulation (1/2)


• Hypotheses about how or why certain phenomena occur
can be tested for feasibility.
• Time can be compressed or expanded to allow for a
speed-up or slow-down of the phenomena.
• Insight can be obtained about the interaction of
variables.
• Insight can be obtained about the importance of
variables to the performance of the system.

©Ahmed Hagag Modeling and Simulation 28


General Introduction (9/10)

Advantages of Simulation (2/2)


• New hardware designs, physical layouts, transportation
systems, and so on can be tested easily.
• A simulation study can help in understanding how the
system operates.
• “ What if ” questions can be answered. This is useful in
the design of new systems.

©Ahmed Hagag Modeling and Simulation 29


General Introduction (10/10)

Disadvantages of Simulation
• Model building requires special training.
• Simulation results can be difficult to interpret.
• Simulation modeling and analysis can be time
consuming and expensive.
• Simulation is used in some cases when an analytical
solution is possible.

©Ahmed Hagag Modeling and Simulation 30


Areas of Application (1/2)

Give me some examples for systems


can be simulated.

©Ahmed Hagag Modeling and Simulation 31


Areas of Application (2/2)

1. Networks

©Ahmed Hagag Modeling and Simulation 32


Areas of Application (2/2)

2. Military Applications

©Ahmed Hagag Modeling and Simulation 33


Areas of Application (2/2)

3. Call Centers

©Ahmed Hagag Modeling and Simulation 34


Areas of Application (2/2)

4. Manufacturing Applications

©Ahmed Hagag Modeling and Simulation 35


Areas of Application (2/2)

5. HealthCare

©Ahmed Hagag Modeling and Simulation 36


Areas of Application (2/2)

6. Road Traffic

©Ahmed Hagag Modeling and Simulation 37


Areas of Application (2/2)

7. Crowd Flow

©Ahmed Hagag Modeling and Simulation 38


Areas of Application (2/2)

8. Airport

©Ahmed Hagag Modeling and Simulation 39


Areas of Application (2/2)

9. Car Garage

©Ahmed Hagag Modeling and Simulation 40


Areas of Application (2/2)

10. Banking

©Ahmed Hagag Modeling and Simulation 41


Areas of Application (2/2)

11. Trains Stations

©Ahmed Hagag Modeling and Simulation 42


Areas of Application (2/2)

12. Gas Station

©Ahmed Hagag Modeling and Simulation 43


Areas of Application (2/2)

12. Highway Junction

©Ahmed Hagag Modeling and Simulation 44


Areas of Application (2/2)

13. Automated Guided Vehicles

©Ahmed Hagag Modeling and Simulation 45


Chapter 1: Introduction (1/2)

• General Introduction.
✓ Important Definitions.
✓ When Simulation is the Appropriate Tool.
✓ When Simulation is Not Appropriate.
✓ Advantages and Disadvantages of Simulation.
• Areas of Application.

©Ahmed Hagag Modeling and Simulation 46


Chapter 1: Introduction (2/2)

• Systems and System Environment.


• Components of a System.
• Classification of Systems.
• Steps in a Simulation Study.

©Ahmed Hagag Modeling and Simulation 47


Systems (1/2)

• The term system is derived from the Greek word


systema, which means an organized relationship among
functioning units or components. It is used to describe
almost any ordered arrangement of ideas or construct.
• A system is any set of interrelated components acting
together to achieve a common objective.
• A system is defined as a group of objects that are joined
in some regular interaction or interdependence toward
the accomplishment of some purpose.

©Ahmed Hagag Modeling and Simulation 48


Systems (2/2)

• The collection of entities that compose a system for one


study might be only a subset of another larger system.
➢ For example, if one wants to study a banking system
to determine the number of tellers needed to provide
adequate service for customers who want just to
encash or deposit, the system can be defined to be
that portion of the bank comprising of the tellers and
the customers. Additionally, if, the loan officer and
the safety deposit counters are to be included, then
the definition of the system must be more inclusive
accordingly.
©Ahmed Hagag Modeling and Simulation 49
System Environment (1/6)

• A system is characterized by the following attributes:


o System boundary.
o System components and their interactions.
o Environment.

©Ahmed Hagag Modeling and Simulation 50


System Environment (2/6)

• A system is often affected by changes occurring outside


the system. Such changes are said to occur in the system
environment.
➢ Factory : Arrival orders
Effect of supply on demand: relationship between
factory output and arrival (activity of system).
➢ Banks : Arrival of customers

©Ahmed Hagag Modeling and Simulation 51


System Environment (3/6)

• In modeling systems, it is necessary to decide on the


boundary between the system (i.e., part of system) and
its environment. This decision may depend on the
purpose of the study.
• System component is a fundamental building block. It
is quite easy to find the input–output relations for the
system components with the help of some fundamental
laws of physics, which is called the mathematical model
for components. It may be written in the form of
difference or differential equations. They are simple and
easily understandable.
©Ahmed Hagag Modeling and Simulation 52
System Environment (4/6)

• A living organism is a system. Organisms are open


systems: they cannot survive without continuously
exchanging matter and energy with their environment.
When we separate a living organism from its
surrounding, it will die shortly due to lack of oxygen,
water, and food.
• This interaction has two components: input, that is, what
enters the system from outside the boundary, and output,
that is, what leaves the system boundary to the
environment.

©Ahmed Hagag Modeling and Simulation 53


System Environment (5/6)

• In order to speak about the inside and the outside of a


system, we need to be able to distinguish between the
system and its environment, which is in general
separated by a boundary (for example, living systems,
skin is the boundary). The output of a system is generally
a direct or indirect result to a given input.

©Ahmed Hagag Modeling and Simulation 54


System Environment (6/6)

• Every system consists of subsystem or components at


lower levels and supersystems at higher levels.

©Ahmed Hagag Modeling and Simulation 55


Components of a System (1/4)

• An entity is an object of interest in the system.


➢ Machines in factory.
➢ Customers in Bank.
• An attribute is a property of an entity.
➢ Speed, capacity.
➢ Balance in customer accounts.
• An activity represents a time period of specified length.
➢ Welding, stamping.
➢ Making deposits.

©Ahmed Hagag Modeling and Simulation 56


Components of a System (2/4)

• The state of a system is defined to be that collection of


variables necessary to describe the system at any time,
relative to the objectives of the study.
➢ Status of machine (busy, idle, down,…)
➢ In the study of a bank, possible state variables are the number
of busy tellers, the number of customers waiting in line or
being served, and the arrival time of the next customer.

©Ahmed Hagag Modeling and Simulation 57


Components of a System (3/4)

• An event is defined as an immediate occurrence that


might change the state of the system. The term
endogenous is used to describe activities and events
occurring within a system, and the term exogenous is
used to describe activities and events in the environment
that affect the system.
➢ In the bank study, the arrival of a customer is an exogenous
event, and the completion of service of a customer is an
endogenous event.

©Ahmed Hagag Modeling and Simulation 58


Components of a System (4/4)

• Examples of entities, attributes, activities, events, and


state variables for several systems.

©Ahmed Hagag Modeling and Simulation 59


Classification of Systems (1/15)

• Systems can be classified based on time frame, type of


measurements taken, type of interactions, nature, type of
components, etc.
• According to the Time Frame:
➢ Discrete
➢ Continuous
➢ Hybrid

©Ahmed Hagag Modeling and Simulation 60


Classification of Systems (2/15)

A discrete system:
The state variable(s) change only at discrete points in time,
for example, queuing systems (bank, telephone network,
traffic lights, machine).

©Ahmed Hagag Modeling and Simulation 61


Classification of Systems (3/15)

A continuous system:
The state variable(s) change continuously over time. An
example is the head of water behind a dam, solar system,
charging a battery.

©Ahmed Hagag Modeling and Simulation 62


Classification of Systems (4/15)

A hybrid system:
A hybrid system is a combination of continuous and
discrete dynamic system behavior. A hybrid system has the
benefit of encompassing a larger class of systems within its
structure, allowing more flexibility in modeling continuous
and discrete dynamic phenomena, for example, traffic
along a road with traffic lights.

©Ahmed Hagag Modeling and Simulation 63


Classification of Systems (5/15)

Classification According to the Complexity of the System:

©Ahmed Hagag Modeling and Simulation 64


Classification of Systems (6/15)

Physical systems:
• Physical systems can be defined as systems whose
variables can be measured with physical devices that are
quantitative such as electrical systems, mechanical
systems, computer systems, hydraulic systems, thermal
systems, or a combination of these systems.
• Physical system is a collection of components, in which
each component has its own behavior, used for some
purpose. These systems are relatively less complex.

©Ahmed Hagag Modeling and Simulation 65


Classification of Systems (7/15)

Conceptual systems:
• Conceptual systems are those systems in which all the
measurements are conceptual or imaginary and in
qualitative form as in psychological systems, social
systems, health care systems, and economic systems.
These are complex systems.

Transportation system

©Ahmed Hagag Modeling and Simulation 66


Classification of Systems (8/15)

Esoteric systems:
• Esoteric systems are the systems in which the
measurements are not possible with physical
measuring devices. The complexity of these systems is
of highest order.

©Ahmed Hagag Modeling and Simulation 67


Classification of Systems (9/15)

• Systems will be divided into three classes according to


the degree of interconnection of events.
• Independent
• Cascaded
• Coupled

©Ahmed Hagag Modeling and Simulation 68


Classification of Systems (10/15)

Independent system:
• If the events have no effect upon one another, then the
system is classified as independent.

©Ahmed Hagag Modeling and Simulation 69


Classification of Systems (11/15)

Cascaded system:
• If the effects of the events are unilateral (that is, part A
affects part B, B affects C, C affects D, and not vice
versa), the system is classified as cascaded.

©Ahmed Hagag Modeling and Simulation 70


Classification of Systems (12/15)

Coupled system:
• If the events mutually affect each other, the system is
classified as coupled.

©Ahmed Hagag Modeling and Simulation 71


Classification of Systems (13/15)

• Systems can be classified according to the Nature and


Type of Components.
• Static or dynamic components
• Linear or nonlinear components
• Deterministic or stochastic components
• Continuous-time and discrete-time systems
• Others…

©Ahmed Hagag Modeling and Simulation 72


Classification of Systems (14/15)

Static or dynamic components


• A static simulation model, sometimes called a Monte
Carlo simulation, represents a system at a particular
point in time.
• Dynamic simulation models represent systems as they
change over time. The simulation of a bank from
9:00A.M. to 4:00P.M. is an example of a dynamic
simulation.

©Ahmed Hagag Modeling and Simulation 73


Classification of Systems (15/15)

Deterministic or stochastic components


• Simulation models that contain no random variables are
classified as deterministic. No probabilistic component
in the system.
• A stochastic simulation model has one or more random
variables as inputs. Some components of the system has
a probabilistic behavior (Random variable, event
probability). Example: Queuing systems.

©Ahmed Hagag Modeling and Simulation 74


Steps in a Simulation Study (1/14)

1. Problem formulation
2. Setting of objectives and overall project plan
3. Model conceptualization
4. Data collection
5. Model translation
6. Verified?
7. Validated?
8. Experimental design
9. Production runs and analysis
10. More runs?
11. Documentation and reporting
12. Implementation

©Ahmed Hagag Modeling and Simulation 75


Steps in a Simulation Study (2/14)

©Ahmed Hagag Modeling and Simulation 76


Steps in a Simulation Study (3/14)

1. Problem formulation
Every study should begin with a statement of the problem.
If the statement is provided by the policymakers or those
that have the problem, the analyst must ensure that the
problem being described is clearly understood. If a problem
statement is being developed by the analyst, it is important
that the policymakers understand and agree with the
formulation.

©Ahmed Hagag Modeling and Simulation 77


Steps in a Simulation Study (4/14)

2. Setting of objectives and overall project plan


The objectives indicate the questions to be answered by
simulation. At this point, a determination should be made
concerning whether simulation is the appropriate
methodology for the problem as formulated and the
objectives as stated.

©Ahmed Hagag Modeling and Simulation 78


Steps in a Simulation Study (5/14)

3. Model conceptualization
It is best to start with a simple model and build toward
greater complexity. However, the model complexity need
not exceed that required to accomplish the purposes for
which the model is intended.
It is advisable to involve the model user in model
conceptualization. Involving the model user will both
enhance the quality of the resulting model and increase the
confidence of the model user in the application of the
model.

©Ahmed Hagag Modeling and Simulation 79


Steps in a Simulation Study (6/14)

4. Data collection
There is a constant interplay between the construction of
the model and the collection of the needed input data. As
the complexity of the model changes, the required data
elements can also change. Also, since data collection takes
such a large portion of the total time required to perform a
simulation, it is necessary to begin as early as possible,
usually together with the early stages of model building.

©Ahmed Hagag Modeling and Simulation 80


Steps in a Simulation Study (7/14)

5. Model translation
Most real-world systems result in models that require a
great deal of information storage and computation, so the
model must be entered into a computer-recognizable
format. We use the term program even though it is possible,
in many instances, to accomplish the desired result with
little or no actual coding. The modeler must decide whether
to program the model in a simulation language or to use
special-purpose simulation software.

©Ahmed Hagag Modeling and Simulation 81


Steps in a Simulation Study (8/14)

6. Verified?
Did we build the model right?
Verification pertains to the computer program that has been
prepared for the simulation model. Is the computer
program performing properly? With complex models, it is
difficult, if not impossible, to translate a model successfully
in its entirety without a good deal of debugging; if the input
parameters and logical structure of the model are correctly
represented in the computer, verification has been
completed.

©Ahmed Hagag Modeling and Simulation 82


Steps in a Simulation Study (9/14)

7. Validated?
Did we build the right model?
Validation usually is achieved through the calibration of the
model, an iterative process of comparing the model against
actual system behavior and using the conflict between the
two, and the insights gained, to improve the model. This
process is repeated until model accuracy is judged
acceptable.

©Ahmed Hagag Modeling and Simulation 83


Steps in a Simulation Study (10/14)

8. Experimental design
The alternatives that are to be simulated must be
determined. Often, the decision concerning which
alternatives to simulate will be a function of runs that have
been completed and analyzed. For each system design that
is simulated, decisions need to be made concerning the
length of the initialization period, the length of simulation
runs, and the number of replications to be made of each
run.

©Ahmed Hagag Modeling and Simulation 84


Steps in a Simulation Study (11/14)

9. Production runs and analysis


Production runs and their subsequent analysis, are used to
estimate measures of performance for the system designs
that are being simulated.

©Ahmed Hagag Modeling and Simulation 85


Steps in a Simulation Study (12/14)

10. More runs?


Given the analysis of runs that have been completed, the
analyst determines whether additional runs are needed and
what design those additional experiments should follow.

©Ahmed Hagag Modeling and Simulation 86


Steps in a Simulation Study (13/14)

11. Documentation and reporting (1/3)


There are two types of documentation: program and
progress.
Program documentation is necessary for numerous reasons.
➢ If the program is going to be used again by the same or
different analysts, it could be necessary to understand
how the program operates.
➢ Also, if the program is to be modified by the same or a
different analyst.

©Ahmed Hagag Modeling and Simulation 87


Steps in a Simulation Study (13/14)

11. Documentation and reporting (2/3)


Progress reports provide the important, written history of a
simulation project.
Project reports give a chronology of work done and
decisions made.

©Ahmed Hagag Modeling and Simulation 88


Steps in a Simulation Study (13/14)

11. Documentation and reporting (3/3)


“it is better to work with many intermediate milestones
than with one absolute deadline.”
Possibilities prior to the final report include a model
specification, prototype demonstrations, animations,
training results, intermediate analyses, program
documentation, progress reports, and presentations.

©Ahmed Hagag Modeling and Simulation 89


Steps in a Simulation Study (14/14)

12. Implementation
The success of the implementation phase depends on how
well the previous eleven steps have been performed.

©Ahmed Hagag Modeling and Simulation 90


Dr. Ahmed Hagag
ahagag@fci.bu.edu.eg

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy