Simulation and modeling 2070
Group A
Long Answer Questions.
Attempt
any two questions.
(2x10=20)
AI is thinking...
1. Why do we perform the analysis of simulation output? Explain how do you use simulation run statistics in the output analysis. [4+6]
Example:
Consider a system with Kendall’s notation M/M/1/FIFO (i.e. a single server system in which the inter-arrival time is distributed exponentially ;and service time has an exponential and queue discipline is FIFO) and the objective is to measure the mean waiting time.
In simulation run approach, the mean waiting time is estimated by accumulating the waiting time of n successive entities and then it is divided by n. This measures the sample mean such that:
Whenever a waiting line forms, the waiting time of each entity on the line clearly depends upon the waiting time of its predecessors. Such series of data in which one value affect other values is said to be autocorrelated. The sample mean of autocorrelated data can be shown to approximate a normal distribution as the sample size increases.
A simulation run is started with the system in some initial state, frequently the idle state, in which no service is being given and no entities are waiting. The early arrivals then have a more than normal probability of obtaining service quickly, so a sample mean that includes the early arrivals will be biased.
AI is thinking...
2. Describe the linear congruential method for random number generation. Use the Multiplicative congruential method to generate a sequence of four-three digit random integers, with seed = 117, constant multiplier = 43 and modulus = 1000. [4+6]
The linear congruential method produces a sequence of integers X1, X2, X3,.......between zero and m-1 according to the following recursive relationship:
- The initial value X0 is called the seed;
- a is called the constant multiplier;
- c is the increment
- m is the modulus
The selection of a, c, m and X0 drastically affects the statistical properties such as mean and variance, and the cycle length.
Case 1:
When , the form is called the mixed congruential method.
Case 2:
When c = 0, the form is known as the multiplicative congruential method.
Case 3:
When a = 1, the form is known as additive congruential method.
The random numbers corresponding to each random integer can be obtained as:
Ri = Xi/m, for i = 0, 1, 2, 3, …………..
Now,
Given,
X0 = 117,
α = 43,
m=1000
We have,
For multiplicative congruential method:
Xi+1 = (α Xi ) mod m
The sequence of random integers are calculated as follows:
X0 = 117
X1 = (α X0) mod m = (43*117) mod 1000 = 5031 mod 1000 = 031
X2 = (α X1) mod m = (43*31) mod 1000 = 1333 mod 1000 = 333
X3 = (α X2) mod m = (43*333) mod 1000 = 14319 mod 1000 = 319
X4= (α X3 ) mod m = (43*319) mod 1000 = 13717 mod 1000 = 717
AI is thinking...
3. Consider that a machine tool in a manufacturing shop is turning out parts at the rate of one every 5 minutes. As they are finished, the parts go to an inspector, who takes 4±3 minutes to examine each one and rejects 10% of the parts. Now, develop a block diagram and write the code for simulating the above problem using GPSS, and also explain the function of each block used in the block diagram in detail. [3+3+4]
The block diagram for given problem using GPSS is given below:
A GENERATE block is used to represent the output of the machine by creating one transaction every five units of time. A QUEUE block places the transaction in the queue and SEIZE block allows a transaction to engage a facility if it is available. If more than one inspector is available, the transaction leaves the queue which is denoted by DEPART block and enters into ADVANCE block. An ADVANCE block with a mean of 4 and modifier of 3 is used to represent inspection. The time spent on inspection will therefore be any one of the values 1, 2, 3, 4, 5, 6 or 7, with equal probability given to each value. Upon completion of the inspection, RELEASE block allows a transaction to disengage the facility and transaction go to a TRANSFER block with a selection factor of 0.1, so that 90 % of the parts go to the next location called ACC, to represent accepted parts and 10 % go to another location called REJ to represent rejects. Both locations reached from the TRANSFER block are TERMINATE blocks.
Now,
Code for simulating the given problem using GPSS:
GENERATE 5, 0
QUEUE 1
SEIZE 1
DEPART 1
ADVANCE 4, 3
RELEASE 1
TRANSFER 0.1 ACC REJ
ACC TERMINATE 1
REJ TERMINATE 1
AI is thinking...
Group B
Short answer Questions:
Attempt
any eight questions. (5x8=40)
AI is thinking...
4. Differentiate between analytical models and numerical models.
Analytical Model | Numerical Model |
Analytical model is one which is solved by using the deductive reasoning of mathematical theory. | Numerical model is the one which is solved by applying computational procedures. |
Analytical model provide a direct solution and will result in exact solution if one exists. | Numerical model often require many iterations to get true solution. |
Analytical model is exact and gives exact solution. E.g. value of 1/2 | Numerical model gives the approximate value or solution. E.g. PI=22/7 is approximate value. |
Analytical models are time consuming and sometimes impossible. | Mathematical models are less time consuming and possible for most cases. |
This model is best for designing calculations, suit for checking calculation with certain limitation. | This model is best for checking calculations, practically effective for designing calculation. |
This model is not versatile & flexible . | This model is versatile and flexible. |
Need much work to be developed, but only simple software for application. | Need expensive and complex software and hardware. |
AI is thinking...
5. Define congestion in a queuing system, and describe its major characteristics.
A congestion system is system in which there is a demand for resources for a system, and when the resources become unavailable, those requesting the resources wait for them to become available. The level of congestion in such systems is usually measured by the waiting line, or queue, of resource requests (waiting line or queuing models).
Characteristics/Elements of Queueing System
The key elements of queuing systems are customer and server. Customer refers to anything that arrives at a facility and requires service. E.g. people, machines, trucks, emails. Servers refers to any resource that provides the requested service. E.g. receptionist, tellor, CPU, washing machine etc.
1. Calling Population
The population of potential customers those require service from system is called calling population. It may be finite or infinite. System having large calling population is usually considered as infinite. For e.g. customers at banks, restaurant. And System having less and countable population is usually considered as finite. For e.g. a certain number of machines to be repaired by a service man.
In finite population model, arrival rate depends on the number of customers being served and waiting. But in infinite population model, arrival rate is not affected by the number of customer being served and waiting.
2. Arrival Process
The arrival process for infinite-population models is usually characterized in terms of interarrival times of successive customers. Arrivals may occur at scheduled times or at random times. When at random times, the inter arrival times are usually characterized by a probability distribution and most important model for random arrival is the poisson process. In schedule arrival interarrival time of customers are constant.
3. Service Process
Service process can be measured by the number of customers served per some unit of time or the time taken to complete the service. Once entities have entered to the system they must be served. The service can be provided in single or batch. if it is batch, as in the case of arrival the batch size can be fixed or random. Service time may be of constant duration or of random duration.
4. Queueing Discipline and Queueing Behaviour
Queue discipline refers to the rule that a server uses to choose the next customer from the queue when the server completes the service of the current customer. Common queue disciplines include first-in-first-out (FIFO); last-in-first-out (LIFO); service in random order (SIRO); shortest processing time first (SPT); and service according to priority (PR).
Queue behavior refers to the actions of customers while in a queue waiting for service to begin.
5. Number of Servers:
Servers represent the entity that provides service to the customer. A system may consist of single server or multiple servers.
- A system with multiple servers is able to provide parallel services to the customers.
AI is thinking...
6. Describe the process of model building, verification, and validation in brief.
Verification is concerned with building the model right. It is utilized in comparison of the conceptual model to the computer representation that implements that conception.
Validation is concerned with building the right model. It is utilized to determine that a model is an accurate representation of the real system. It is usually achieved through the calibration of the model.
Fig: Model building, verification and validation
1.The first step in model building consists of observing the real system and the interactions among its various components and collecting data on its behavior.
2.The second step in model building is the construction of a conceptual model – a collection of assumptions on the components and the structure of the system, plus hypotheses on the values of model input parameters, illustrated by the above figure.
3.The third step is the translation of the operational model into a computer recognizable form- the computerized model.
Model building, verification and validation is not a linear process. Will return to each many step while building, verification and validation of model.
AI is thinking...
7. Explain, how do you update the clock time in system simulation.
Clock time is updated based on the following two models:
1. Fixed time-step model
In this the timer simulated by the computer is updated at a fixed time interval. The system is checked to see if any event has taken place during that interval. All the events which take place during the time interval are considered to have occurred simultaneously at the end of the interval.
2. Event-to-event model
It is also known as the next-event model. In this the computer advances the time to the occurrence of the next event. So it shifts from one event to the next event and the system state does not change in between. A track of the current time is kept when something interesting happens to the system.
The flowcharts for both models is shown below.
AI is thinking...
8. What are the different phases that are employed in system simulation study? Explain in brief.
Phases of Simulation Study
I Phase:
- Consists of steps 1 and 2
- It is period of discovery/orientation
- The analyst may have to restart the process if it is not fine-tuned
- Recalibrations and clarifications may occur in this phase or another phase.
II Phase:
- Consists of steps 3,4,5,6 and 7
- A continuing interplay is required among the steps
- Exclusion of model user results in implications during implementation
III Phase:
- Consists of steps 8,9 and 10
- Conceives a thorough plan for experimenting
- Discrete-event stochastic is a statistical experiment
- The output variables are estimates that contain random error and therefore proper statistical analysis is required.
IV Phase:
- Consists of steps 11 and 12
- Successful implementation depends on the involvement of user and every steps successful completion.
AI is thinking...
9. The sequence of numbers 0.54, 0.73, 0.97, 0.10 and 0.67 has been generated. Use the Kolmogorov-Smirnov test α=0.05 to determine if the hypothesis that the numbers are uniformly distributed on the interval [0, 1] can be rejected. (Note that the critical value of D for α=0.05 and μ=5 is 0.565).
Given sequence of number,
0.54, 0.73, 0.97, 0.10 and 0.67
Arranging the given number in ascending order:
0.10, 0.54, 0.67, 0.73, 0.97
Here, N = 5
Calculation table for Kolmogorov-Smirnov test :
i | ||||
1 | 0.10 | 0.2 | 0.1 | 0.10 |
2 | 0.54 | 0.4 | - | 0.34 |
3 | 0.67 | 0.6 | - | 0.27 |
4 | 0.73 | 0.8 | 0.07 | 0.13 |
5 | 0.97 | 1 | 0.03 | 0.17 |
Now, calculating
= 0.1
= 0.34
= 0.34
Given, Critical value = 0.565
Since the computed value, D = 0.34, is less than the tabulated critical value, = 0.565, the hypothesis of no difference between the distribution of the generated numbers and the uniform distribution is not rejected.
AI is thinking...
10. Describe different types of statements, used in CSMP, with suitable examples.
CSMP or Continuous System Modelling Program is an early scientific computer software designed for modelling and solving differential equations numerically. This enables real-world systems to be simulated and tested with a computer.
Types of statements in CSMP
1. Structural statements which defines the model. They consist of FORTARN like statement and functional block designed for operations that frequently occur in a model definition. Structural statement can make use of the operation of addition, subtraction, multiplication, division and exponentiation, using the same notation and rule as are used in FORTRAN. If the model include the equation .Then the following statement would be used
X=6.0*Y/W+(Z-2)**2.0
2. Data statements which assign numerical value to parameters, constant and initial conditions. For example one data statement called INCON can be used to set the initial value of integration function block.
3. Control statements which specify options in the assembly and execution of program and choice of inputs. For e.g. If printed output is required, control statements with PRINT and PRDEL are used followed by the names of variables to form the outputs.
AI is thinking...
11. “To simulate is to experiment”. Justify it.
Explain...
AI is thinking...
12. Name the entities, attributes, activities, events, and state variables for the following system:
a. Cafeteria
b. Inventory
c. Banking
d. A
hospital emergency room
e. Communication
a. Cafeteria
Entities: customer, cashier, waiter
Attributes: hungry, hurried
Activities: take orders, collect payments, dispatch orders
Events: arrival and departure of customer, lack of raw material, faults in the equipment
State variables: number of occupied tables, number of orders per table, number of customers waiting for attention
b. Inventory
Entities: Warehouse
Attributes:Capacity
Activities: Withdrawing
Events: Demand
State variables: Levels of inventory, background
c. Banking
Entities: Customers
Attributes: Checking-account balance
Activities: Making deposits
Events: Arrival, departure
State variables: Number of busy tellers, number of customer waiting
d. A hospital emergency room
Entities: doctor, nurse, patient, equipment
Attributes:safe, expert in his/her science, intelligent, responsible
Activities: vaccinate, feed the patient, administering medicines, heal the wounds
Events: lack of medicines, lack of staff, lack of beds, arrival and departure of patients.
State variables: number of patients, amount of administrated medicines, number of empty beds, number of registerd cases.
e. Communication
Entities: Messages
Attributes: Length, destination
Activities: Transmitting
Events: Arrival at destination
State variables: Number waiting to be transmitted
AI is thinking...
13. Write short note on:
a. System,
boundary and system environment
b. Real time
simulation
a. System, boundary and system environment
- A system is defined as a collection of object join in some regular interaction or interdependency for achievement of a common goal. We can also define a system as organized set of inter-related idea or principles. All system have input, output and feedback and maintain a basic level of equilibrium.
- A system boundary is the line that separate the system and its environment.
- The external components which interact with the system and produce necessary changes are said to constitute the system environment. In modeling systems, it is necessary to decide on the boundary between the system and its environment. This
b. Real time simulation
Real-time simulation refers to a computer model of a physical system that can execute at the same rate as actual "wall clock" time. In other words, the computer model runs at the same rate as the actual physical system.
For example, if a tank takes 10 minutes to fill in the real-world, the simulation would take 10 minutes as well. Real-time simulation occurs commonly in computer gaming, but also is important in the industrial market for operator training and off-line controller tuning.
AI is thinking...