Simulation and modeling 2070

Question Paper Details
Tribhuwan University
Institute of Science and Technology
2070
Bachelor Level / Fifth Semester / Science
Computer Science and Information Technology ( CSC-302 )
( Simulation and modeling )
Full Marks: 60
Pass Marks: 24
Time: 3 hours
Candidates are required to give their answers in their own words as far as practicable.
The figures in the margin indicate full marks.

Group A

Long Answer Questions.

Attempt any two questions.                                                                                      (2x10=20)

Official Answer
AI Generated Answer

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]

10 marks
Details
Official Answer
Output analysis is the analysis of data generated by a simulation run to predict system performance or compare the performance of two or more system designs.
We perform the analysis of simulation output because output data from a simulation exhibits random variability when random number generators are used i.e. two different random number streams will produce two sets of output which (probably) will differ. So, statistical techniques must be used to analyze the results.  It provides the main value-added of the simulation enterprise by trying to understand system behavior and generate predictions for it. It also helps to test different ideas, to learn about the system behavior in new situation, to learn about simulation model and the corresponding simulation system.

Simulation run statistics
In the estimation method, it is assumed that the observations are mutually independent and the distribution from which they are draws is stationary. Unfortunately many statistics of interest in simulation do not meet these conditions. An example of such case is queuing system. Correlation is necessary to analyze such scenario.  In such cases, simulation run statistics method is used.

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 Generated Answer

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]

10 marks
Details
Official Answer

The linear congruential method produces a sequence of integers X1, X2, X3,.......between zero and m-1 according to the following recursive relationship:

\\begin{displaymath}X_{i+1} = (a X_i + c) ~ {\\rm mod} ~ m, ~~~~~~ i = 0, 1, 2, ... \\end{displaymath}

  • 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 $ c \\ne 0$, 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:                                        

          R= Xi/m, for i = 0, 1, 2, 3, …………..

Now,

Given,

    X117

    α = 43,

    m=1000

We have,

For multiplicative congruential method:

        Xi+1 = (α X) mod m

The sequence of random integers are calculated as follows:

X= 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

Therefore,
The sequence of random integers are 117, 031, 333, 319, 717
AI Generated Answer

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]

10 marks
Details
Official Answer

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 Generated Answer

AI is thinking...

Group B

Short answer Questions:

Attempt any eight questions.                                                                                       (5x8=40)

Official Answer
AI Generated Answer

AI is thinking...

4.  Differentiate between analytical models and numerical models.

5 marks
Details
Official Answer
Analytical ModelNumerical 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 Generated Answer

AI is thinking...

5.  Define congestion in a queuing system, and describe its major characteristics.

5 marks
Details
Official Answer

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 Generated Answer

AI is thinking...

6.  Describe the process of model building, verification, and validation in brief.

5 marks
Details
Official Answer

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 Generated Answer

AI is thinking...

7.  Explain, how do you update the clock time in system simulation.

5 marks
Details
Official Answer

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 Generated Answer

AI is thinking...

8.  What are the different phases that are employed in system simulation study? Explain in brief.

5 marks
Details
Official Answer

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 Generated Answer

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).

5 marks
Details
Official Answer

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



10.100.20.10.10
20.540.4-0.34
30.670.6-0.27
40.730.80.070.13
50.9710.030.17

Now, calculating

\\begin{displaymath}D^+ = {\\rm max}_{1 \\le i \\le N} \\left\\{ \\frac{i}{N} - R_{(i)}
\\right\\} \\end{displaymath} = 0.1

\\begin{displaymath}D^- = {\\rm max}_{1 \\le i \\le N} \\left\\{ R_{(i)} -
\\frac{i-1}{N} \\right\\} \\end{displaymath} = 0.34

$D = {\\rm max} (D^+, D^-)$ = 0.34

Given, Critical value $D_\\alpha$ = 0.565

Since the computed value, D = 0.34, is less than the tabulated critical value, $D_\\alpha$ = 0.565, the hypothesis of no difference between the distribution of the generated numbers and the uniform distribution is not rejected.

AI Generated Answer

AI is thinking...

10.  Describe different types of statements, used in CSMP, with suitable examples.

5 marks
Details
Official Answer

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 Generated Answer

AI is thinking...

11.  “To simulate is to experiment”. Justify it.

5 marks
Details
Official Answer

Explain...

AI Generated Answer

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 

5 marks
Details
Official Answer

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 Generated Answer

AI is thinking...

13.  Write short note on:

a.       System, boundary and system environment

b.      Real time simulation

5 marks
Details
Official Answer

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 Generated Answer

AI is thinking...