1
MODULE 1: INTRODUCTION TO SIMULATION
Module outline:
• What is Simulation?
• Simulation Terminology
• Components of a System
• Models in Simulation
• Typical applications
• References
WHAT IS SIMULATION?
simulation may be defined as a technique that imitates the operation of a real world
system or processes as it evolves over time. It involves the generation of an artificial
history of the system and observation of that artificial history to obtain information and
draw inferences about the operating characteristics of the real system. Simulation
educates us on how a system operates and how the system might respond to changes. It
enables us to test alternative courses of action to determine their impact on system
performance. Before an alternative is implemented, it must be tested. Although
performing tests with the “real thing” would be ideal. This is seldom practically feasible.
The cost associated with changing/improving a system may be very high both in the
term of capital required to implement the change and losses due to interruption in
production operations and other losses. In most cases experimentation with the
proposed alternative is practically impossible. In addition, as the cost of proposed
changes (alternative solutions) increase, so does the cost of physically experimenting.
As an example, suppose a heavy-duty conveyor is being considered as an alternative to
the existing material handling method (by trucks) for improving productivity and
speeding up the production operations in a factory (seeFigre3). It is obvious that
installing the proposed conveyor on a test basis would probably not be cost effective.
Therefore, experimentation with alternative configurations would be practically
impossible. In stead, experimentation with a representative model of the system would
probably make more sense.
Simulation is a means of experimenting with a detailed model of a real system to
Determine how the system will respond to changes in its environment, structure, and its
underlying assumption [Harrel (1996)]. Management Scientist uses a wide variety of
analytical tools to model, analyze, and solve complex decision problems. These tool
include linear programming, decision analysis, forecasting, Queuing theory and
Alternative 1: Use lift-truck
2
Point A Point B
(Warehouse) (Factory)
Alternative 2: use a conveyor
Point A
(warehouse ) . . . . . . . . Point B
...
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
1 MODULE 1 INTRODUCTION TO SIMULATION Module out.docx
1. 1
MODULE 1: INTRODUCTION TO SIMULATION
Module outline:
• What is Simulation?
• Simulation Terminology
• Components of a System
• Models in Simulation
• Typical applications
• References
WHAT IS SIMULATION?
simulation may be defined as a technique that imitates the
operation of a real world
system or processes as it evolves over time. It involves the
generation of an artificial
history of the system and observation of that artificial history to
obtain information and
2. draw inferences about the operating characteristics of the real
system. Simulation
educates us on how a system operates and how the system might
respond to changes. It
enables us to test alternative courses of action to determine
their impact on system
performance. Before an alternative is implemented, it must be
tested. Although
performing tests with the “real thing” would be ideal. This is
seldom practically feasible.
The cost associated with changing/improving a system may be
very high both in the
term of capital required to implement the change and losses due
to interruption in
production operations and other losses. In most cases
experimentation with the
proposed alternative is practically impossible. In addition, as
the cost of proposed
changes (alternative solutions) increase, so does the cost of
physically experimenting.
As an example, suppose a heavy-duty conveyor is being
considered as an alternative to
the existing material handling method (by trucks) for improving
productivity and
3. speeding up the production operations in a factory (seeFigre3).
It is obvious that
installing the proposed conveyor on a test basis would probably
not be cost effective.
Therefore, experimentation with alternative configurations
would be practically
impossible. In stead, experimentation with a representative
model of the system would
probably make more sense.
Simulation is a means of experimenting with a detailed model
of a real system to
Determine how the system will respond to changes in its
environment, structure, and its
underlying assumption [Harrel (1996)]. Management
Scientist uses a wide variety of
analytical tools to model, analyze, and solve complex decision
problems. These tool
include linear programming, decision analysis, forecasting,
Queuing theory and
Alternative 1: Use lift-truck
4. 2
Point A
Point B
(Warehouse)
(Factory)
Alternative 2: use a conveyor
Point A
(warehouse ) .
. . . . . . . Point B
(Factory)
Figure 3. Material
handling alternatives
Simulation. Many of these tools often require the user to make
some simplifying model
assumptions or they apply only to special types of problems.
For instance, linear
5. programming applies only to well-structured situations that can
be modeled with linear
objective function and linear constraints. In addition, we
assume that all data are known
with certainty. Most real world problems exhibit significant
uncertainty, which
generally is quite difficult to deal with analytically.
For situations in which a problem does not meet the
assumptions required by standard
analytical modeling methods, simulation can be a valuable
approach to modeling and
solving the problem. A recent survey of management science
practitioners show that
simulation and statistical have the highest rate of application
over all other analytical
tools. (1). It should be noted that simulation should not be used
indiscriminately as a
substitute for sound analytical models. Many situations exist
where analytical tools are
the more appropriate. The modelers need to understand the
advantages and
disadvantages of different methods and use them appropriately.
6. SIMULATION TERMINOLOGY
The art and science of simulation uses a unique set of
vocabulary of terms which enables
practitioners communicate specific concepts. We must,
therefore consider the meaning
of these terms before we can begin studying actual simulation
techniques. The following
list contains the key words and concepts that every modeler
should know.
System:
A system as defined here is a group of objects that are joined
together in some regular
interaction or interdependence for the accomplishment of some
purpose. An example is a
production system manufacturing Television units. The
machines, components parts, and
workers operate jointly along the assembly line to produce a
good quality television set.
Similarly, the physical facilities of a hospital, its nursing staffs,
physicians, and
administrative staff would be an example of a health care
system. A jet aircraft is an
7. 3
excellent example of a complex system consisting of numerous
mechanical, electronic,
chemical and human components. A major corporation, together
with its customers and
its suppliers, represent another example of a system containing
complex interacting
components
A system is often affected by changes occurring outside of the
system. Such changes are
said to happen in the system environment (Gordon 1978). In
modeling a system, it is
necessary to determine the boundary between the system and its
environment.
Systems can be categorized as Discrete or continuous. A
discrete system is one in which
the state variables (see below) change only at a discrete set of
points in time. A bank is
an example of a discrete system since the number of customers
in the bank (a state
8. variable), change only when a customer arrives or departs.
Figure 1-1 shows how the
number of customers changes only at discrete points in time.
Number of customers 3 -
Waiting in line or
Figure 1-1
being served 2 -
1 -
Time
In a continuous system the state variables change continuously
over time. An example is
the temperature of a point inside or outside of a steel coil
cooling after heat treatment.
Figure 1-2 shows how state variable (temperature) changes over
time
Temperature (F)
of a point inside
Figure 1-2
a steel coil while
9. cooling
Time
COMPONENTS OF A SYSTEM
Entity. An object of interest in the system (example: products
in an inventory system)
Attribute: A property of an entity (i.e., Weight of the product)
State: The state of a system can be thought of the collection of
all variables required to
describe the system at any point in time, with respect to
the objective of the
study. The state of the system is determined by
assigning a particular value to
each of these variables. In the case of jet aircraft (see
above). The state of the
system would be determined by such factors (state
variables) as the aircraft’s
Speed, altitude, direction of travel, weather condition,
number of passengers
amount of fuel remaining, and operating status. Some of
these factors will
remain constant whereas others will vary with time. As a
10. result, the state of the
system can (and often does) change with time. Note that
some of these factors
are deterministic, whereas others, like weather
conditions, are stochastic.
Event: An instantaneous occurrence that may change the
state of the system. In
the
case of the jet aircraft a sudden change in altitude
constitutes an event
4
Activity: Time-consuming elements of a system whose starting
and ending
coincide with event occurrence.
Decision Variables: Those variables whose values can be
specified by the
decision maker at the beginning of a problem, independent of
other variables.
The value assigned to a decision variable will normally affect
the state of the
system under consideration. We can call state variables as
11. dependent variables
and decision variables as independent variables. For instance, in
simulating
average queue length in a service station, the number of pumps
is a decision
variable while number of people waiting in line is a state
variable. Table 1
of the text list some examples of the simulation
terminology.
Cause–and-effect relationships: all systems are governed by
certain
relationships that describe the interaction between state
variables, decision
variables, and system parameters. These relationships may
represent physical
laws, statistical correlations, economic principles, and etc.
Mathematically, if
we represent sets of state variables, decision variables, and
system parameters
as S, X, and P respectively, for a given system the cause –and-
effect
relationship can be expressed as:
12. MODELS.
A model is used to provide some type of description of an
actual system. Models can
range from exact physical mock-ups of the system to abstract
mathematical
representations. Models of systems may be classified as being
physical, graphical, or
symbolic. Physical models also called iconic models may be to
the same scale as the
system itself. Example of this sort is an aircraft cockpit model
used for pilot training.
Physical models may also be of smaller scale than the system
they represent. An Example
is mock-up of building structures used by architects. Some
scaled-down physical models
of three-dimensional systems may be two-dimensional, such as
scaled templates used in
plant layout design.
Graphical models may be two or three-dimensional
representation of systems. They
may be static, such as drawing on a paper, or dynamic such as
animated films and
13. computer graphics. Graphic representations generally enhance
communication and
understanding of the abstract models.
Symbolic (mathematical) models are abstract representation of
systems and as such
they do not look like the system they represent. In many
applications these models are a
more effective way to represent a system because of their ease
of construction and
manipulation.
Mathematical models are used to describe the behavior of an
actual system. A
simulation model is a particular type of mathematical model of
a system. Such models
are comprised of s set of equations that represent the underlying
cause-and-effect
relationships within the system.
Suppose the following variables** are used to determine
yearly profit for a production
system
P = Gross yearly profit
X = Sales volume (# of units)
14. 5
S = Sales price per unit
F = Total fixed cost per year including taxes
C = Variable cost per unit
Assuming all other factors could be ignored, we can easily
develop an expression
---------------------------------------------------------------------------
---------------------------
** these are Decision variables or system Parameters
(mathematical model) for the gross profit for the business as
follows:
P= (X)[S – C] –F (1)
Equations (1) constitute a mathematical model for the system.
The model is used to
evaluate the state of the system as well as the performance of
the system. Assigning a
set of values X, S, C, and F, the model will provide us with
quantitative measures of
system’s performance and a set of values for the state
variables). In addition, by
15. specifying different set of values for the four variable
(assuming the can take random
values) and evaluating the model repeatedly for each case, we
can determine how the
system responds to changes in decision variables or system
parameters.
For example suppose:
X: May take any value between 200000 and 320000 (random
variable)
S: The company may decide to sell the product for any value
say $4/unit to $5.5/unit
C: variable cost/unit changes from one period to another from
$3.5 to $4.1
T: total fixed cost plus taxes per year is constant or changes
between $300K to 380K
Depending on what random o fixed value each variable assumes,
the value of P, the
performance measure of the system will change. The profit (P)
may take negative or
positive values.
Types of Simulation models
Simulation models may be classified as being static or dynamic.
A static simulation
16. model, sometimes called Monte-Carlo Simulation represents a
system at a particular
point in time. Monte-Carlo is basically a sampling experiment
whose objective is to
estimate the distribution of an outcome variable. For example,
we may be interested in
the distribution of net profit from a business for the coming
year when sales volume, and
variable cost per unit are uncertain. Consider the following
simple case:
Let: P= Gross yearly profit
X= Sales volume (# of units)
S= Sales price per unit
F= Total fixed cost per year including taxes
C= variable cost per unit
Assuming all other factors could be ignored, we can easily
develop an expression
(mathematical model) for the gross profit for the business as
follows:
P= (X)[S – C] –F
We could input many different values for these variables, X and
C, into the model and
17. determine the value of gross profit (P) for each combination of
inputs. If we do this, we
will have created a distribution of the possible values of the
gross profit. The output
values (and the distribution) provide an n indication of the
likelihood of what we might
expect. Monte-Carlo simulation is often used to estimate the
impact of policy changes
and risk involved in decision-making. See more examples of
Monte-Carlo simulation in
Chapter 2
6
Dynamic simulation models represent systems as they change
over time. System
simulation Explicitly models sequences of events that happen
over time. Therefore,
queuing, inventory, manufacturing problems are addressed
with system simulation. As
an example, consider the following simple case. The Dynaco
Company produces a
18. product in a two stages manufacturing system as shown below.
Input M
Output
Machine #1 Machine #2
Each machine may break down randomly. A review of the
historical records on the time
between breakdowns and repair time for each machine, provide
the following
information.
Time Between Breakdowns (TBB)
Repair Time (RT)
In hours
in minutes
Machine #1 Machine #2
Machine #1 Machine #2
TBB Probability TBB Probability RT
Probability RT Probability
5 0.08 5 0.04 10 -20 0.27 10
-20 0.16
19. 10 0.18 10 0.15 20 -30 0.35
20 -30 0.30
15 0.24 15 0.37 30
-40 0.29 30 -40 0.41
20 0.39 20 0.43 40-
50 0.06 40 -50 0.11
25 0.08 25 0.01
50- 0.03 50- 0.02
30 0.02 30 0.00
35 0.01
The Company is interested in estimating the Average production
volume per week, as
well as the average breakdown cost/week (assume they know
repair cost per hour). This
is a dynamic situation since the state of the system could change
from one hour to the
next. However the state of the system will change only when
the normal operation is
interrupted at discrete points in time because of breakdown of
one machine or
simultaneous breakdown of both machines. Therefore, this case
must be analyzed using
20. discrete event (system) simulation. In order to answer these
questions, it is necessary to
simulate the operation of the system for n units of time and
collect data on units
produced, downtimes, and other desired indexes of operations.
In chapter 2 we have
provided a number of examples concerning system simulation.
Simulation models that contain no random variables are
classified as deterministic
models. These models have a known set of inputs, which will
result in a unique set of
outputs. Deterministic arrival would occur at a
shipping/receiving dock if all trucks
arrived at the scheduled arrival time (i.e., one truck every 40
minutes, starting 12:00
noon). A stochastic simulation model has one or more random
variables as inputs that
will result in random outputs. Since the outputs are random,
they can be considered only
an estimate of the true characteristics of a model. For example,
the simulation of a two
stages production system (see above) would involve random
times between breakdowns
21. 7
(random occurrence time) and random repair times. Thus, the
output measures_ the
average production rate per week, the average breakdown cost
per week- must be treated
as statistical estimates of the true values of those measures.
It should be noted that a discrete simulation model is not
always used to model a discrete
system, nor is a continuous simulation model is used to model a
continuous system. In
addition, simulation models may be mixed, both discrete and
continuous. The choice of
whether to use a discrete or continuous (or both) simulation
model is a function of the
characteristics of the system and the objectives of the study.
Because dividing large
batches into smaller elements can closely approximate many
continuous processes,
discrete-event simulation modeling method may be employed
for many (but certainly not
all) simulation studies of continuous processes. This course
primarily emphasizes
22. discrete, dynamic, and stochastic simulation models. It only
provides limited coverage of
the static, continuous and deterministic simulation models.
TYPICAL APPLICATIONS
The application of simulation is vast. The Winter Simulation
Conference (WSC) is an
excellent source o learn more about the latest in Simulation
theory and applications.
Information bout upcoming WSC ca be obtained from
http://www.wintersim.org. During
the early 1980s, a survey was made of major U.S. firms to learn
more about their use of
simulation (Reference #2). One major finding was the
identification of the functional
areas of the company where simulation was being applied. The
results are shown in
Table 1 below. The survey showed that the development of
simulation models has
spread beyond Operations research (or Management Science)
departments. Other
functional area departments and corporate planning departments
use simulation modeling
23. extensively. More recent reports indicate that the use of
simulation continue to grow
rapidly in manufacturing, corporate planning , and finance
areas. Growth in these areas
has been aided by the development of specialized programming
languages for each area.
Another important recent development has been the increasing
use of computer graphics
to generate animated displays of the movement of entities
through the simulated system.
The computer graphics provide greater insight into the
performance of the system for any
given design. They also add credibility to the results of the
simulation study.
There have been numerous applications of simulation in a
variety of contexts. Some of
the areas of application, are listed blow:
Manufacturing and Production
Logistic, Transportation and Distribution
Military Operations
Business Process Simulation
Construction Engineering
24. Health Care
Human Systems
Financial Planning
………………
For a more detailed list of application areas, see Chapter one in
your textbook or visit
WSC site.
http://www.wintersim.org/
8
REFERENCES
1. Banks, J., and J. S. Carson, II, Discrete-Event Simulation,
Prentice-Hall, 2001
2. Christy, DS. P., and H. J. Watson, “ The Application of
Simulation: A
survey of
Industry Practice, ” Interfaces, 13(5): 47-52 October
1983
25.
26. 9
Module 2: Brief Introduction to basics.
Probability. Simulation, and Random numbers
28. Module 2: Brief Introduction to basics.
Probability. Simulation, and Random numbers
• The concept of theoretical and experimental probability
• Simulation, an example
• Random variables
• Assignments
PART I: The concept of Probability:
Probability is the study of chances or the likelihood of an event
happening. Directly or indirectly, it plays a role in all of our
activities.
For Example, we may say that, it will probably rain today,
because most
of the day in August were rainy. However, in Science we need
more
accurate way of measuring probability.
A)-Experimental Probability
One way to find the probability of an event is to conduct an
experiment.
EXAMPLE
A bag contains 10 red marbles, 8 blue marbles and 2 yellow
marbles.
29. Find the experimental probability of getting a blue marble
SOLUTION
11
1)- Take a marble from the bag.
2)- Record the color and return the marble.
3)- Repeat a few times (maybe 10 times).Example:
Trial # 1 2 3 4 5 6 7 8 9 10
Outcome B R R B B R B R
B B
4)- Count the number of times a blue marble was picked
(Suppose it is
6). The experimental probability of getting a blue marble from
the bag
is 6/10 = 3/5 (Discussion: Is this correct?)
B)-Theoretical Probability
We can also find the theoretical probability of an event. The
equation
used to determine the theoretical probability of an event is:
30. Example:
A bag contains 10 red marbles, 8 blue marbles and 2 yellow
marbles.
Find the theoretical probability of getting a blue marble.
Solution
:
There are 8 blue marbles. Therefore, the number of favorable
outcomes
= 8. There are a total of 20 marbles. Therefore, the number of
total
outcomes = 20
Example:
Find the probability of rolling an even number when you roll a
die