Modeling and Simulation-2
Modeling and Simulation-2
1
Static vs Dynamic Simulation Models
• A static simulation model is a representation of a system at a
particular time, or one that may be used to represent a system in
which time simply plays no role; examples of static simulations are
Monte Carlo models.
• On the other hand, a dynamic simulation model represents a system
as it evolves over time, such as a conveyor system in a factory.
2
Deterministic vs Stochastic Simulation Models
• If a simulation model does not contain any probabilistic (i.e., random)
components, it is called deterministic; a complicated (and analytically
intractable) system of differential equations describing a chemical
reaction might be such a model. In deterministic models, the output
is "determined" once the set of input quantities and relationships in
the model have been specified.
• Many systems, however, must be modeled as having at least some
random input components, and these give rise to stochastic
simulation models. For example Most queuing and inventory systems
are modeled stochastically. Stochastic simulation models produce
output that is itself random, and must therefore be treated as only an
estimate of the true characteristics of the model; this is one of the
main disadvantages of simulation .
3
Continuous vs Discrete Simulation Models
• The decision whether to use a discrete or a continuous model for a
particular system depends on the specific objectives of the study. For
example, a model of traffic flow on a freeway would be discrete if the
characteristics and movement of individual cars are important.
Alternatively, if the cars can be treated "in the aggregate," the flow of
traffic can be described by differential equations in a continuous
model.
4
The Basic Steps of a Simulation Study
• The application of simulation involves specific steps in order for the
simulation study to be successful.
• Regardless of the type of problem and the objective of the study, the
process by which the simulation is performed remains constant. The
following briefly describes the basic steps in the simulation process
1. Problem Definition :The initial step involves defining the goals
of the study and determining what needs to be solved. The
problem is further defined through objective observations of the
process to be studied. Care should be taken to determine if
simulation is the appropriate tool for the problem under
investigation.
5
The Basic Steps of a Simulation Study…
2. Project Planning :The tasks for completing the project are broken
down into work packages with a responsible party assigned to each
package. Milestones are indicated for tracking progress.
• This schedule is necessary to determine if sufficient time and
resources are available for completion.
6
The Basic Steps of a Simulation Study…
3. System Definition :This step involves identifying the system
components to be modeled and the performance measures to be
analyzed.
• Often the system is very complex, thus defining the system requires
an experienced simulator who can find the appropriate level of detail
and flexibility.
7
The Basic Steps of a Simulation Study…
4. Model Formulation :Understanding how the actual system behaves
and determining the basic requirements of the model are necessary in
developing the right model.
• Creating a flow chart of how the system operates facilitates the
understanding of what variables are involved and how these variables
interact.
8
The Basic Steps of a Simulation Study…
5. Input Data Collection & Analysis :After formulating the model, the
type of data to collect is determined.
• New data is collected and/or existing data is gathered. Data is fitted to
theoretical distributions. For example, the arrival rate of a specific
part to the manufacturing plant may follow a normal distribution
curve.
9
The Basic Steps of a Simulation Study…
6. Model Translation :The model is translated into programming
language. Choices range from general purpose languages such as
fortran or simulation programs such as Arena.
7.Verification & Validation :Verification is the process of ensuring that
the model behaves as intended, usually by debugging or through
animation. Verification is necessary but not sufficient for validation,
that is a model may be verified but not valid. Validation ensures that no
significant difference exists between the model and the real system and
that the model reflects reality. Validation can be achieved through
statistical analysis. Additionally, face validity may be obtained by having
the model reviewed and supported by an expert.
10
The Basic Steps of a Simulation Study…
8. Experimentation & Analysis :Experimentation involves developing
the alternative model(s), executing the simulation runs, and statistically
comparing the alternative(s) system performance with that of the real
system.
9. Documentation & Implementation :Documentation consists of the
written report and/or presentation. The results and implications of the
study are discussed. The best course of action is identified,
recommended, and justified.
11
Decisions for Simulating
• Completing the required steps of a simulation study establishes the
likelihood of the study's success.
• Although knowing the basic steps in the simulation study is important, it is
equally important to realize that not every problem should be solved using
simulation.
• In the past, simulation required the specialized training of programmers
and analysts dedicated to very large and complex projects. Now, due to the
large number of software available, simulation at times is used
inappropriately by individuals lacking the sufficient training and
experience.
• When simulation is applied inappropriately, the study will not produce
meaningful results. The failure to achieve the desired goals of the
simulation study may induce blaming the simulation approach itself when
in fact the cause of the failure lies in the inappropriate application of
simulation.
12
Decisions for Simulating…
• To recognize if simulation is the correct approach to solving a
particular problem, four items should be evaluated before deciding to
conduct the study:
Type of Problem
Availability of resources
Costs
Availability of data
13
Type of Problem
• If a problem can be solved by common sense or analytically, the use of simulation
is unnecessary.
• Additionally, using algorithms and mathematical equations may be faster and less
expensive than simulating.
• Also, if the problem can be solved by performing direct experiments on the
system to be evaluated, then conducting direct experiments may be more
desirable than simulating.
• To illustrate, recently the UH Transportation Department conducted field studies
on expanding the campus shuttle system. The department used their own
personnel and vehicles to perform the experiment during the weekend. In
contrast, developing the simulation model for the shuttle system took one
student several weeks to complete.
• However, one factor to consider when performing directing experiments is the
degree in which the real system will be disturbed. If a high degree of disruption to
the real system will occur, then another approach may be necessary. The real
system itself plays another factor in deciding to simulate. If the system is too
complex, cannot be defined, and not understandable then simulation will not
produce meaningful results.
14
Availability of Resources
• People and time are the determining resources for conducting a simulation
study.
• An experienced analyst is the most important resource since such a person
has the ability and experience to determine both the model's appropriate
level of detail and how to verify and validate the model.
• Without a trained simulator, the wrong model may be developed which
produces unreliable results.
• Additionally, the allocation of time should not be so limited so as to force
the simulator to take shortcuts in designing the model. The schedule
should allow enough time for the implementation of any necessary
changes and for verification and validation to take place if the results are to
be meaningful.
15
Costs
• Cost considerations should be given for each step in the simulation
process, purchasing simulation software if not already available, and
computer resources.
• Obviously if these costs exceed the potential savings in altering the
current system, then simulation should not be pursued.
16
Availability of Data
• The necessary data should be identified and located, and if the data
does not exist, then the data should be collectible.
• If the data does not exist and cannot be collected, then continuing
with the simulation study will eventually yield unreliable and useless
results. The simulation output cannot be compared to the real
system's performance, which is vital for verifying and validating the
model.
17
Flowchart for basic Steps and Decisions for
Conducting a Simulation Study
18
A life Cycle Model for Simulation
• Life-cycle models serve two primary functions. First, they determine
the order of the stages involved in development and evolution.
• But just as importantly, a life-cycle model establishes the criteria for
transition from one stage to the next.
• A life-cycle model of a simulation study is illustrated in Figure below .
The life-cycle model contains ten phases (designated by ovals), ten
processes (designated by dashed vectors) and thirteen credibility
assessment stages (11 of which are illustrated in the figure using solid
vectors).
19
A life Cycle Model for Simulation…
20
Overview of Available Software
• Logistics systems are becoming increasingly complex and inter-
related.
• Simulation is the only technology available to allow companies to
examine their logical decisions and logistics systems more
productively.
• Simulation becomes necessary when one is designing a new facility or
system, adding new equipment or retrofitting an existing facility. It is
also used to support intuition and experience in decision making.
• Simulation can be carried out using any one of the software’s
available in today’s market. With the various software available today
for simulation today it is imperative that we chose the correct
software.
21
Overview of Available Software…
• Here is a list of available simulation software:
• 20-sim: 20-sim (Controllab products) is a relatively new software used for blocks
modeling system for continuous systems. 20-sim is a modeling and simulation program
that runs under Windows. With 20-sim one can simulate the behavior of dynamic
systems, such as electrical, mechanical and hydraulic systems or any combination of
these systems.
• Arena: This software is used to simulate service, manufacturing, transformation, and
logistics, supply chain and other systems.
• Automod: This software provides true to scale 3-D virtual reality animation, making
simulation models easy to understand. It provides advanced features to allow users to
simulate complex movement, such as kinematics and velocity of equipment such as
robots, machine tools, transfer lines, special machinery and more. Automod provides the
user with a set of expert-based material handling systems that have been developed
with real-world experience in industrial automation. These include conveyors, power &
free, asrs (automated storage and retrieval system) and bridge crane.
22
Overview of Available Software…
• Awesim: Awesim provides a simulation engine focused on the production
of model animations. Animations can be built graphically and the user can
specify controls to build interactive simulations.
• EASY5: EASY5 developed by Boeing Inc., is a software used to model and
simulate dynamic systems containing hydraulic, pneumatic, mechanical,
thermal, electrical and digital sub-systems. A complete set of control
system modeling, analysis and design features is included.
• Idef: This is a process mapping software, which provides easy way to
capture flows and present them as flows diagrams. These can present more
information than traditional flow charts. Process described, constraints
affecting other processes, the role of people and other resource that are
involved in the process can all be incorporated.
23
Overview of Available Software…
• Intrax: This software can support numerous management decisions regarding the
actual process being modeled and simulated. It can be used to perform strategic
(reality checks on strategic vision, synchronous value chain vision), process
improvement (sequence improvements, test productivity improvements, reduce
cycle times), synchronous value chain (dynamic visualization, establish current
constraints) and day-to-day operations (compare operational alternatives, test
the impact of short-term changes).
• Manufacturing engineering: This software performs discrete simulations to
resolve manufacturing problems and design manufacturing solutions. It predicts
throughput, staffing and other performance measures in a broad range of
applications.
• Matlab: This is an integrated technical computing environment that combines
numeric computation, advanced graphics and visualization, and a high level
programming language. Simulink is an interactive tool for modeling, simulating
and analyzing dynamic systems. It allows to build graphical block diagrams,
simulate dynamic systems, evaluate system performance and refine designs.
24
Overview of Available Software…
• Modsim: This software can be used to simulate transportation models like
port simulation model, railroad network simulation and aircraft/air traffic
management model. It is also used for manufacturing simulation.
• Promodel: This software is a simulation-based software for evaluating,
planning or re-designing manufacturing, warehousing and logistics
systems. Typical applications include implementation of lean
manufacturing, cycle-time reduction, equipment investment decisions,
throughput & capacity analysis, identifying and minimizing bottlenecks and
resource allocation.
• Prosolvia: This software brings reality to virtual manufacturing. It allows
the user to view the product in a variety of views and situations. End user
interaction and functional testing in the early concept stages of the product
development process means that important design and manufacturing
decisions can be made much earlier in the process. For the manufacturing
process, staffing training for assembly and maintenance can be developed
much earlier in the pre-production process.
25
Overview of Available Software…
• Quest: This software provides the user with a graphics and visual analysis
capability. It enables accurate modeling of conveyors, buffers, docks, asrs, etc.
• SDI supply chain: This software provides a tool for studying the impact of
changing demand, logistics decisions and production policies on key system
performance measures. It is used to model the dynamics of a complete supply
chain from source to user, along the entire plan, source, and make and deliver
process. It allows users to design, analyze and study areas such as supply chain
capacity issues, bottleneck identification, logistics deployments, resource
deployments, system velocities and reliability. It also models the network of
suppliers, warehouses and shipping channels, which provides materials to a
production plant. Supply chain performance is measured in terms of total product
cost, cash-in-system, time-in-system and reliability.
• Simba: Lanner’s Simulation base application software enables the rapid
development and component build of simulation embedded operational planning
and scheduling applications for supply chains.
26
Overview of Available Software…
• Simplorer: A simulator for industrial design, research projects and
teaching purposes. External code can be embedded. Has its own
language. Allows for hierarchical structures.
• Witness (SDX): This software offers discrete event simulation. This
software has various facilities, which enable easy simulation of
automotive manufacturing. Cycle times, breakdown modes and
timings, setup modes and timings, buffer capacities, buffer dwell
times, machine type etc. can be easily brought out as output together
with routing information. It also includes material flow optimization.
Effective material flow planning minimizes the high cost of moving
materials and products from one machine to another .
27
Simulation language
• A computer simulation language is used to describe the operation of
a simulation on a computer.
• There are two major types of simulation: continuous and discrete
event though more modern languages can handle more complex
combinations.
• Most languages also have a graphical interface and at least a simple
statistic gathering capability for the analysis of the results. An
important part of discrete-event languages is the ability to generate
pseudo-random numbers and variants from different probability
distributions.
28
Introduction JAAMSIM
• JaamSim (Java Animation Modelling and Simulation) is a discrete-event simulation software
package first developed in 2002 as the foundation for simulation applications.
• JaamSim includes
a drag-and-drop graphical user interface,
3D animation, and
a full set of built-in objects for model building
• It is object oriented, extremely fast, and scalable to the largest of applications
• Windows, Linux, and OSX are all supported.
• JaamSim is free open source software, licensed under Apache 2.0.
• The latest version of the software and manuals can be downloaded from the JaamSim website:
www.jaamsim.com.
• The source code is published on GitHub: www.github.com/jaamsim/jaamsim.
29
Introduction GPSS
• GPSS, General Purpose Simulation System, is a language to simulate
discrete systems to see how they perform over time.
• Sample uses include modeling a checkout at a supermarket or how a
manufacturing assembly line will work.
• The programmer defines how transactions are created (eg a shopper),
what resources are available (eg how many checkouts and how long they
take to process) and how transactions move through the system.
• When run, it simulates a clock and processes these transactions, giving
output that shows the performance of the system, eg how long on average
a shopper had to queue for and how busy the checkouts where during a
simulated day.
• GPSS was created by Geoffrey Gordon in around 1961 and was originally
implemented on IBM systems.
30
GPSS - Introduction and Barber Shop Simulation
• As a sample program, let's look at the Barber Shop: First Model from General
Purpose Simulation System/360: Introductory Concepts and Case Studies by
Thomas J. Schriber.
• We are modeling a barber shop with the following qualities:
• The shop contains one barber and one barber's chair, open for eight hours in a
day.
• Customers arrive on average every 18 minutes, with the arrival time varying
between 12 and 24 minutes.
• If the barber is busy, the customer will wait in a queue.
• Once the barber is free, the next customer will have a haircut.
• Each haircut takes between 12 and 18 minutes, with the average being 15
minutes.
• Once the haircut is done, the customer will leave the shop.
31
GPSS - Introduction and Barber Shop Simulation…
• We want to answer these questions:
How utilised is the barber through the day?
How long does the queue get?
On average, how long does a customer have to wait.
• The equivalent GPSS program looks like this:
32
GPSS - Introduction and Barber Shop Simulation…
33
GPSS - Introduction and Barber Shop Simulation…
• The text at the end of each line is a comment; starting a line with *
means the rest of the line is a comment;
• GPSS works in units rather than absolute time, so we shall say that 1
time unit is equal to 1 minute. Programs can be read from top to
bottom: the simulator runs by advancing the clock one time unit and
working out where transactions are in the system.
• The first line, SIMULATE, denotes the start of the code.
34
GPSS - Introduction and Barber Shop Simulation…
• GENERATE 18,6 means generate a transaction - a barber shop
customer - every 18 minutes ± 6 minutes.
• QUEUE 2 defines a queue with ID 2, denoting the queue where
customers will wait.
• SEIZE 3 defines a facility with ID 3. The facility is the barber and this
line means if the barber is free, the next customer occupies the
barber until released.
35
GPSS - Introduction and Barber Shop Simulation…
• DEPART 2 says that the customer leaves the queue when occupying
the barber.
• ADVANCE 15,3 means that transactions in this state only move on
after 15 minutes ± 3 minutes - modeling the time taken for a haircut.
After that
• RELEASE 3 shows that the customer no longer occupies the barber
and
• TERMINATE 0 ends the transaction, showing that the customer has
left the shop.
36
GPSS - Introduction and Barber Shop Simulation…
• That is all that is needed for the basic simulation, but if run like this it
would never stop, as we have not modeled the 8 hour period the
shop is open.
• To do this we generate a new transaction with GENERATE 480, which
means generate a transaction after 480 minutes, ie 8 hours. The next
line, TERMINATE 1, stops the simulation after this transaction is
generated.
37
Running the program using GPSS
• GPSS takes the input file on scards and outputs to sink by default.
• Assuming the simulation defined above is stored in barb1.gpss, this is
how it would look:
• We start off with the program listing, where GPSS denotes which lines
are components of the simulation with a block ID.
• So GENERATE 18,6 is on line 3 but is block 1.
• GPSS shows how many transactions were in each block at the end of
the simulation and in total.
38
Running the program using GPSS…
39
Running the program using GPSS…
• We can see that 27 transactions were generated in block 1, which
means 27 customers entered the shop during the day. Blocks 8 and 9
had 1 transaction, which is expected as this was the timing
transaction. Why does block 5 have one current transaction while all
others are zero? Block 5 is the ADVANCE statement, representing the
haircut, and this means one customer was in the chair at the end of
the simulated day.
• GPSS then prints out statistics on the facility, or the barber in our
simulation:
40
Running the program using GPSS…
41
Running the program using GPSS…
• MAXIMUM CONTENTS means there was never more than one
customer in the queue. Although 27 customers entered the queue, 16
were zero entries - this means they entered and immediately left the
queue, ie the barber was unoccupied when they entered the shop.
For those that did wait in the queue, the average wait was 3.727
minutes; including the zero entries, the average time for all customers
to wait was 1.518 minutes.
• Finally, GPSS prints usage statistics and exits:
42
Running the program using GPSS…
43
Thank you
44