M&S L2 and 3 - 2023

Download as pdf or txt
Download as pdf or txt
You are on page 1of 45

Simulation & Modeling

The Modeling and Simulation Life


Cycle Process
AHMED EZZAT LABIB
HELWAN UNIVERSITY
How Users Interact with Simulations

 Simulations can be categorized by the way in which


humans interact with them.

 This taxonomy is called (LVC):


1. Live (e.g., a pilot flying a jet).
2. Virtual (e.g., a pilot flying a simulated jet).
3. Constructive simulations
(e.g., a simulated pilot flying a simulated jet)
How Users Interact with Simulations

 In the late 1980s when the LVC taxonomy was created,


there were no examples of the Fourth Block of
interaction.
 However, technology has advanced to the point where
simulated humans are operating real systems.
 For example, Driverless Cars have proved that this type
of interaction, between the real and simulated worlds, is
possible (cybernetics).
The Life Cycle Process

Fig. 2.1 Modeling and simulation process. (Adapted from Benjamin 2006)
The Life Cycle Process –
Establish Purpose and Scope

 Every simulation study begins with a statement of the problem.


(Problem Definition)
 Without an understanding of the objectives to be addressed, it
is likely the study will not be successful
 Problem Source
 If the client provides the problem statement
 (i.e., the problem he wants to answer with the simulation),
 The simulation analyst must insure that it is clearly understood.
The Life Cycle Process –
Establish Purpose and Scope
 If the simulation analyst prepares the problem statement, it is
important that the client understands and agrees with the
problem formulation.
 A good approach is for the simulation analyst:
 to develop a set of assumptions about the real-world system
associated with the problem statement, and make sure that the client
agrees with this problem definition.
 Even if this occurs, it is possible that the problem will need to
be reformulated as the simulation study progresses, due to
new information and requirements.
The Life Cycle Process –
Establish Purpose and Scope
 The Simulation Objectives are the questions to be answered by
the simulation.
 Simulation Plan – The simulation project plan is a document that
includes:
 how much time will be required,
 people that will be used,
 hardware and software requirements if the client wants to run the model
and conduct the analysis,
 stages in the investigation,
 output at each stage,
 cost of the study.
 The size of the project, e.g., a large, complex simulation would
need a very detailed project plan.
Application: Gas Station Service

 To illustrate how the M&S process works, we will use an


example of a full service gas station.
 The station has two islands and four service lanes, as shown
in Fig. 2.2.
 Depending on time of day, one or two attendants serve
customers.
 Significant portions of the customers drive vans and light
trucks, which have larger gas tanks and take more time to
fill.
 Drivers of passenger cars wait longer for service behind the
vans or light trucks, which leads to complaints.
Application: Gas Station Service

Fig. 2.2 Full service gas station. (Birta and Arbez 2010)
Application: Gas Station Service

 The management of a full-service gas station is considering:


 restricting the vans and light trucks to two of the lanes to improve the
flow of vehicles.
 They want to use M&S to answer the question—will customer service
time for passenger cars improve by making this change?
The Life Cycle Process –
Formulate the Conceptual Model

 The conceptual model is an abstraction of the real-world


system under investigation.
 A simulation conceptual model is a living document that
grows from an informal description to a formal description
and serves to communicate between the diverse groups
participating in the simulation’s development.
 It is commonly recommended that you start with a simple
model, adding detail and complexity as needed until you
reach the right representation for your problem.
The Life Cycle Process –
Formulate the Conceptual Model

 Conceptual model may be written using natural language


and contain assumptions about what you are or are not
representing in your model.
 Conceptual model can help clients and simulation analysts
understand the basic outline of the model, on how the real
world is represented in the model.
 It should consist of mathematical and logical relationships
describing the components and the structure of the system.
Application: Gas Station Service
 The first step in the gas station example is to simplify the
problem by making assumptions.
For example, modeling the attendant’s mood or physical
characteristics is not important to answering the question of how
to improve service time for passenger cars.
Therefore, only a simple representation of attendant behavior
might be needed.
Similarly, assumptions about the importance of road geometry,
vehicle dynamics, or weather conditions will also need to be
made.
Application: Gas Station Service

 In addition to these types of assumptions,


 behavioral information is needed to better define model
components.
 For example, the simplified attendant’s behavior might be
represented by three possible states:
 pumping gas, taking payment or idle;
 and vehicle dynamics might be simplified to three
characteristics:
 type of vehicle, size of gas tank, and the location of the gas tank cap
(left vs. right).
Application: Gas Station Service

 The conceptual model is the place where this type of


information is documented; it is a living document and will
evolve over time, as the problem is better understood.
The Life Cycle Process –
Acquire and Analyze Data

 Simulation analysts must decide:


 what data are needed,
 what data are available,
 whether existing data are appropriate for the required purpose,
 and how to gather the data.
 Regardless of the method used to collect the data: There
are several potential sources of data:
 Historical records, observational data, similar systems, operator
estimates, vendor’s claims, designer estimates,; and theoretical
considerations.
Application: Gas Station Service
 In the gas station example, the simulation analyst will need
to collect a variety of data for the model.
 Some of the data will be used as input data and some of it
will be used in the algorithms or equations used inside the
simulation.
 Let us consider traffic flow.
 How many vehicles will come into the gas station?
 Will the number be constant or will it change with the time of day or
the day of the week?
 What percentage of vehicles are passenger cars versus trucks or light
vans?
 Data need to be collected to answer all of these questions.
The Life Cycle Process –
Acquire and Analyze Data

 Some of the data will be used as input and can be varied


during the simulation study (e.g., the number of cars visiting
the gas station)
 and some of the data may be used internal to the simulation
as part of an equation and be considered hardwired (e.g.,
size of the gas tank for each type of vehicle).
 The data and any assumptions made during the collection
process should be documented with the conceptual model.
The Life Cycle Process

Fig. 2.1 Modeling and simulation process. (Adapted from Benjamin 2006)
The Life Cycle Process –
Develop Simulation Model and Program

 The conceptual model is coded into a computer


recognizable form, an Operational Model.
1. Selecting the most appropriate simulation methodology (e.g.,
discrete event, continuous, etc.).
2. Simulation Analyst may selecte an appropriate computer
implementation like programming language (e.g., C, Java, etc.)
or simulation language (e.g., MATLAB®, Simio, etc.).
 Simulations using programming language: customization and faster
execution.
 Simulations using simulation language: many internal capabilities to
facilitate creating a simulation
The Life Cycle Process –
Develop Simulation Model and Program

 A simulation analyst might want to represent traffic flow for


the gas station using different ways.
 Depending on the purpose of the model and questions
the client wants answered.
 For instance, traffic can be represented in a simulation as
a queueing model, as a fluid flow model.
 the simulation implementation is closely related to the
conceptual model.
The Life Cycle Process –
Develop Simulation Model and Program

 The conceptual model should include enough


information about the gas station (i.e., vehicles,
attendant behavior, traffic flow) that the simulation
implementer has all the information they need to
choose the appropriate language and modeling
approaches.
The Life Cycle Process –
Verify and Validate the Model and Simulation

 Verification is the process of determining that a model or


simulation implementation and its associated data
accurately represent:

The developer’s conceptual description and specifications.


Verification = “Did we build the model right?”
The Life Cycle Process –
Verify and Validate the Model and Simulation

 Validation is process of determining the degree to which


a model or simulation and its associated data are an
accurate representation of the real world:

Validation = “Did we build the right model?”


The Life Cycle Process –
Verify and Validate the Model and Simulation

 Actually, the Verification and Validation (V&V) process


occurs at every step of the modeling & simulation
process.
 the simulation analyst will need to :
1. Verify the requirements of the problem stated by the client,
2. Validate the conceptual model,
3. Verify the design and implementation of the simulation, and
4. Validate the results of the simulation.
The Life Cycle Process –
Verify and Validate the Model and Simulation

 Clients and simulation analysts often use different words


for similar concepts, which can lead to a
misunderstanding of requirements.
 Verifying requirements ensures the client and analyst
mutually understand the purpose of the model.
 The simulation analyst will work with the management of
the gas station to verify they understand:
1. The question to be answered,
2. The purpose of the model, and
3. any requirements defined by the client.
The Life Cycle Process –
Verify and Validate the Model and Simulation

 During the development of the conceptual model, the


simulation analyst needs to examine the assumptions,
behavior, and data against the requirements of the
problem.
The Life Cycle Process –
Verify and Validate the Model and Simulation

 Verification → “are the equations being solved correctly?”


 In the verification process, the analyst needs to ensure that
the models have been implemented correctly into the
simulation.
1. In real-life projects, sometimes an independent team is assembled to
go through the software code and examine the results to make sure
the simulation is working.
2. In complex projects, a second simulation might be built by an
independent team to verify the simulation.
Application: Gas Station Service

 The analyst will need to ensure that the logic of the


simulation works and is “bug free.”

 For example, if the simulation were computing average traffic flow


into the gas station, a divide by zero would cause a “runtime error”
and cause the simulation program to crash.
Application: Gas Station Service

 The analyst will need to validate the results of the


simulation. The simulation results for customer service
time of passenger cars should closely match what the
service time is in real life.

 For example, the number of cars entering the gas station is a


function of bad weather. To validate the model, the analyst
needs to gather data on the percentage of traffic reduction
during bad weather, and making sure the model reflects this as
best as possible.
The Life Cycle Process

Fig. 2.1 Modeling and simulation process. (Adapted from Benjamin 2006)
The Life Cycle Process –
Design Experiments

 Design of Experiments (DoE) is a statistical approach to


experimental design that can help minimize the number of
simulation runs needed to understand the behavior of a
system under investigation.
 Defining the experiments for the model should be
considered while developing the Conceptual Model.
 For that reason, the simulation analyst needs to make sure
the right assumptions, behaviors, and data are collected
and included in the simulation in order to support the
necessary experiments.
Application: Gas Station Service

 What are the difference in the results if Sue is working as an


attendant versus Bob?
 The simulation analyst will need to understand the
difference between Sue and Bob’s performance and how
that can be included in the simulation as the service time
of the attendant.
 The simulation analyst will make changes in the simulation
to include that as an input parameter and not hardwired
into the equations for the attendant.
The Life Cycle Process –
Design Experiments

 Defining the sets of experiments early in the simulation


process can prevent many unnecessary hours or
reworking the simulation.
The Life Cycle Process –
Execute Simulation and Analyze Output

 The production runs or the final runs.


 They are used to estimate Measures Of Performance
(MOP) for the scenarios that are being simulated.
 MOPs are a measure of a system’s performance
expressed as some quantifiable features, such as
customer service time in the gas station.
 By analyzing the MOP of the production runs, the
simulation analyst determines if additional runs are
needed and if any additional scenarios need to be
simulated.
The Life Cycle Process –
Execute Simulation and Analyze Output

 A scenario is a description of the initial set of conditions


and timeline of events used to evaluate the behavior of
the system.
 For example, you may define one scenario to look at the
behavior of the gas station when the attendants are attentive or
are not attentive to customers.
The Life Cycle Process –
Execute Simulation and Analyze Output

 To determining if more runs are needed, analyzing the


results could indicate that the simulation needs to be
modified.
 In this case, the simulation analyst should go back to the
beginning of the process to understand whether the
modifications represent a change to the scope and
purpose, or whether it is only a modification to the
simulation implementation.
The Life Cycle Process –
Execute Simulation and Analyze Output

 Once the experiments have been defined, the


simulation analyst will need to decide how many times
to run the simulation for each scenario in order to have
confidence in the results.
The Life Cycle Process –
Execute Simulation and Analyze Output

 In addition to the number of runs, we may discover strange


behavior in the results.
 For instance, on Monday’s customer service time for passenger cars
doubles.
 This would indicate a behavior we would want to
investigate further to understand if it is an error in the
simulation logic or if there is a valid reason for this behavior.
 For instance, everyone waits until Monday to fill up their car for the
week.
The Life Cycle Process –
Configuration Control

 A simulation package for a real-world project can be


made up of thousands to millions of lines of computer
code.
 A small change can lead to large excursions in the
behavior of the overall simulation.
 The “configuration control” is important to keep control
of the package and its contents.
The Life Cycle Process –
Configuration Control

 Once the simulation works and has passed all the


required tests, the configuration control manager
preserves the system in its current configuration and
assigns a configuration control number to it, so at any
point in the future, it is possible to revert back to the last
saved configuration control version, in case future
revisions do not work.
 The simulation analyst must never change a parameter
in the configuration-controlled version of the program
until given the authority and any changes must be
documented.
The Life Cycle Process –
Develop Documentation

 Documentation is a very important part of the simulation


process.
 It defines how the simulation model operates.
 It is important that all the simulation inputs are
documented.
 All the simulation interfaces need to be identified, and
the format of all the input data, and their units or
dimensions, needs to be specified.
 For Example, the documentation needs to specify if an input file
is a regular text file, or in binary format.
The Life Cycle Process –
Develop Documentation

 The result of all the analysis should be reported clearly


and concisely.
 This will enable the client to review:
 the final problem formulation,
 the alternatives that were addressed,
 the criterion by which the alternative systems were compared,
 the results of the experiments, and
 analyst recommendations
Application: Gas Station Service

 There are two types of documents we can envision for the


gas station model.
 One is a final report delivered to the gas station
management documenting the project, includes:
 The requirements and the questions being answered,
 some aspects of the conceptual model that is understandable to
the client,
 a description of the simulation developed,
 the experiments conducted, and
 the simulation results.
Application: Gas Station Service

 The second type of document the simulation analyst will


want to develop is a complete set of documentation on
the project itself, includes:
 all aspects of the conceptual model, design and
implementation of the simulation,
 the verification and validation tests, and
 all of the data collected and analyzed.

You might also like