Monday, February 22, 2016

University Question Papers

Computer Simulation and Modeling

 

For the Question Papers of UniversityExaminations
From December 2004 to December 2015

Thursday, February 18, 2016

GPSS, WebGPSS and Arena Experiments Video

Computer Simulation and Modeling

 Video created for the experiments:




 

Video Courtesy: Ashish Pardhiye, BEIT 2014-15 Batch
https://www.youtube.com/user/ashishpav
 

Wednesday, February 17, 2016

Chapter 2 – Mathematical & Statistical Models in Simulation

Computer Simulation and Modeling

Chapter 2 – Mathematical & Statistical Models in Simulation
Important Questions from Chapter 2 – Mathematical & Statistical Models in Simulation

1. The probability of a computer chip failure is 0.05. Everyday a random sample of size 14 is taken. What is the probability that 1) at most 3 will fail 2) at least 3 will fail
2. The number of accidents in a year to taxi driver follows poisson distribution with mean equal to 3. Out of 100 taxi drivers, find approximately the number of drivers with 1) no accidents in a year 2) more than 3 accidents in a year
3. Explain Poisson processes with properties.
4. Explain discrete distributions.
5. At service station an automatic carwash facility operates with only one car bay. Cars arriving according to a position distribution, with mean of 12 cars per hour. Car may wait in the facilities parking lawn if service station is busy. Service time has distribution with average 4 min with a standard deviation of 4/3 minutes. Compute the steady state parameters of the system.
6. The inter arrival time as well as service time at government hospital is known to be distributed exponentially. Currently only 1 emergency case can be handle at time .The arrival rate of patient is 4 per hour and service rate 6 per hour. Compute the steady state parameter and probability for 0, 1, 2, 3, 4 or more patients in the hospital.
7. A CNG station has 2 filling machine .The service time follows exponential distribution with the mean of 5 min and autorikshaws arrives for service in a poisson fashion at a rate of 15 per hour. Compute steady state parameters of the system.
8. A two person barber shop has five chairs to accommodate waiting customers. Potential customers are turned away when all five chairs are full. Customers arrive at the rate of 3 per hour & spend an avg. of 15 minutes in the barber chair. Compute the steadystate parameters of the system.
9. What are the characteristics queuing systems? Explain in detail.
10. Explain network of queues.
11. Give the steady state equations for M/G/1 and M/M/1 queue.
12. Give the steady state equations for finite population model M/M/c/N/K queue.
13. Suppose that the life of a lamp, in 1000 hrs, is exponentially distributed with failure rate 1/5. What is the probability that the lamp will last longer than its mean life of 5000 hrs? Also find the probability that the industrial lamp will last between 3500 and 5500 hrs.
14. At sai service station, servicing of a car is performed in three stages. Each stage has exponential distribution of service time with mean service time 20 minutes. Find the probability that the cars servicing will take 50 minutes or less. Also find the expected length of cars servicing.
15. A tool crib has exponential inter-arrival time and service time, and it serves a very large group of mechanics. The mean time between arrivals is 4 minutes. It takes 3 minutes on the average for a tool crib attendant to service a mechanic. The attendant is paid Rs. 10 per hour and the mechanic is paid Rs. 15 per hour. Would it be advisable to have a second tool crib attendant?

Chapter 1 – Introduction to Simulation

Computer Simulation and Modeling

Chapter 1 – Introduction to Simulation
Important Questions from Chapter 1 – Introduction to Simulation



1. Name Entities, Attributes, Activities, Events and State variables for the following systems. Small appliance repair shop, Cafeteria, Grocery store, Laundromat, Automobile assembly line, Fast food restaurant, Taxicab company, Hospital emergency room.
2. Explain steps involved in simulation study with diagram.
3. When Simulation is appropriate & when it is not appropriate?
4. Write a GPSS/H program for single server queue simulation.
5. Grocery Store Example:
Let the arrival distribution be uniformly distributed between 1 to 10 minutes and service time distribution is as follows:
Service time(min) 1 2 3 4 5 6
Probability 0.04 0.20 0.10 0.26 0.35 0.05
Develop the simulation table and analyze the system by simulating arrival and service of 10 customers. Find out Queue statistics.
Random digits for interarrival time and service time are follows:
Customer 1 2 3 4 5 6 7 8 9 10
R. D. for Interarrival Time -- 853 340 205 99 669 142 301 888 444
R. D. for Service time 71 59 12 88 97 66 81 35 29 91
6. ABLE-BAKER CARHOP PROBLEM:
TIME BETWEEN ARRIVAL (MIN) 0 1 2 3 4
PROBABILITY 0.07 0.26 0.31 0.22 0.14
      
ABLE’S SERVICE TIME 2 3 4 5 
PROBABILITY 0.22 0.31 0.32 0.15 
      
BAKER'S SERVICE TIME 3 4 5 6
PROBABILITY 0.34 0.28 0.16 0.22  
DEVELOP THE SIMULATION TABLE AND ANALYSE THE SYSTEM BY SIMULATING ARRIVAL & SERVICE OF 10 CUSTOMERS. RANDOM DIGITS FOR INTERARRIVAL & SERVICE TIME ARE AS FOLLOWS:
   CUSTOMERS  RANDOM DIGITS FOR INTER ARRIVAL RANDOM DIGITS FOR SERVICE
1     -      15 
2     5      28 
3     36      62 
4     41      35 
5     77      7 
6     52      57 
7     63      82 
8     38      92 
9     16      19 
10     32       43 
CALCULATE SERVER UTILIZATION & MAXIMUM QUEUE LENGTH?
FIND OUT AVERAGE WAITING TIME, AVERAGE SERVICE TIME, AVERAGE WAITING TIME OF THOSE WHO WAIT, % BUSY TIME OF ABLE & BAKER & AVERAGE TIME CUSTOMERS SPENDS IN SYSTEM?
7. NEWSPAPER SELLER’S PROBLEM:
PAPER SELLER BUYS PAPER FOR 3 RS EACH & SELLS THEM IN 5 RS EACH.NEWS PAPER NOT SOLD AT THE END OF DAY SOLD AS SCRAP AS 50 PAISE EACH.NEWSPAPER CAN BE PURCHASE IN BUNDLE OF 10.THERE ARE 3 TYPES OF NEWS DAYS GOOD, FAIR, POOR WITH PROBABILITIES 0.35, 0.45, 0.20 RESPECTIVELY. THE DISTRIBUTION OF PAPER DEMANDED ON EACH OF THIS DAY GIVEN BELOW:

DEMAND GOOD FAIR POOR
40 0.03 0.1 0.44
50 0.05 0.18 0.32
60 0.15 0.4 0.14
70 0.2 0.2 0.12
80 0.35 0.08 0.06
90 0.15 0.04 0
100 0.07 0 0
DETERMINE THE OPTIMAL NUMBER OF PAPERS THE NEWSPAPER SELLER SHOULD PURCHASE?
SIMULATE DEMANDS FOR 20 DAYS & RECORD PROFITS FROM THE SELL OF EACH DAY?
RANDOM DIGITS FOR TYPE OF NEWS DAY RANDOM DIGITS FOR DEMAND
  58      93 
  17      63 
  21      31 
  45      19 
  43      91 
  36      75 
  27      84 
  73      37 
  86      23 
  19      2 
  93      53 
  45      96 
  47      33 
  30      86 
  12      16 
  41      7 
  65      64 
  57      94 
  18      55 
  98       13 
8. THERE IS ONLY ONE TELEPHONE IN A PUBLICBOOTH OF THE RAILWAY STATION. THE FOLLOWING TABLES INDICATE THE DISTRIBUTIONOF CALLERS ARRIVAL TIME & DURATION OF CALLS.
SIMULATE FOR 20 ARRIVALS OF CURRENT SYSTEM. IT IS PROPOSED TO ADD ANOTHER TELEPHONE TO BOOTH. JUSTIFY PROPOSED BASED ON THE WAITING TIME OF CALLERS.
TIME BETWEEN ARRIVAL(MIN) 2 3 4 
PROBABILITY  0.2 0.7 0.1 
      
CALL DURATION (MIN) 2 3 4 5
PROBABILITY  0.15 0.6 0.15 0.1
9. Students arrives at the university library counter with interarrival  times distributed as:
Inter-arrival time(min) 1 2 3 4
probability 0.1 0.4 0.3 0.2
        The Time for transaction at counter is distributed as:
Transaction Time(min) 2 3 4 5
probability 0.15 0.50 0.20 0.15
If more than two students are in the queue, an arriving student goes away without joining the queue.
Simulate the system & determine the balking rate of the students.
10. Define the terms used in simulation: Event, Event Notice, Event List, Activity, Delay, Clock.
What is bootstrapping? 
11. Explain the Event Scheduling Algorithm in detail?
12. A small Store has only one check out counter, customers arrives at this counter at random time that are from 1 to 8 minutes apart. Check out that possible value of interarrival time that has some  probability of occurance. Service time vary from 1 to 6 minutes with the following probability .Here a stopping timeof 60 minutes is set. Simulate the system.
13. Dump Truck problem:
Six drump trucks are used to haul coal from the entrance of a small mine to rail road. Fig provides a schematic of the dump truck is loaded by one of the two loaders. After a loading the dump truck immediately moves to scale to be weighted as soon as possible. Both loader and scale have a first served waiting line for trucks. Travel time from a loader to the scale is considered negligible. After being weighed, a truck begin a travel time during which time the truck unloads load then afterwords return to the loader queue. The distribution of  loading time,  weighting time and travel time are given together with the random digit. simulate the system.
 Distribution of loading Time for Dump Truck :
Loading Time(min) 5 10 15
Probability 0.30 0.50 0.20
Distribution of weighting time for Dump truck:
Weighting Time (min) 12 16
Probability 0.70 0.30
Distribution of travel for Dump truck:
Travel  time(min) 40 60 80 100
probability 0.40 0.30 0.20 0.10
14. Demand for widgets follows the probability distribution shown:
Daily Demand 0 1 2 3 4
Probability 0.33  0.25  0.20  0.12  0.10
Stock is examined every 7 days (the plant is in operation every day) and, if the stock level has reached 6 units, or less, an order for 10 widgets is placed. The lead time (days until delivery) is probabilistic and follows the following distribution:
Lead Time (Days) 1 2 3
Probability 0.3 0.5 0.2

When the simulation begins, it is the beginning of the week, 12 widgets are on hand, and no orders have been backordered. (Backordering is allowed.)
Simulate 1 weeks of operation of this system. Analyze the system.
15. In a drive-in restaurant where carhops take orders and bring food to the car. Cars arrive in the manner shown in Table A. There are two carhops - Able and Baker. The distribution of their service times is shown in Tables B & C.

Table A Interarrival Distribution of Cars

Time between Arrivals(Minutes) 1 2 3 4
Probability 0.25 0.40 0.20 0.15

Table B Service Distribution of Able

Service Time (Minutes) 2 3 4 5
Probability 0.30 0.28 0.25 0.17

Table C Service Distribution of Baker

Service Time (Minutes) 3 4 5 6
Probability 0.35 0.25 0.20 0.20

Estimate the system measures of performance for a simulation of 1 hour of operation.
16. The paper seller buys the papers for 33 cents each and sells them for 50 cents each. Newspapers not sold at the end of the day are sold as scrap for 5 cents each. Newspapers can be purchased in bundles of 10. Thus, the paper seller can buy 50, 60, and so on. There are three types of newsdays, good, fair, and poor, with probabilities of 0.35, 0.45, and 0.20, respectively. The distribution of papers demanded on each of these days is given in Table A. The problem is to determine the optimal number of papers the newspaper seller should purchase. Accomplish this by simulating demands for 110 days and record profit from sales each day.

Table A Distribution of Newspapers Demanded
  
Demand Demand Probability Distribution
 Good Fair Poor
40 0.03 0.10 0.44
50 0.05 0.18 0.22
60 0.15 0.40 0.16
70 0.20 0.20 0.12
80 0.35 0.08 0.06
90 0.15 0.04 0.00
100 0.07 0.00 0.00

Table B Random-Digit Assignment for Type of Newsday

 
Type of Newsday Probability
Good 0.35
Fair 0.45
Poor 0.20

Simulate the problem setting a policy of buying a 80 papers each day, demands for papers over the 100-day time period to determine the total profit.
17. The maximum inventory level, M, is 11 units and the review period, N, is 5 days. The distribution of the number of units demanded per day is shown in Table A. In this example, lead time is a random variable, as shown in Table B. Assume that orders are placed at the close of business and are received for inventory at the beginning of business as determined by the lead time.
Table A Random-Digit Assignments for Daily Demand
Daily Demand 0 1 2 3 4
Probability 0.10 0.25 0.35 0.21 0.09
Table B Random-Digit Assignments for Lead Time
Lead Time (Days) 1 2 3
Probability 0.6 0.3 0.1

The problem is to estimate, by simulation, the average ending units in inventory and the number of days when a shortage condition occurs.
18. A large milling machine has three different bearings that fail in service. The cumulative distribution function of the life of each bearing is identical, as shown in Table A. When a bearing fails, the mill stops, a repairperson is called, and a new bearing is installed. The delay time of the repairperson's arriving at the milling machine is also a random variable, with the distribution given in Table B. Downtime for the mill is estimated at Rs. 10 per minute. The direct on-site cost of the repairperson is Rs. 15 per hour. It takes 20 minutes to change one bearing, 30 minutes to change two bearings, and 40 minutes to change three bearings. The bearings cost Rs. 40 each.

Table 2.22 Bearing-Life Distribution

Bearing Life (Hours) 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900
Probability 0.10 0.13 0.25 0.13 0.09 0.12 0.02 0.06 0.05 0.05

Table B Delay-Time Distribution

Lead Time (Minutes) 5 10 15
Probability 0.6 0.3 0.1

A proposal has been made to replace all three bearings whenever a bearing fails. Management needs an evaluation of this proposal.
Represent a simulation of 20,000 hours of operation under the current & proposed method of operation.
19. A firm sells bulk rolls of newsprint. The daily demand is given by the following probability distribution:

Daily Demand (Rolls) 3 4 5 6
Probability 0.20 0.35 0.30 0.15

Lead time is a random variable given by the following distribution:

Lead Time (Days) 1 2 3
Probability 0.36 0.22 0.42

Develop the distribution of lead-time demand based on 20 cycles of lead time.
Prepare a histogram using intervals 0-2, 3-6, 7-10, ………..

Monday, February 15, 2016

Experiment 6

Subject: Computer Simulation and Modeling
Class: BE IT                                                    Semester: VIII
Experiment No. : 06
Aim: Queuing Simulation (The Buffer Overflow Model) using Rockwell Arena.
A.    The Finite Queue Capacity Model
B.     The Infinite Queue capacity Model
Title: The Buffer Overflow Model
Requirements: Rockwell Arena

Queuing Simulation (The Buffer Overflow Model)

Your task in this lab is to simulate and animate a model of a single machine station with finite buffer (queue) capacity using the simulation modeling environment Arena. In this system, parts arrive at a rate of 6 per hour (one every 10 minutes) and have a mean processing time of 9.9 minutes. You will initially simulate the system with an infinite buffer capacity, then add a capacity restriction.

A. Building the model with Finite Queue Capacity Model
1. Launch ARENA from the Start menu, and then open a new model from the File menu.
2. From the Basic Process panel, place a Create module.
Open the module by double-clicking on it, and then specify the following:
Name : Incoming
Time Between Arrivals
Type : Random
Value : 10
Units : minutes
This module simulates an arrival process, in this case a “Poisson process,” with expected time between arrivals of 10 minutes.
3. From the Basic Process panel, place a Process module.
Open the module, and specify the following:
Name : First Machine
Action : Seize Delay Release
Resources : Add Resource Name: Machine Quantity: 1
Delay Type : Constant
Units : minutes
Value : 9.9
This module represents a potentially multiple server, single waiting line queue. In this example it represents the machine and its buffer, which by default has infinite capacity. The processing time is a deterministic 9.9 minutes.
4. From the Basic Process panel, place a Dispose module. Open it, and specify the following:
Record Entity Statistics: toggle this on
This module represents parts departing from the system.
5. If any of the modules are not connected, then use the connection tool to connect the entity flow from Create to Process to Dispose.
6. In the Run:Setup... menu, specify 1 replication of run length 1000 minutes.
7. From the Animate buttons, select Plot (the button looks like a small plot).
For the Expression Add the expression First Machine.WIP from the drop-down menu.
Set Min to 0, Max to 10. Set the # History Points to 500.
Click and drag the plot to size. This module will plot the number of parts in the buffer as a function of time.
8. Run the model by selecting Go from the Run menu or using the VCR buttons.
Watch the animation until it ends.
9. When asked if you want to view the results, select Yes.
Look at the Queues and Resources reports. Here is how the statistics match up to our queueing notation:
Wait Time
wq
Number Busy
o
Number Waiting
â„“q

10. Select End from the Run menu to stop the simulation.







B. Building the model with Infinite Queue capacity Model
Now we will put a capacity on the machine queue and send the overflow parts to a slower machine.
1. From the Basic Process panel, place another Process module near the First Machine.
Open the module, and specify the following:
Name : Overflow Machine
Action : Seize Delay Release
Resources : Add Resource Name: Overflow Quantity: 1
Delay Type : Constant
Units : minutes
Value : 19
This module will model a secondary machine that takes care of the overflow from the first machine, but is much slower.
2. From the Basic Process panel, place a Dispose module. Open it, and specify the following:
Record Entity Statistics : toggle this on
This module represents parts departing from the Overflow Machine.
3. Place a Decide module between Incoming and First Machine. Specify the following:
Name : Queue Full
Type : 2-way By Condition
If : Variable
Named : First Machine.WIP (from drop-down menu)
Is: <
Value : 5
We will use Queue Full to determine whether an arriving entity goes to the First Machine or Overflow Machine by looking ahead at the number in the First Machine queue.
4. Make sure all appropriate connections have been made.

3. What you should do
Run the model, observe the results and look at the statistics.
Turn in a print out of this model and a summary of the key performance measures.
A screen print is acceptable.
Also, prepare a short (couple of paragraphs) summary of your results.
A clear statement, using proper grammar, of findings and interpretation is key.



Here are some Arena distribution functions that might be useful to you in your projects:

Arena function
distribution
BETA(Alpha1,Alpha2)
sample from beta distribution
ERLA(ExpMean,k)
sample from Erlang distribution with k phases and mean k*ExpMean
EXPO(Mean)
sample from exponential distribution
GAMM(a, b)  
sample from gamma distribution
LOGN(Mean,StdDev)
sample from lognormal distribution
NORM(Mean,StdDev)
sample from normal distribution
POIS(Mean)
sample from Poisson distribution
TRIA(Min,Mode,Max)          
sample from triangular distribution
UNIF(Min,Max)
sample from continuous uniform distribution
WEIB(a, b)    
sample from Weibull distribution

C. Exercise for the Students
An office that dispenses automotive license plates has divided its customers into categories to level the office workload. Customers arrive and enter one of three lines based on their residence location. Model this arrival activity as three independent arrival streams using an exponential interarrival distribution with mean 10 minutes for each stream, and an arrival at time 0 for each stream. Each customer type is assigned a single separate clerk to process the application forms and accept payment with a separate queue for each. The service time is UNIF(8,10) minutes for all customer types. After completion of this step, all customers are sent to a single second clerk who checks the forms and issues the plates (this clerk serves all three customer types, who merge into a single first-come, first-serve queue 4 for this clerk). The service time for this activity is UNIF(2.66,3.33) minutes for all customer types.
A consultant has recommended that the office not differentiate between customers at the first state and use a single line with three clerks who can process any customer type.

What you should do
Develop two models, one for the original system and the one for the consultant’s idea. Run both systems for 5,000 minutes each. Observe the average and maximum time in the system for all customer types combined.
Provide a screen print of each system and a copy of the report page that lists average time and maximum time for all customer types.
Give an written analysis (one or two paragraphs) of the system. Use your results from both of the simulations as the basis for your analysis.

Conclusion:-
Thus, we have studied the simulation and statistics of the Buffer overflow condition using Rockwell Arena.

Exercise:-
1. Simulate a model of an ATM machine. Arrivals are Poisson distributed at 8 per hour. ATM service time is exponentially distributed at 4 minutes. People will balk (choose to not use the ATM) if there are more than 3 people in the queue (and being served). 
2. Model for a walk-in clinic. Arrivals are 2 patients per hour in a Poisson distribution. First, a patient must register with a nurse before seeing the doctor. There is only one nurse on duty with service time being exponentially distributed at 3 minutes. Next, a patient must enter a queue to see the doctor. The doctor takes 18 minutes in an exponential distribution to see each patient. Patients arriving will balk (choose to go home / go to another clinic) if there are more than 5 patients in the entire system (i.e. waiting to register with the nurse, being registered by the nurse, waiting to see the doctor, being seen by the doctor). 
3. An office that dispenses automotive license plates has divided its customers into categories to level the office workload.  Customers arrive and enter one of the three lines based on their residence location.  Model this activity as three independent arrival streams using an exponential interarrival distribution with mean 10 minutes for each stream.  Each customer type is assigned a single, separate clerk to process the application forms and accept payment, with a separate queue for each.  The service time is UNIF (8, 10) minutes for all customer types.  After completion of this step, all customers are sent to a single, second clerk who checks the forms and issues the plates.  This clerk serves all three customer types.  The service time for this activity is UNIF (2.66, 3.33) minutes for all customer types. 
Develop a model of this system and run it for 5000 minutes; observe the average and the maximum time in system for all customers. Find the number in & out, utilization of different stations.
4. Parts arrive in a system serially with Random (Expo) 5 minutes. Drilling center is defined TRIA (1,3,6) minutes. Washing center is defined TRIA (1,3,6) minutes. Inspection center is Constant (5) minutes. It decides 80% parts were clean parts and remaining are dirty parts.
Develop a model of this system and run it for 5000 minutes; observe the number of parts seized by each processes and note down the number of clean and dirty parts.
5. Simulate a model of a single machine station with finite buffer (queue) capacity using the simulation modeling environment Arena. In this system, parts arrive at a rate of 6 per hour (one every 10 minutes (random)) and have a mean processing time of 9.9 minutes (constant). Simulate the system with an infinite buffer capacity, and then add a capacity restriction. Plot any function.