You are on page 1of 52

Simulation and Modelling

Year: IV Theory: 80+20 References:


Part :I Practical: 25 -System Simulation ( Geoffrey
Gordon)
Course Distribution
Unit Credit Hour
1 6
2 4
3 5
4 5
5 6
6 8
7 4
8 7
Total 45

Compiled by: Er. Ashok G.M. 1


Simulation and Modeling Syllabus
Chapter 1: Concept of simulation [6 hours] Chapter 4: Queuing System (Discrete Chapter 7: Analysis of simulation
• Introduction System Simulation) [5 hours] Output[4 hours]
• The system • Elements of queuing system • Estimation Method
• Continuous and Discrete System • Characteristics of queuing system • Simulation run statistics
• System Simulation • Types of queuing system • Replication of runs
• Queuing Notation • Elimination of initial bias
• Real time simulation
• Measurement of system Performance
• when to use simulation Chapter 8: Simulation Language[7 hours]
• Application of queuing system
• Type of simulation model • Basic Concept of Simulation tool
• Markov Chain
• Step in simulation study • CSSL,GPSS
• Phases in simulation study Chapter 5: Verification and Validation of • Discrete system modeling and simulation
• Advantage of simulation
Simulation Models[6 hours] • Continuous system modeling and simulation
• Model building • Structural data and control statements
• Limitation of simulation Technique
• Verification and validation hybrid simulation
• Areas of application • feedback system : typical application
• Verification of simulation models
Chapter 2: Monte Carlo Method [4 hours] • Calibration and validation of models
• Monte Carlo Method
• Normally Distributed random numbers
Chapter 6: Random Number[8 hours]
• Random Numbers
• Monte Carlo method v/s stochastic simulation
• Random Number Table
Chapter 3: Simulation of Continuous System [5 • Pseudo random number
hours] • Generation of random Numbers
• A pure pursuit problem • Mid square Random Number Generator
• Continuous system models • Qualities of Efficient random number generator
• Analog Computer • Testing number for randomness
• Analog Methods • Uniformity test
• Hybrid Simulation • Chi- square test
• Feedback Simulation • Testing for auto correlation
• Differential and partial differential equation • Poker test
and its engineering purpose

Compiled by: Er. Ashok G.M. 2


CHAPTER- ONE
Concept of Simulation

Compiled by: Er. Ashok G.M. 3


Overview
 Introduction
 The system
 Continuous and Discrete System
 System Simulation
 Real time simulation
 when to use simulation
 Type of simulation model
 Step in simulation study
 Phases in simulation study
 Advantage of simulation
 Limitation of simulation Technique
 Areas of application

Compiled by: Er. Ashok G.M. 4


Concept of Simulation
 A Simulation is the imitation of the operation of a real-world
process or system over time.
 It is the process of imitating the operations of various kinds of real
world facilities or process.
 Simulation involves the generation of an artificial history of an
system and the observations of that history to draw the inferences
concerning the operating characteristics of the real world.
 Simulation is a discipline of designing a model of an actual or
theoretical system, executing the model on digital computer and
analyzing the execution output
 Simulation embodies the principle of “learning by doing”- To learn
about the system we must first build a model of some sort and then
operate the model.
Compiled by: Er. Ashok G.M. 5
• Model: A model is a specified representation of a system at some particular
point in time or space intended to promote understanding of the real system.
• Simulation and Modeling: It is a discipline for developing a level of
understanding of the interaction of the parts of a system and of the system as
a whole. The level of understanding which may be developed through this
discipline is seldom achieved via any other discipline.
• The behavior of a system as it evolves over time is studied by developing a
simulation model.
• The model takes the form of a set of assumptions concerning the operation of
the system. The assumptions are expressed in mathematical relationships,
logical relationships and symbolic relationships between the entities of the
system.
• Once a model is developed and validated, a model can be used to investigate
a wide variety of “ what-if ” questions about the real world system.

Compiled by: Er. Ashok G.M. 6


• Measure of performance: The model solved by mathematical
methods such as differential calculus, probability theory, algebraic
methods has the solution usually consists of one or more numerical
parameters which are called measures of performance.

Compiled by: Er. Ashok G.M. 7


System and System Environment
• A system is understood to be an entity which maintains its existence through
the interaction of its parts.
• A system is defined as an aggregation or assemblage of objects joined in some
regular interaction or interdependence toward the accomplishment of some
purpose.
• In a system there are certain objects, each of which possess properties of
interest. It also consist certain interactions occurring in the system that causes
changes in the system.
• An example is an production system manufacturing automobiles. The
machines, component parts, and workers operates jointly along an assembly
line to produce a high-quality vehicle.

Compiled by: Er. Ashok G.M. 8


Components of a system
• Entity : An entity is an object of interest in a system which have some
functions to make it existence. Example: In the factory system, departments,
orders, parts and products are The entities.
• Attribute: It is defined as a behavior of property of any entity. So any entity
may have one or many attributes. Example: Quantities for each order, type of
part, or number of machines in a Department are attributes of factory system.
• Activity: Any process causing changes in a system is called as an activity.
Example: Manufacturing process of the department.
• State of the System :The state of a system is defined as the collection of
variables necessary to describe a system at any time, relative to the objective
of study. In other words, state of the system mean a description of all the
entities, attributes and activities as they exist at one point in time.

Compiled by: Er. Ashok G.M. 9


Example 1: An aircraft under autopilot control
Consider an aircraft flying under the control of an autopilot. A gyroscope in the
autopilot detects the difference between the actual heading and discard heading .It
sends a signal to move the control surfaces. In response to the control surface
movement the airframe steer towards the desired heading to the desired
destination.

Figure: An aircraft under autopilot control


In the description of the aircraft system, the entities of the system are airframes,
the control surface and the gyroscope. Their attributes are speed, control surface
angle and gyroscope setting. The activities are the driving of control surfaces and
response of airframes to control surface movements.

Compiled by: Er. Ashok G.M. 10


Example 2: A factory System
Consider a factory that make assembles parts for a product. Two major components
of the factory system are the fabrication department that makes the part & the
assembly department that produces the product. A purchasing department
maintains & a shipping department dispatches the finished product. A production
control department receives order & assigns work to the other department.

Figure: A Factory System

In the factory system the entities are the department, orders, parts and products.
Attributes are such factors as the quantities for each order, type of part or number
of machines in a department. The activities are the manufacturing process of the
departments.
Compiled by: Er. Ashok G.M. 11
• Some other common examples

Compiled by: Er. Ashok G.M. 12


System Environment
• A system is often affected by changes occurring outside the system. Such
changes occurring outside the system are said to occur in the system
environment. An important step in modelling system is to decide upon the
boundary between the system and its environment.
• The term endogenous is used to describe activities occurring within the
system.
Example: sports, cultural functions in a university system.
• The term exogenous is used to describe the activities in the environment
that affect the system.
Example: strikes in a university system.
Based on these activities a system may be classified as open or closed
system. A system for which there is no exogenous activity is said to be a
closed system. A system that has exogenous activities is called as an open
system.

Compiled by: Er. Ashok G.M. 13


Deterministic vs. Stochastic Activities
Depending on the manner on which they can be described activities can be
classified as deterministic or stochastic.
• Deterministic : An activity is said to be deterministic where the outcome of
an activity can be described completely in term of its input, Example: AND,
OR, NOT operations.
• Stochastic: An activity is said to be stochastic where the effects of the
activity vary randomly over various possible outcomes. Example: Throwing a
dice or tossing a coin.

Compiled by: Er. Ashok G.M. 14


Event
• An event is defined as an instantaneous occurrence that may
change the state of the system.
• Endogenous System: The term endogenous is used to describe activities and
events occurring within a system.
Example: In the bank study the completion of service of a customer is an endogenous
event.
• Exogenous System: The term exogenous is used to describe activities and
events in the environment that affect the system.
Example: In the bank the arrival of a customer is an exogenous event.

Compiled by: Er. Ashok G.M. 15


Continuous vs. Discrete system
• Continuous system: A • Discrete system: A discrete system is one
continuous system is one in in which the state variable(s) change only
which the state variable(s) at a discrete set of points in time.
change continuously over Example: The bank is an example of a discrete
time. system: The state variable, the number of customers
in the bank, changes only when a customer arrives or
An example is the head of water when the service provided a customer is completed.
behind a dam.

Compiled by: Er. Ashok G.M. 16


System modeling
• It is the processor deriving model of a system which is not only the
substitute of the system but also simplification of the system.
• The model is defined as the body of information about a system
gathered for the purpose of studying the system. The tasks of
deriving a system model are divided into two subtasks.
1. Establishing the model structure
2. Supplying the data
Establishing the model structure
It determines the system boundary and identifies the entities,
attributes and activities of the system.
Supplying the data
The data provides the values that the attributes can have and define
the relationships involved in the activities.

Compiled by: Er. Ashok G.M. 17


Compiled by: Er. Ashok G.M. 18
Compiled by: Er. Ashok G.M. 19
Types of Models

Compiled by: Er. Ashok G.M. 20


Physical Models
• Physical models are based on some analogy between such systems
as mechanical and electrical or electrical or hydraulic. Here the
system attributes are represented by such measurements as voltage
or the position of a shaft. The system activities are reflected in the
physical laws that derive the models.
Example. In hydropower, the height and angle of penstock pipe
defines the speed and amount of water. The amount of water and
force defines the revolution of turbine which further defines the
amount of AC current produced.

Compiled by: Er. Ashok G.M. 21


Mathematical Model
• The mathematical model use symbolic notations and mathematical
equations to represent a system. The system attributes are
represented by variables and the activities that represented by
mathematical functions that interrelate the variables.
• A Simulation model is a particular type of mathematical model of a
system.
Eg. F=m*a, d=r*t
Where, F= force
m= mass
a= acceleration
d= distance travelled
r= rate of travel
t= time of distance travelled

Compiled by: Er. Ashok G.M. 22


Static model & Dynamic Model
• Static models can only show the values that system attributes take
where the system is in balanced. Example: Monte Carlo simulation,
Estimating the probability of winning a game in casino machine,
Estimating the value of n.

• Dynamic models follow the changes over time that result from
system activities. Example includes a model of a bank.

Compiled by: Er. Ashok G.M. 23


Analytical model & Numerical Model
• Analytical Model is the one which is solved using the deductive
reasoning of mathematical theory to solve a model. Example: For
analyzing RLC circuit , we2 use ,linear differential equation where
𝑑𝑦 𝑑𝑦
mathematical formula 2 + 𝑃1 + 𝑃2𝑦 = 𝑄 is used , where P1
𝑑𝑥 𝑑𝑥
and P2 are constant and Q is function of x.
• Numerical Models use computational procedure to solve equations.
Any assignment of numerical values that uses mathematical tables
involves numerical methods. Example: To find an integral value
between certain interval, we may divide the integral in certain parts
and use any numerical methods.

Compiled by: Er.


Compiled by: Er. Ashok
Ashok G.M.
G.M. 24
Static Physical Model
• Static physical models is defined exactly with the scale model.
• In scale model, simple diagrams and exact measurements are
used.
• Static physical models are used as a means of solving equations
with the particular boundary conditions.
Example: In designing aircraft and ships, scale model are used in
wind tunnels and water tanks where the models are designed that
may occur small in shape and size but mechanism , measurement
and the values are fetched actually that can demonstrate a real
system.

Compiled by: Er. Ashok G.M. 25


Dynamic Physical Models
• . Dynamic physical models rely upon an analogy between the
system being studied and some other system of a different nature,
the analogy usually depending upon an underlying similarity in the
forces governing the behavior of the systems.
• To illustrate this type of physical model, consider the two systems
shown in following figures:

Fig. 1: Mechanical System Fig. 2: Electrical System


Compiled by: Er. Ashok G.M. 26
• The Figure 1. represents a mass that is subject to an applied force
F(t) varying with time, a spring whose force is proportional to its
extension or contraction, and a shock absorber that exerts a
damping force proportional to the absorber that exerts a damping
force proportional to the velocity of the mass. The motion of the
system can be represented by the following differential equation.

Where, M = Mass D = Damping factor of shock absorber K = Stiffness constant of spring


x = Displacement of mass F (t) = Applied force

Compiled by: Er. Ashok G.M. 27


• The figure 2 represents an electrical circuit with a resistance “R” and
inductance “L” and capacitance “C” connected in series with a
voltage source that varies in time according to the function E (t). Let
“q” be the charge on the capacitance. This system can be represented
by the following equation-

Where, L = Inductance R = Resistance q = Charge on Capacitance C = Capacitance


E (t) = Function on voltage source that varies with time

Compiled by: Er. Ashok G.M. 28


• By comparing two equation of • Both the systems are analogues
of each other and the
mechanical system and electrical performance of either can be
system which are similar to each studied with the other. It is
other given below similar to modify the electrical
system than to change the
mechanical system.
• Example: Two credit what effect
a change in the shock absorber
will have on the performance of
the car. It will only necessary to
change value of resistance in the
electrical circuit and observe the
effect on the way the voltage
varies.
• Therefore it is simple to design
the electric system which can be
used to study a mechanical
system

Compiled by: Er. Ashok G.M. 29


Static Mathematical Model
• A static mathematical model gives the relationship between the
system attributes when the system is in equilibrium.
• If values of any attributes is changed, gives a new value and new
equilibrium state.
• Thus the static mathematical models may be changed for different
values but doesn’t shows the process.
Example: in marketing a commodity there is a balance between the
supply and demand for the commodity.
• Both factors depend upon price: a simple market mode! Will show
what is the price at which the balance occurs
• Demand for the commodity will be low when the price is high, and
it will increase as the price drops

Compiled by: Er. Ashok G.M. 30


• The relationship between demand, denoted by Q, and price, denoted by
P might be represented by the straight line marked "Demand“ in Figure.
• On the other hand, the supply can be expected to increase as the price
increases, because the suppliers see an opportunity for more revenue.
• Suppose supply, denoted by S, is plotted against price, and the
relationship is the straight line marked "Supply" in Figure. lf conditions
remain stable, the price will settle to the point at which the two lines
cross, because that is where the supply equals the demand.
• Since the relationships have been assumed linear, the complete market
model can be written mathematically as follows:
Q = a – b*p
Or, c + d*p = a – b*p
S = c + d*p
Or, (b + p) d = a - c
S = Q (Equilibrium)
Q = Demand
P = Price
S = Supply
a, b, c, d are constants.
Compiled by: Er. Ashok G.M. 31
Compiled by: Er. Ashok G.M. 32
• For realistic, positive results, the coefficient ‘a’ must also be positive.
Calculate the price at equilibrium stage using following values of the
coefficients: Also calculate the Demand quantity.
• a=600
• b=3000
• c=-100
• d=2000

Compiled by: Er. Ashok G.M. 33


• Dynamic Mathematical model
 It allows the changes of system attributes to be derived as a function
of time.
 This derivation may be made with analytical solution or with a
numerical computation depending upon the complexity of the
model.
• The equation that was derived to describe the behavior of a car
wheel is an example of a dynamic mathematical model; in this case,
an equation that can be solved analytically.
• It is customary to write the equation in the form:

Compiled by: Er. Ashok G.M. 34


• Expressed in this form, solutions can be given in terms of the
variable ωt. Figure below shows how x varies in response to a steady
force applied at time t = 0 as would occur, for instance, if a load were
suddenly placed on the automobile.
• Solutions are shown for several values of ζ , and it can be seen that
when ζ is less than 1, the motion is oscillatory.

Compiled by: Er. Ashok G.M. 35


Compiled by: Er. Ashok G.M. 36
• The factor ζ is called the damping ratio and, when the motion is
oscillatory the frequency of oscillation is determined from the
formula.

• Where f is the number of cycles per second.


• Suppose a case is selected is representing a satisfactory frequency
and damping. The relationship given above between ζ , ω ,M, k and
D show how to select the spring and shock absorber to get that type
of motion For example the condition for the motion to that type of
motion. For example the condition for the motion to occur without
oscillation requires that ζ>=1. It can be deduced from the definition
of that the condition requires that D2>=4MK.

Compiled by: Er. Ashok G.M. 37


System Simulation
• It is defined as the technique of solving problems by the
observations of performance over time of a dynamic model of
system.
• This definition includes the use of dynamic physical models where
the results are derived from physical measurements rather than
numerical computations.

Compiled by: Er. Ashok G.M. 38


Comparison of Simulation and Analytical Method
The main drawback of simulation is:
• It gives specific solution rather than general solution. For example, in the
study of automobiles wheel, an analytical solution gives all the condition that
can cause oscillation. But each execution of a simulation only tells whether a
particular set of condition did or did not cause oscillation. To try to find all
such condition required that the simulation be repeated under many
different condition.
• The step by step nature of the simulation technique means that the amount
of computation increases very rapidly as the amount of detail increases.
Coupled with the need to make many runs, the simulation model result in
extensive amount of computing.
• Many simulation runs may be needed to find a maximum and yet leave
undecided the question of whether it is a local or global maximum.

Compiled by: Er. Ashok G.M. 39


• Drawback of Analytical Technique:
• The range of problem that can be solve mathematically is limited.
• Mathematical technique requires that the model be expressed in some
particular format. For example, in the form of linear algebraic equation and
continuous linear differential equation.
• There are many simple limitation on a system such as physical stock, finite time
delays or non-linear forces which makes a soluble mathematical model
insoluble. But simulation removes this limitation.

Compiled by: Er. Ashok G.M. 40


Real time simulation
• Mathematical model of an engineering system involves understanding physical or
chemical laws, and implies a number of experiments or measurements to derive
the coefficients of the model. This can be particularly time-consuming if the
model is not being simplified by assuming linearity.
• Real time simulation is an approach where an actual device( hardware/ software)
can be used rather than constructing model.
• With this techniques, actual devices which are part if a system, are used in
conjunction with either a digital or hybrid computer , providing a simulation of
the parts of the system that do not exist or that cannot conveniently be used in
an experiment.
• Real time simulation will often involve interaction with a human being, thereby
avoiding the need to design & validate a model of human behavior.
• Real time simulations requires computers that receive signals and respond to it
which are sent from physical devices and transfer output signals at specific points
in time.
• Example- Devices for training pilots by giving them the impression they are at
the controls of an aircraft. Trainings given to astronauts. They are placed in such
an environment where the gravity is 1/6th part of the earth and trained to perform
different activities.

Compiled by: Er. Ashok G.M. 41


When to use Simulation?
1. To study of , and experimentation with the internal interactions of
complex systems or of a subsystem within a complex system.
2. To simulate the informational, organizational and environmental
changes and observe the effect of these alteration.
3. A simulation model can be a great value toward suggesting
improvement in the system under investigation.
4. Simulation can be used as a pedagogical device to reinforce analytical
solution methodological.
5. Simulation can be used experiment with new designs.
6. Simulation can be used to verify analytical solutions.
7. Simulating different capabilities for a machine can help determine the
requirements on it.
8. Simulation models designed for training make learning possible without
cost and disruption of on-the-job instruction.
9. Since Modern systems is so complex, its internal interactions can be
treated only through simulation.

Compiled by: Er. Ashok G.M. 42


When Simulation is not appropriate?
• Based on an article by Banks & Gibson 1997
1. If problem can be solved by common sense.
2. If problem can be solved analytically.
3. If problem can be solved through direct experiment
4. If cost exceeds the savings.
5. If resources or time are not available.
6. In the case if decision time is less than devising a simulation.
7. If no data is available, don’t use simulation.
8. If system behavior is too complex or can’t be defined.

Compiled by: Er. Ashok G.M. 43


2- includes no of people involved, cost, no.of days to finish each
phase of work, result expected
4. Collet data , change data elements as
the complexity of model changes, begin as
early as possible.

- Start with simple 5- Models require information and


model that governs computation, enter into computer
all the expectations recognizable format

- Usually achieved via calibration of model, an iterative


process of comparing the model against actual system
behavior

9- used to estimate measures of


performance for the system designs
that are being simulated

12- depends on how well the previous 11 steps have been


performed. – depends upon how thoroughly the analyst
has involved the ultimate model user during the entire
simulation process
Compiled by: Er. Ashok G.M. 44
Phases in Simulation Study
• This process is divide into four phases
Phase1: Problem Formulation: This includes problem formulation
step. It is period of discovery/ orientation. Analyst may have to restart
the process if it is not fine tuned. Recalibration and classifications
may occur in this phase.
Phase2: Model Building: This includes model construction, data collection,
programming, and validation of model. A continuing interplay is
required among steps.
Phase3: Running the Model: This includes experimental design, simulation
runs and analysis of results. Conceives a thorough plan for
experiment. Output variables are estimates that contain random
errors and therefore proper statistical analysis is required.
Phase4: Implementation: This includes documentation and
implementation. Successful implementation depends on the
involvement of user and every steps successful completion.

Compiled by: Er. Ashok G.M. 45


Advantages of Simulation
• Simulation helps to learn about real system, without having the system at
all. It helps to study the behavior of a system without building it.
• New hardware designs, physical layouts, transportation systems and
various systems can be tested without committing resources for their
acquisition.
• Simulation Models are comparatively flexible and can be modified to
accommodate the changing environment to the real situation.
• Simulation technique is easier to use and can be used for wide range of
situations.
• In systems like nuclear reactors where millions of events take place per
second, simulation can expand the time to required level.
• Results are accurate in general, compared to analytical model.
• Help to find un-expected phenomenon, behavior of the system.
• Easy to perform ``What-If'' analysis.

Compiled by: Er. Ashok G.M. 46


Limitations
• Expensive and difficult to build a simulation model. Model building
requires special training.
• Expensive to conduct simulation.
• Sometimes it is difficult to interpret the simulation results. Since
most simulation outputs are essentially random variables, it may be
hard to determine whether an observation is a result of system
interrelations or randomness.
• Simulation results may be time consuming.

Compiled by: Er. Ashok G.M. 47


Application Areas
• Manufacturing: Design analysis and optimization of production
system, materials management, capacity planning, layout planning,
and performance evaluation, evaluation of process quality.
• Business: Market analysis, prediction of consumer behavior, and
optimization of marketing strategy and logistics, comparative
evaluation of marketing campaigns.
• Military: Testing of alternative combat strategies, air operations, sea
operations, simulated war exercises, practicing ordinance
effectiveness, inventory management.
• Healthcare applications; such as planning of health services,
expected patient density, facilities requirement, hospital staffing ,
estimating the effectiveness of a health care program.

Compiled by: Er. Ashok G.M. 48


Contd..
• Communication Applications: Such as network design, and optimization
evaluating network reliability, manpower planning, sizing of message
buffers.
• Computer Applications: Such as designing hardware configurations and
operating protocols, sharing networking. Client/Server system
architecture
• Economic applications: such as portfolio management, forecasting impact
of Govt. Policies and international market fluctuations on the economy.
Budgeting and forecasting market fluctuations.
• Transportation applications: Design and testing of alternative
transportation policies transportation networks-roads, railways, airways
etc. Evaluation of timetables, traffic planning.
• Environment application: Solid waste management, performance
evaluation of environmental programs, evaluation of pollution control
systems.

Compiled by: Er. Ashok G.M. 49


Contd..
• Biological applications: Such as population genetics and spread of
epidemics.
• Business process Re-engineering: Integrating business process re-
engineering with image –based work flow, using process modeling
and analysis tool..

Compiled by: Er. Ashok G.M. 50


A few more applications

Compiled by: Er. Ashok G.M. 51


Any Queries??

Compiled by: Er. Ashok G.M. 52

You might also like