0% found this document useful (0 votes)
298 views

Simulation Lab Manual PDF

The document provides an overview of simulation concepts and software. It discusses simulation modeling concepts such as systems, models, events, state variables, entities, attributes, resources, activities, delays, and discrete event simulation. It also introduces the GPSS simulation software for creating discrete event simulation programs using block statements like GENERATE, TERMINATE, SEIZE, RELEASE, ADVANCE, GO TO, ARRIVE, DEPART, ENTER, LEAVE, GRAPH, SPLIT, ASSEMBLE and EXECUTE. The document concludes with examples of simulation exercises on a bank operation, robotic work cell, and drill press to model and analyze their performance.

Uploaded by

deepak
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
298 views

Simulation Lab Manual PDF

The document provides an overview of simulation concepts and software. It discusses simulation modeling concepts such as systems, models, events, state variables, entities, attributes, resources, activities, delays, and discrete event simulation. It also introduces the GPSS simulation software for creating discrete event simulation programs using block statements like GENERATE, TERMINATE, SEIZE, RELEASE, ADVANCE, GO TO, ARRIVE, DEPART, ENTER, LEAVE, GRAPH, SPLIT, ASSEMBLE and EXECUTE. The document concludes with examples of simulation exercises on a bank operation, robotic work cell, and drill press to model and analyze their performance.

Uploaded by

deepak
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

LAB MANUAL

Manufacturing Simulation Lab


(MPE 2004)

Department of Production Engineering

Birla Institute of Technology, Mesra


INDEX
1. Introduction

1.1 Simulation and Modeling Concept

1.2 Simulation Software

2. Simulation Exercise (Manual)

Ex. 1 Bank Operation

Ex. 2 Robotic Work cell

Ex. 3 Drill Press Operation

Ex. 4 Grocery Shop

3. Simulation Exercise Using GPSS

Ex. 1 A Food Store

Ex. 2 A Self-Service Cafeteria

Ex. 3 Ambulance Dispatch

Ex. 4 Factory Maintenance

Ex. 5 Ships Un/Loading Cargo at a Harbor

Ex. 6 A Hospital’s Emergency Room

4. Monte Carlo Simulation


1. Introduction
1.1 Simulation and Modeling Concept

Definition of Simulation
The simplest definition of simulation is “mimicry of a real situation”. Simulation is the imitation
of the operation of a real-world process or system over time. Simulation involves the
generation of an artificial history of the system, and the observation of that artificial history to
draw inferences concerning the operating characteristics of the real system that is represented.

Simulation is an indispensable problem-solving methodology for the solution of many real-


world problems. Simulation is used to describe and analyze the behavior of a system, ask "what
if" questions about the real system, and aid in the design of real systems. Both existing and
conceptual systems can be modeled with simulation.

Modeling Concept
There are several concepts underlying simulation. These include system and model, events,
system state variables, entities and attributes, list processing, activities and delays, and finally
the definition of discrete-event simulation.

System, Model and Events: A system is a group of objects that are joined together in some
interaction or interdependence toward the accomplishment of some purpose. A model is a
representation of an actual system for the purpose of studying the system. A system is often
affected by changes occurring outside the system. In modelling systems, there is a primary
concern about the limits or boundaries of the model that supposedly represent the system. It is
not necessary to consider all the details of a system; thus, a model is not only a substitute for a
system, it is also a simplification of the system. However, there should be sufficient detail in
the model to permit valid conclusions to be drawn about the real system.
An event is an occurrence that changes the state of the system. For example, events may
include the arrival of a customer for service, the beginning of service for a customer, and the
completion of a service.

System State Variables: The system state variables are the collection of all information needed
to describe the system to a sufficient level at a given point in time. The determination of system
state variables is a function of the purposes of the investigation, so what may be the system
state variables in one case may not be the same in another case even though the physical
system is the same.
Entities and Attributes: An entity represents an object that requires explicit definition and that
can change the state of the system. An entity can be dynamic in that it "moves" through the
system, or it can be static in that it serves other entities. For example, the customer is a
dynamic entity, whereas the service provider is a static entity.
Attribute is the property of a given entity. An entity may have attributes that pertain to that
entity alone. Thus, attributes should be considered as local values. For example, an attribute of
the customer entity could be the time of arrival.

Resources: A resource is an entity that provides service to dynamic entities. The resource can
serve one or more than one dynamic entity at the same time, i.e., operates as a parallel server.
A dynamic entity can request one or more units of a resource. If denied, the requesting entity
joins a queue, or may be diverted to another resource, or ejected from the system. If permitted
to capture the resource, the entity remains for a time to get served, then releases the resource.

List Processing: Entities are managed by allocating them to resources that provide service, by
attaching them to event notices thereby suspending their activity into the future, or by placing
them into an ordered list. Lists are used to represent queues. There are many queing rules such
as FIFO (first-in first-out), SPT (shortest process time) etc.

Activities and Delays: An activity is a duration of time whose duration is known prior to
commencement of the activity. Thus, when the duration begins, its end can be scheduled. The
duration can be a constant, a random value from a statistical distribution, the result of an
equation, input from a file, or computed based on the event state.
A delay is an indefinite duration that is caused by some combination of system conditions.
When an entity joins a queue for a resource, the time that it will remain in the queue may be
unknown initially since that time may depend on other events that may occur.

Types of Simulation Model

Physical Model vs. Mathematical Model


Physical models are iconic models, and are not typical of the kinds of models that are usually of
interest in systems analysis and computer simulations. Physical models are also referred as
prototypes.
Mathematical models represent a system in terms of logical and quantitative relationships that
are then manipulated and changed to see how the model reacts, and thus how the system
would react.

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.

Continuous Simulation Model vs. Discrete Event Simulation Model


A discrete event simulation model can be defined as one in which the state variables remain
constant over intervals of time and change value only at those points in time at which events
occur. In continuous models, the state variables change continuously with respect to time and
defined by differential or difference equations giving rise to variables that may change
continuously over time.

1.2 Simulation Software

GPSS (General Purpose Simulation System)


GPSS is based on the seminal language of computer simulation, used to create program for
discrete event simulation purpose. GPSS was developed primarily by Geoffrey Gordon at IBM
around 1960. GPSS is designed primarily to deliver quality answers while maintaining a high
level of transparency and controllability. It facilitates the statistical analysis required of any
serious simulation project. In summary, it is a self contained environment with everything from
built-in probability distributions to automatic experiment generation, for screening as well as
for optimization.

A GPSS program is a sequence of block statements. The block statements determine the
sequence of actions in the simulation. Block Statements are inserted into a GPSS model through
different blocks as given below:

GENERATE brings transactions into simulation.


TERMINATE takes transactions out of simulation.
SEIZE assumes ownership of or wait for a Facility Entity. It seizes a facility serving one
transaction at a time.
RELEASE releases a facility entity and is connected with SEIZE.
ADVANCE places a transaction or carries out an activity with a planned time delay.
GO TO makes a transaction jump to a block other than the following one, either
unconditionally or with a certain probability.
ARRIVE indicates the time of arrival of a transaction within the system.
DEPART indicates the time of completion of a transaction and is connected with
ARRIVE.
ENTER occupies a part of storage i.e. a station that can serve several transactions at
the same time.
LEAVE free the storage unit and is connected with ENTER.
GRAPH produces a graph in the simulation results.
SPLIT produces a number of copies of a transaction and sends them to a block with a
named block address
ASSEMBLE destroys copies made in SPLIT block
EXECUTE performs action specified by a different Block.

Top Menu

SPSS
Simulation
Program
Area
Block Menu
2. Simulation Exercise (Manual)
Exercise 1: Bank Operation
Consider the operation of a one-teller bank where customers arrive for service in 1 ± 10
minutes. The customers are served in time 1 ± 6 minutes. Simulate the bank operation until
twenty customers are served assuming customer 1 arrives at time 0, and compute measures of
performance such as the percentage of idle time and the average waiting time per customer.

Exercise 2: Robotic Work Cell


Simulate a robotic work cell to find the cycle time of job and production rate. Assuming a 90%
efficient and 8 hours shift, find the per day production. Also give your suggestion for improving
the system productivity.

Time distribution:
Operation time in MC 1 = [6, 8] minute
Operation time in MC 2 = [12, 15] minute
Robot pick up time = 0.1 minute
Robot release time = 0.1 minute
Machine loading and unloading time = 0.2 minute
Robot movement from I/P Conveyor to MC 1 = from MC 2 to O/P Conveyor = 1 minute
Robot movement from MC 1 to MC 2 = 0.5 minute
Robot movement from I/P Conveyor to O/P Conveyor = 2 minute

Exercise 3: Drill Press


Parts are machined on a drill press. They arrive at a rate of one every 5 ± 3 minute and it takes 3
± 2 minute to machine them. Every 60 ± 60 minutes, a rush job arrives which takes 12 ± 3
minute to complete. The rush job interrupts the present job. When the regular job returns to
the machine, it stays only for its remaining process time. Simulate the mean system response
time for each type of part. Response time is the total time that a part spends in the system.

Exercise 4: Grocery Shop


A small grocery has only one checkout counter. Customers arrive at this checkout counter at
random in the interval of [1, 8] minutes. The service time vary from 1 to 6 minutes with the
probabilities shown. Simulate the problem/system for arrival and service of 20 customers.

Distribution of time between arrivals:


Time between Cumulative Random No.
Probability
intervals (Minute) Probability Assignment
1 0.125 0.125 1-125
2 0.125 0.250 126-250
3 0.125 0.375 251-375
4 0.125 0.500 376-500
5 0.125 0.625 500-625
6 0.125 0.750 625-750
7 0.125 0.875 750-875
8 0.125 1.000 876-1000

Service time distribution:


Service time Cumulative Random No.
Probability
(Minute) Probability Assignment
1 0.1 0.1 0-0.1
2 0.2 0.3 0.11-0.3
3 0.3 0.6 0.31-0.6
4 0.25 0.85 0.61-0.85
5 0.1 0.95 0.86-0.95
6 0.05 1.0 0.96-1.00
3. Simulation Exercise Using GPSS
Exercise 1: A Food Store
Write a GPSS program for the following problem. Customers arrive at a food store with Inter
Arrival Times between 3 and 9 minutes (with all times between 3 and 9 minutes being equally
likely). 25 percent of the customers go to the fish counter, run by one person, who needs
between 17 and 23 minutes to serve a customer (with 20 minutes as the average). Customers
wait on a first-come, first-served basis at this counter. The remaining 75 percent of the
customers go to the meat counter, where two butchers of equal ability serve them, which takes
between 8 and 24 minutes. There is a single waiting line in front of the meat counter. No
customer goes to both the fish and the meat counter. Simulate a day of eight hours to find out
the maximum waiting line in front of the fish counter and how many customers waited more
than 10 minutes, 20 minutes, etc. at the meat counter. Assume that all service stops after
exactly eight hours and all customers then have to leave.

Exercise 2: A Self-Service Cafeteria


People arrive at a self-service cafeteria at the rate of one every 30 ± 20 seconds. Forty percent
go to the sandwich counter where one worker makes a sandwich in 60 ± 30 seconds. The rest
go to the main counter where one server spoons the prepared meal on to a plate in 45 ± 30
seconds. All customers must pay a single cashier, which takes 25 ± 10 seconds. For all
customers, eating takes 20 ± 10 minutes. After eating, 40 percent of the people return to buy a
coffee and pay the cashier for this. Drinking coffee takes 10 ± 2 minutes. Simulate a day of five
hours. The output should include data on average time spent in the cafeteria, maximum
number of people at any time and average waiting time in front of the cashier.

Exercise 3: Ambulance Dispatch


Ambulances are dispatched at a rate of one every 10 ± 7 minutes in a large metropolitan area.
Fifteen percent of the calls are false alarms which require 12 ± 2 minutes to complete. All other
calls can be one of two kinds. The first kind are classified as serious. They constitute 25 percent
of the non-false alarm calls and take 25 ± 5 minutes to complete. The remaining calls take 20 ±
10 minutes to complete. Assume that there are three available ambulances, and that they are
on call at any time. Simulate the system for 500 calls to be completed. Give statistics on how
long serious alarm cases have to wait before an ambulance is on its way.
Exercise 4: Factory Maintenance
In a garment factory there are 50 sewing machines operated eight hours a day, five days a
week. There is a problem in that machines break down on average every 157 hours (with times
between break-downs varying between 132 and 182 hours). If there are fewer than 50
machines available, production is lost, leading to a cost for each machine break-down. The
broken machines are brought to a repair shop, where between 4 and 10 hours are needed to
repair a machine. In order to make up for the time lost owing to the broken machines being
repaired, reserve machines can be brought in. How many repairers are needed in the repair
shop and how many reserve machines ought there to be?

Each alternative would be simulated for three years of 52 weeks of 40 hours. It is desirable to
test the impact of various numbers of repairers and reserve machines on factory and repair
crew utilization so as to achieve balanced resource deployment. (Start with base case of two
repairmen and two reserve machines).

Exercise 5: Ships Un/Loading Cargo at a Harbor


Type A and Type B ships come to a harbor to load and/or unload cargo. The harbor consists of
three berths used only by Type A ships and two berths used only by Type B ships. There are
three tugboats at the harbor. The tugboats are used to tug a ship into the berth prior to
un/loading, and thereafter to tug the ship back out of the berth after un/loading has been
completed. Tugboat services are not needed while a ship is un/loading.

Type A ships require three tugboats for berthing, and two for deberthing. Type B ships, smaller
than Type A ships, only require two tugboats for berthing, and one for deberthing. When a ship
arrives at the harbor, it does these things
1. It requests a berth of the type it uses.
2. After capturing the berth, it requests the tugboats it needs for berthing.
3. After capturing the tugboats, it gets pulled into the berth.
4. It gives up the tugboats.
5. It un/loads cargo.
6. It requests the tugboat(s) it needs for deberthing.
7. It gets pulled out of the berth.
8 It gives up the tugboat(s).
9. It gives up the berth.
10. It leaves the harbor.

Ships obtain tugboats on an "all or nothing at all" basis, The interarrival-time and unloading-
time distributions for Type A ships are 3.2 ± 1.5 hours and 8.4 ± 1.5 hours, respectively. The
respective interarrival-time and unloading-time distributions for Type B ships are 1.5 ± 0.75
hours and 2.1 ± 0.6 hours. Berthing and deberthing times are 30 and 15 minutes, respectively,
independent of ship type.

Build a model for this system, using 1 hour as the base time unit. Gather Queue information by
ship type for ships with respect to the tug-berth wait process. Simulate until a total of 1000
ships have left the harbor. Explore possible ways and means to improve harbor operation
through tug-berth augmentation or leveling.

Exercise 6: A Hospital’s Emergency Room

Patients arrive in a Poisson fashion for treatment at a hospital’s emergency room. Mean patient
interarrival time is 30 minutes. Patients begin by seeing a nurse, who classifies 45% of them as
CW (can wait), and the other 55% as NIA (need immediate attention). There is only one nurse
who classifies patients. Classification time is 10 minutes exponentially distributed.

Two doctors work in the emergency room. NIA patients have higher priority for seeing a doctor
than CW patients. An NIA patient sees a doctor for an average of 45 minutes, exponentially
distributed. Seventy-five percent of these patients then have to wait while lab tests are
performed, whereas the other 25% are finished and can go home immediately.

When needed, lab tests take 30 minutes (exponentially distributed). After completion of lab
tests, NIA patients need to see a doctor again (either doctor), but they have lower priority than
CW patients who haven’t yet seen a doctor. They receive further treatment from the doctor for
15 minutes (exponentially distributed), and are discharged. Note that NIA patients must
(potentially) wait to see a doctor on each of two occasions.

Whereas some NIA patients must see a doctor twice, CW patients only see a doctor once. As
explained above, their priority is lower than that of NIA patients who haven’t yet seen a doctor
at all, but is higher than that of NIA patients waiting to see a doctor for the second time.
Treatment of CW patients averages 30 minutes (exponentially distributed).

Build a model for the situation. Design the model to gather Queue information at each of the
four points of potential waiting in the system. Simulate the model through a 240-hour period,
assuming no changes take place in the system during this period. Discuss the results of the
simulation.
4. Monte Carlo Simulation
The Monte Carlo simulation is a numerical method for statistical simulation which utilizes
sequences of random numbers to perform the simulation. The specific feature of Monte
Carlo simulation is propagation of uncertainties in model inputs into uncertainties in model
outputs. Hence, it is a type of simulation that explicitly and quantitatively represents
uncertainties.

Monte Carlo simulation relies on the process of explicitly representing uncertainties by


specifying inputs as probability distributions. If the inputs describing a system are uncertain,
the prediction of future performance is necessarily uncertain. That is, the result of any analysis
based on inputs represented by probability distributions is itself a probability distribution.

In Monte Carlo simulation, the entire system is simulated a large number (e.g., 1000) of times.
Each simulation is equally likely, referred to as a realization of the system. For each realization,
all of the uncertain parameters are sampled (i.e., a single random value is selected from the
specified distribution describing each parameter). The system is then simulated through time
(given the particular set of input parameters) such that the performance of the system can be
computed. This result is a large number of separate and independent results, each representing
a possible “future” for the system (i.e., one possible path the system may follow through time).
The results of the independent system realizations are assembled into probability distributions
of possible outcomes. As a result, the outputs are not single values, but probability
distributions.

You might also like