0% found this document useful (0 votes)
27 views39 pages

Chapter 01(7)

The document introduces the concepts of modeling and simulation, emphasizing their importance in various systems and applications. It outlines the course learning outcomes, objectives, and key terminology related to simulation modeling, including types of models and the simulation process workflow. Additionally, it discusses the advantages and limitations of simulation, as well as the steps involved in approaching a simulation-based problem.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views39 pages

Chapter 01(7)

The document introduces the concepts of modeling and simulation, emphasizing their importance in various systems and applications. It outlines the course learning outcomes, objectives, and key terminology related to simulation modeling, including types of models and the simulation process workflow. Additionally, it discusses the advantages and limitations of simulation, as well as the steps involved in approaching a simulation-based problem.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 39

‫ُك‬ ‫َل‬

‫الَّس آلُم َع ْي ْم َوَر ْح َمُة الله‬


‫ح‬
‫َّر ٰمِن‬‫ال‬ ‫ِہ‬ ‫الل‬ ‫س‬
‫ِب ِم‬ ‫ه‬‫ُت‬ ‫كآ‬ ‫َر‬‫َب‬ ‫و‬
‫الَّر ِح يم‬
‫ُش روع َاللہ کے پاک نام سے جو بڑا مہر بان نہايت رحم‬
‫واال ہے‬
Modeling and Simulation
SENG-3107

Aqeel –Ur- Rehman


[email protected]
Chapter # 01
Introducing Simulation
Models
Recommended books:
• Modeling and Simulation in Biomedical Engineering: Applications in Cardiorespiratory
Physiology by Willem van Meurs, The McGraw-Hill Companies, 2011; ISBN 10: 0071714456.
• Principles of Modeling and Simulation: A Multidisciplinary Approach by John A. Sokolowski,
John Wiley & Sons, 2009; ISBN: 9780470289433.
• Discrete-Event System Simulation by Jerry Banks, Prentice Hall, 5th Edition, 2009; ISBN-10:
0136062121
• Modeling and Simulation in Medicine and the Life Sciences by Frank C. Hoppensteadt,
Springer, 2nd Edition, 2004; ISBN- 10: 0387950729
• Modeling and Simulation in the Medical and Health Sciences by John A. Sokolowski, John
Wiley & Sons; 1st Edition 2011; ISBN-10: 0470769475
• Modeling and Simulation in
Biomedical Engineering:
Applications in
Cardiorespiratory Physiology
by Willem van Meurs, The
McGraw-Hill Companies, 2011;
ISBN 10: 0071714456.
Text Book :
• Hands-On
Simulation Modeling
with Python
by Giuseppe, Packt
Publishing; 1st edition,
2020; ISBN 10:
1838985093.
Course Learning Outcomes
Virtual Systems and Services
• Understand: The fundamental principles of modeling
and simulation.
• Realize: The role of modeling and simulation in
the different systems
• Identify: Various devices and their functions
• Analyze: Skills necessary to design program
and implement computer systems
• Practice: MATLAB/Python to develop and graph
Lecture Objectives
• Introducing simulation models
• Classifying simulation models
• Approaching a simulation-based problem
• Dynamical systems modeling

Important Note
• In this chapter, an introduction to simulation techniques will be discussed.
In order to deal with the topics at hand, it is necessary that you have a
basic knowledge of algebra and mathematical modeling.
Introducing simulation models
• Simulation “‫ ”نقلی‬uses abstract models built to replicate the characteristics of a
system using statistical observations .
• Operation of a system is simulated using probability distributions to randomly
generate system events.
• It plays a very important role, especially in the design of a stochastic system in the
definition of its operating procedures.
• Benefits:-
• Not working directly on the real system, changing input parameters simulates different
scenarios that allow us to identify most convenient one from various points of view Limiting
the costs.
• Reducing the time while working with alternative policies.
• Simulation allows you to predict what happens to the real system with certain inputs.
Question
• How to get to mounting view on Friday night in the last
amount of time?
• Bike
• Drive
• Train
• Uber
• Fly
Decision making workflow
• Constructing a model is a two-way process:
1. Definition of conceptual models
2. Continuous interaction between the model and reality by
comparison
• The models also allow you to analyze and propose
actions: so that you can modify the current
situation and produce the desired solution.
Comparing Modeling and Simulation
• Differences between modeling and simulation.
• Modeling:
• Represents a physical system.
• A design methodology based on producing a model that
implements a system and represents its functionality.
• Simulation:
• Process of seeing how a model-based system would work
under certain conditions.
• Makes it possible to predict the behavior of a system and the
effects of the variations or modifications that are made on it.
• Important Note:
• Simulation puts the model into operation and allows user to evaluate its behavior:
without physical prototyping, developer can verify the functionality of the modeled
system with the project specifications.
Pros and cons of simulation modeling
• Simulation is a tool that's widely used in a variety of fields, from
operational research to the application industry.
Advantages (pros) Limitations (cons)
• It reproduces behavior of a • It provides hints of system
system in reference to situations behavior.
that cannot be implemented.
• Output analysis could be complex
• It represents real systems, even
complex ones. (also insecure and it might be difficult to
ones) identify best formation.
• It requires limited resources in • Implementation of a simulation
terms of data and resources. could be exhausting and time
• It allows experimentation in consuming.
limited time frames. • Simulation results depend on the
• The models that are obtained are data quality.
easily demonstrable.
Simulation modeling terminology 1/5
• Now, we will analyze the key elements that make
up a model and those that characterize a
simulation process.
• System
• State variables
• Events
• Parameters
• Calibration
• Accuracy
• Sensitivity
• Validation
Simulation modeling terminology 2/5
• System
• Set of elements that interact with each other.
• The main problem linked to this element concerns the system
boundaries, that is; which elements of reality must be
inserted/included in the system that represents it and which are
left/not-included out and the relationships that exist between them.
• State variables
• A system is described in each instant of time by a set of variables.
These are called state variables.
For example:
In weather system, the temperature is a state variable.
In discrete systems, the variables change instantly at precise moments of time that are finite.
In continuous systems, the variables vary in terms of continuity with respect to time.
Simulation modeling terminology 3/5
• Events
• An event is defined as any sudden situation that causes
the value of status variables to change.
• There are both external events and internal events.
For example:
The arrival of a blizzard for a weather system is an event, as it causes the temperature to
drop suddenly.
• Parameters
• Parameters represent essential terms when building a
model.
• They are adjusted during the model simulation process.
• They can be modified iteratively through sensitivity
analysis.
Simulation modeling terminology 4/5
• Calibration
• A process by which parameters of a model are adjusted: in order to adapt
the results to data observed in the best possible way is known as
calibration.
• Calibrating the model: achieve best possible accuracy.
• Calibration requires eliminating: errors in data collection and choosing a
theoretical model that is the best possible description of reality.
• Accuracy
• Accuracy is the degree of correspondence of the simulation result.
• Several indicators are available to measure accuracy:
• Mean Absolute Error (MAE)
• Mean Absolute Percentage error (MAPE)
Simulation modeling terminology 5/5
• Sensitivity
• The sensitivity of a model indicates the degree to
which the model's outputs are affected by changes in
the selected input parameters.
• It tells us which parameters should be considered in a
possible and subsequent analysis of the uncertainty of
the output values.
• Validation
• This verifies the accuracy of proposed model as a tool
to support decisions.
• The validation of a model is based on the various
Classifying simulation models 1/5

• Simulation models can be classified according to


different criteria. Some of them are list bellow
• Comparing static and dynamic models

• Comparing deterministic and stochastic models

• Comparing continuous and discrete models


Classifying simulation models 2/5
1. Comparing static and dynamic models

• Static models: are the representation of a system in an instant of


time, or models of a system in which time variable plays no role.
• For example: of a static simulation is a Monte Carlo model.

• Dynamic models: describe the evolution of the system over time. the
state of the system at time ‘t’ is described by a function x (t).
• For example: in population dynamics, x (t) represents the population present at time ‘t’.
Classifying simulation models 3/5
2. Comparing deterministic and stochastic models
• Deterministic model: is uniquely determined by its initial conditions and
characteristics. Such models do not consider random elements and lend
themselves to be solved with exact mathematical methods that are already
derived.
• For examples: of deterministic systems can be observed in some production and automation systems.

• Stochastic models: it can be evolved by inserting random elements into the


evolution. These are obtained by extracting them from statistical
distributions, with respect to characteristic there is not just one relationship
that fits all.
• A final distinction is based on how the system evolves over time: this is why
we distinguish between continuous and discrete models.
Classifying simulation models 4/5
3. Comparing continuous and discrete models
• Continuous models: represent systems in which the state of
the variables changes continuously as a function of time ‘t’.
• For example: a car moving on a road represents a continuous system since the
variables that identify it, such as position and speed, can change continuously
with respect to time.

• Discrete models: is described by an overlapping sequence of


physical operations, interspersed with inactivity pauses.
These operations begin and end in well- defined instances
(events).
• For example: The system undergoes a change of state when each event
occurs, remaining in the same state throughout the interval between the two
subsequent events. This type of operation is easy to treat with the simulation
approach.
Classifying simulation models 5/5
Important Note
• The stochastic or deterministic, or continuous or discrete, nature of a model
is not its absolute property and depends on the observer's vision of the
system itself. This is determined by the objectives and the method of study,
as well as by the experience of the observer.
Approaching a simulation-based problem
1/9
A numerical simulation process that returns accurate results: it is
crucial to follow series of procedures that partially precede and
partially follow the actual modeling of the system. We can
separate the simulation process workflow into the following
individual steps:
1. Problem analysis
2. Data collection
3. Setting up the simulation model
4. Simulation software selection
5. Verification of the software solution
6. Validation of the simulation model
7. Simulation and analysis of results
Approaching a simulation-based problem
2/9
1. Problem analysis
• To understand the problem by trying to identify the aims of the
study and the essential components.
• Simulation is not simply an optimization technique and therefore
there is no parameter that needs to be maximized or minimized.
• However, there is a series of performance directories whose
dependence on the input variables must be verified. If an
operational version of the system is already available, the work is
simplified as it is enough to observe this system to deduce its
fundamental characteristics.
Approaching a simulation-based problem
2. Data collection
3/9
• A crucial step in the whole process since the quality of
the simulation model depends on the quality of the
input data.
• Once the objective of the study has been identified,
data is collected and subsequently processed.
• Processing collected data is necessary to transform it
into a format that can be used by the model “data
processing”.
Approaching a simulation-based problem
3. Setting up the simulation model 4/9
• A crucial step of the simulation process; To set up a simulation
model, it is necessary to know the probability distributions of the
variables of interest.
• In fact, to generate various representative scenarios of how a system
works, it is essential that a simulation generates random
observations from these distributions.
For example: Managing stocks: the distribution of the product being requested and the time
between an order and the receipt of the goods is necessary. On the other hand, when
managing production systems with machines that can occasionally fail, it will be necessary
to know the distribution of time until a machine fails and the distribution of repair times.
Approaching a simulation-based problem
3. Setting up the simulation model 5/9
• If the system is not already available, it is only possible to
estimate these distributions by deriving them.
• For example: from the observation of already existing systems. If, from the analysis of the
data, it is seen that this form of distribution approximates a standard type distribution, the
standard theoretical distribution can be used by carrying out a statistical test to verify
whether the data can be well represented by that probability distribution.
• If there are no similar systems from which observable data can be
obtained, other sources of information must be used: machine
specifications, instruction manuals for the machines, experimental
studies, and so on.
• Referring to simulating discrete events, constructing a model
involves the steps:[see slide 13]: we will have the simulation
model ready for use.
• At that point, it will be necessary to implement this model in a
Approaching a simulation-based problem
4. Simulation software selection
6/9
Software platform selection for numerical simulation will be made on our knowledge
of programming. Let's see what solutions are available:
• Simulators: These are application-oriented packages for simulation. There are
numerous interactive software packages for simulation without code, such as
MATLAB, COMSOL Multiphysics, Ansys, SolidWorks, Simulink, Arena, AnyLogic, and
SimScale.
• Simulation languages: A more versatile solution is offered by the different
simulation languages available. There are solutions that facilitate the task of the
programmer who, can develop entire models or sub-models with a few lines of
code that would otherwise require much longer drafting times, with a consequent
increase in the probability of error.
• For example: Simulation language is the general-purpose simulation system (GPSS): developed
by IBM in 1965. It is mainly used as a process flow-oriented simulation language and is particularly
Approaching a simulation-based problem
5. Verification of the software solution
7/9
• A check is carried out on the numerical code. Known as debugging, ensuring that the code
correctly follows the desired logical flow, without unexpected blocks or interruptions.
• Although, debugging large-scale simulation code is a difficult task due to virtual
competition and code without blocks.
• The correctness or otherwise of executions depends on time and ‘n’ path ways.
• It is also advisable to have more than one person review the code, as a single programmer may not
be a good critic.
• A track often produces a large volume of output that needs to be checked event by event
for errors. Possible problems may arise, including the following:
• There may be information that hasn't been requested by the analyst.
• Other useful information may be missing, or a certain type of error may not be detectable during a
limited debugging run.
Approaching a simulation-based problem
6. Validation of the simulation model 8/9
• After verification, it is necessary to validate the
simulation. it is necessary to check whether the model
that has been created provides valid results or not.
• A simulation model is always developed for a set of
objectives. A model that's valid for one purpose may not
be valid for another.
• The ability of the model to reproduce the real
functionality the system is established; that is, it is
ensured that the calibrated parameters, relative to the
calibration scenario, can be used to correctly simulate
other system situations.
Approaching a simulation-based problem
7. Simulation and analysis of results 9/9
• A simulation is a process that evolves during its realization and where
the initial results help lead the simulation toward more complex
configurations.
• For example: In fact, it must always be kept in mind that a simulation does
not produce the exact values of the performance measures of a system since
each simulation is a statistical experiment that generates statistical
observations regarding the performance of the system.
• Increasing the duration of the simulation can increase the accuracy of
these estimates.
• A fundamental point: each measurement is accompanied by the
confidence interval, within which it can vary. These results could
immediately highlight a better system configuration than the others,
but more often, more than one candidate configuration will be
identified. In this case, further investigations may be needed to
Dynamical systems modeling 1/4
• A real case of modeling a production process.
• In this way, we will learn how to deal with the elements of the system and
how to translate the production instances into the elements of the model.
• A model is created to study the behavior of a system over time.
• It consists of a set of assumptions about the behavior of the system
being expressed using mathematical logical-symbolic relationships.
• Simple models are resolved analytically, using mathematical methods,
while complex models are numerically simulated on the computer,
where the data is treated as the data of a real system.
Dynamical systems modeling 2/4
• Managing workshop machinery
• A discrete event system is a dynamic system: where states
can be logical or symbolic, rather than numerical.
• A discrete event system is a dynamic system: where behavior
is characterized by the occurrence of rapid events within an
irregular timing sequence.
• Behavior of these systems is described in terms of states and
events\actions.
• For example: Workshop with two machines, A1 and A2, five jobs need to be perform: W1, W2,
W3, W4, and W5. Tables1.2 shows time of work on the machines in minutes:
• A zero indicates that a job does not require that machine.
• Jobs that require two machines must pass through A1 and then through A2.
• Suppose that we decide to carry out the jobs by assigning them to each machine so that when
they become available, the first executable job is started first, in the order from 1 to 5 (FIFO).
If, at the same time, more jobs can be executed on the same machine, we will execute the one
with a minor index first (Shorter index).
Dynamical systems modeling 3/4
• Managing workshop machinery
• The purpose of modeling is to determine the minimum time
needed to complete all the works. The events in which state
changes can occur in the system are as follows:
1. A job becomes available for a machine.
2. A machine starts a job.
3. A machine ends a job.
• Based on these rules and the evaluation times indicated in the previous
table, we can insert the sequence of the jobs, along with the events
scheduled according to the execution times, into a table 1.3:
This table shows the times of the events in sequence, indicating the start and end
of the work associated with the two machines available in the workshop. At the
end of each job, a new job is sent to each machine according to the rules set
previously. system. The example we just discussed is a typical case of a dynamic
system in which time proceeds in steps, in a discrete way.
Dynamical systems modeling 4/4
• Consider a harmonic oscillator with mass ‘m’ resting on a plane
without friction and attached to a wall by a spring, of elastic
constant ‘k’.
• When the horizontal coordinate ‘x’ is zero, the spring is at rest. If the
block moved to the right (x> 0), spring stretched out. Conversely, if the
block Left (x < 0), then the spring is compressed and pushes the block to
the right. In both cases, we can express the component along the x-axis

𝐹𝑥 = − 𝑘 ∗ 𝑥
of the force due to the spring according to the following formula:

• Here, we have the following:


• “𝐹𝑥 “ is the force.
• ‘K’ is the elastic constant.

From the second law of dynamics: ax = − k/𝑚 ∗ 𝑥


• ‘x’ is the horizontal coordinate that indicate the position of the mass ‘m’.

Here, we have the following:


Lecture Recap
• Introducing simulation models
• Classifying simulation models
• Approaching a simulation-based problem
• Dynamical systems modeling
Home work 01
• Lifetime Benefit Analysis of Intelligent Maintenance:
Simulation Modeling Approach and Industrial Case Study H Nordal, I El-
Thalji - Applied Sciences, 2021 - mdpi.com
• Write a report on GPSS and SimScript.
End of Chapter
01

You might also like