Simulation and modeling 2068

Question Paper Details
Tribhuwan University
Institute of Science and Technology
2068
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.  Differentiate between dynamic physical models and static physical models with example.

10 marks
Details
Official Answer
Physical model is the smaller or larger physical copy of an object being modeled. The physical model helps in visualization of the object taken into consideration in an effective way. It is also used to solve equations with the particular boundary conditions.

Static Physical Model

- Static physical model is the physical model which describes relationships that do not change with respect to time.
- Such models only depict the object’s characteristics at any instance of time, considering that the object’s property will not change over time.
- Eg : An architectural model of a house, scale model of a ship and so on.

Dynamic Physical Model

- Dynamic physical model is the physical model which describes the time varying relationships of the object properties.
- Such models describes the characteristics of the object that changes over time.
- It rely upon the analogy between the system being studied and some other system of a different nature, but have similarity on forces that directs the behavior of the both systems.
- Eg: A model of wind tunnel, a model of automobile suspension and so on.

To illustrate this type of physical model, consider the two systems shown in following figures i.e. Figure 1 and Figure 2.

      

Fig1: Mechanical System


Fig2: Electrical system

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 velocity of the mass.It can be shown that the motion of the system is described by the following differential equation.


Where,

x is the distance moved, M is the mass, K is the stiffness of the spring & D is the damping factor of the shock absorber.

Figure 2. represents an electrical circuit with an inductance L, a resistance R, and a capacitance C, connected in series with a voltage source that varies in time according to the function E(t). If q is the charge on the capacitance, it can be shown that the behavior of the circuit is governed by the following differential equation:


Inspection of these two equations shows that they have exactly the same form and that the following equivalences occur between the quantities in the two systems:

a) Displacement x = Charge q
b) Velocity x’ = Current I, q’
c) Force F = Voltage E
d) Mass M = Inductance L
e) Damping Factor D = Resistance R
f) Spring stiffness K = Inverse of Capacitance 1/C
g) Acceleration x’’ = Rate of change of current q’’

The mechanical system and the electrical system are analogs of each other, and the performance of either can be studied with the other.

AI Generated Answer

AI is thinking...

2.  Define the queuing system. Explain the elements of queuing system with example.

10 marks
Details
Official Answer

The line where the entities or customer wait is generally known as queue. The combination of all entities in system being served and being waiting for service will be called as queueing system.

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.

Markov Service process: A Markov service process is a special service process in which entities are processed one at a time in FCFS order and service times are independent and exponential. Aswith the case of Markov arrivals, a Markov service process is memoryless, which means that the expected time until an entity is finished remains constant regardless of how long it has been in service.

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

  • First in first out :This principle states that customers are served one at a time and that the customer that has been waiting the longest is served first.
  • Last in first out : This principle also serves customers one at a time, however the customer with the shortest waiting time will be served first. 
  • Service in random order: A customer is picked up randomly from the waiting queue for service.
  • Shortest job first: The next job to be served is the one with the smallest size (shortest service time).
  • Priority: Customers with high priority are served first. 

Queue behavior refers to the actions of customers while in a queue waiting for service to begin. Different queue behaviours are:

  • Balk/Balking: It means leaving the queue when the customer see the line is too long.
  • Renege/Reneging: Leave after being in the line when they see that the line is moving too slowly.
  • Jockey/Jockeying: Move from one to a shortest line. 

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

3.  What is the main objective of gap test? Explain gap test algorithm with example.

10 marks
Details
Official Answer

The gap test is used to determine the significance of the interval between recurrence of the same digit. A gap of length x occurs between the recurrence of  some digit. It Counts the number of digits that appear between repetitions of a particular digit and then uses the Kolmogorov-Smirnov test to compare with the expected number of gaps. 

The probability of a particular gap length can be determined by a Bernoulli trail.

\\begin{displaymath}P ({\\rm gap ~of} ~ n) = P(x \\ne 3) P(x \\ne 3) ... P(x \\ne 3) P (x = 3) \\end{displaymath}

If we are only concerned with digits between 0 and 9, then

\\begin{displaymath}P ({\\rm gap ~of} ~ n) = 0.9^{n} 0.1 \\end{displaymath}

The theoretical frequency distribution for randomly ordered digits is given by

\\begin{displaymath}P (gap \\le x) = F(x) = 0.1 \\sum_{n=0}^x (0.9)^n = 1 - 0.9^{x+1} \\end{displaymath}

Steps involved in this test are:
Step 1:
   Specify the cdf for the theoretical frequency distribution given by Equation above based on the selected class interval width.
Step 2:
   Arrange the observed sample of gaps in a cumulative distribution with these same classes.
Step 3.
   Find D, the maximum deviation between F(x) and SN(x) as in equation D = max |F(x)-SN(x)|
Step 4.
   Determine the critical value, Dα, from Table( K-S critical value) for the specified value of  α and the sample size N.
Step 5.
   If the calculated value of D is greater than the tabulated value of Dα, the null hypothesis of independence is rejected.

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 discrete and continuous system.

5 marks
Details
Official Answer

Discrete system is one in which the state variables changes only at a discrete set of time. For example: banking system in which no of customers (state variable) changes only when a customer arrives or service provided to customer i.e. customer depart form system.


Continuous system is one in which the state variables change continuously over time. For example, the head of the water behind a dam. During and for some time after a rainstorm, water flows into the lake behind the dam. Water is drawn from the dam for flood control and to make electricity. Evaporation also decreases the water level.


--> Discrete model is appropriate for system having discrete state and changes at particular time point and remains in that state for some time where as Continuous model is a appropriate for system with a continuous state that changes continuously over time.

--> Most discrete time system represents how discrete signals are transformed via difference equations where as Most continuous time system represent how continuous signals are transferred via differential equations.

--> A discrete simulation model is not always used to model a discrete system, nor is a continuous model always used to model a continuous system.

AI Generated Answer

AI is thinking...

5.  What do you mean by Multi Server Queues?

5 marks
Details
Official Answer

The multi server queue consists of multiple servers and a common queue for all items. When any item requests for the server, it is allocated if at-least one server is available. Else the queue begins to start until the server is free. In this system, we assume that all servers are identical, i.e. there is no difference which server is chosen for which item.

The total server utilization for N server system is 

ρ = λ/μN

    where, μ = service rate and  λ = arrival rate


                        Fig: Multi server queue

AI Generated Answer

AI is thinking...

6.  What are the key features of Markov chains?

5 marks
Details
Official Answer

If the future states of a process are independent of the past and depend only on the present , the process is called a Markov process. A discrete state Markov process is called a Markov chain. A Markov Chain is a random process with the property that the next state depends only on the current state.

Markov chains are used to analyze trends and predict the future. (Weather, stock market, genetics, product success, etc.

Key features of Markov chains

1. The outcome of each experiment is one of a set of discrete state.

2. The outcome of the experiment depends only on the present state and not on the past state.

3. The transition probability remains constant from one to the next.

AI Generated Answer

AI is thinking...

7.  Explain the congruence method of generating random numbers.

5 marks
Details
Official Answer

The congruence method (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:                                        

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

AI Generated Answer

AI is thinking...

8.  What do you mean by calibration and validation of models?

5 marks
Details
Official Answer

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.

Calibration means to validate the model with the real system, look out for the places for betterment of the models and revising the model to form next better model repeatedly until a satisfiable model is not achieved. The initial model is developed and is calibrated using Naylor-Finger calibration steps with the real system. It is then revised and a first revision model is generated. The first revision model is then calibrated with the real system. It is revised to form a second revision model. This process is continued until the model becomes acceptable.

Naylor and Finger formulated a three step approach:-

1. Build a model that has high face validity.

2. Validate model assumptions.

3. Compare the model input-output transformations to corresponding input-output transformations for the real system.

The following figure shows the relationship of the model calibration to the overall validation process.


The comparison of the model to reality is carried out by verity of test. Some test are subjective and other are objective.

  • Subjective test usually involve people, who are knowledgeable about one or more aspects of the system, making judgments about the model and its output.
  • Objective test always require data on the system's behavior plus the corresponding data produced by the model.
AI Generated Answer

AI is thinking...

9.  What are the Kendall notation of Queuing System?

5 marks
Details
Official Answer

Kendall’s notation is used for parallel server systems. The basic format of this notation is of form: A / B / c / N / K, where, A, B, c, N, K respectively indicate arrival pattern, service pattern, number of servers, system capacity, and Calling population.

The symbols used for the probability distribution for inter arrival time, and service time are, D for deterministic, M for exponential (or Markov) and Ek for Erlang.

E.g. 

a) M/D/2/5/∞ stands for a queuing system having exponential arrival times, deterministic service time, 2 servers, capacity of 5 customers, and infinite population.

b) M/D/2 means exponential arrival time, deterministic service time, 2 servers, infinite service capacity, and infinite population.

AI Generated Answer

AI is thinking...

10.  What do you mean by Hybrid simulation?

5 marks
Details
Official Answer

In reality, the system is of neither a pure continuous nor a pure discrete nature. For simulating such system, the combination of analog and digital computers are used. Such setup is known as hybrid computers. The simulation provided by the hybrid computers is known as hybrid simulation.

The form taken by hybrid simulation depends upon the application. One computer may be simulating the system being studied while other is providing a simulation of the environment in to which the system is to operate. It is also possible that the system being simulated is an interconnection of continuous and discrete subsystem, which can best be modeled by an analog and digital computer being linked together.. 

The major difficulty in use of hybrid simulation is that it requires high speed converters to transform signals from analog to digital form and vice versa.

AI Generated Answer

AI is thinking...

11.  Use the mixed congruential method to generate a sequence of three two-digit random numbers with X0=37, α=7, c=29 and m=100.

5 marks
Details
Official Answer

Given,

    X= 37

    α = 7,

    c= 29 &

    m=100

We have,

        Xi+1 = (α X+ c) mod m

        Mixed Congruential Method: c ≠ 0

        & Ri =Xi/m,

The sequence of random numbers are calculated as follows:

X= 37

R0 = 37/100 = 0.37

X1 = (α X0 + c) mod m = (7*37+29) mod 100 = 288 mod 100 = 88

R1 = 88/100 = 0.88

X2 = (α X1 + c) mod m = (7*88+29) mod 100 = 645 mod 100 = 45

R2 = 45/100 = 0.45

X3 = (α X2 + c) mod m = (7*45+29) mod 100 = 344 mod 100 = 44

R3 = 44/100 = 0.44

Therefore,

The sequence of random integers are 37, 88, 45, 44

The sequence of random numbers are 0.37, 0.88. 0.45, 0.44.

AI Generated Answer

AI is thinking...

12.  Explain GPSS with example.

5 marks
Details
Official Answer

GPSS (General Purpose Simulation System) is a highly structured and special purpose simulation language based on process interaction approach and oriented toward queuing systems.
- The system being simulated is described by the block diagram using various GPSS blocks.
- Each block represents events, delays or other actions that affect the transaction flow.
- GPSS model is developed by converting the block diagram into block statements and adding the control statements.

The general blocks used in GPSS block diagram is shown in figure below:


Example:

                Fig: Manufacturing shop model

AI Generated Answer

AI is thinking...

13.  Write short note on:

a.       Replication of Runs

b.      Simulation tools

5 marks
Details
Official Answer

a. Replication of runs

This approach is used to obtain independent results by repeating the simulation. Repeating the experiment with different random numbers for the same sample size n gives a set of independent determinations of the sample mean  .The mean of the means and the mean of the variances are then used to estimate the confidence interval.

Suppose the experiment is repeated p times with independent random values of n sample sizes. Let xij be the ith observation in jth run and let the sample mean and the variance for the jth run is denoted by  and  respectively. Then for jth run, the estimates are

Combining the result of p independent measurement gives the following estimate for the mean and variance s2 of the populations as:


b. Simulation tools

Simulation tool is a software which is used for simulating hardware, software and network. It is a type of software based on the process of modeling a real world phenomenon with mathematical formula. This program allows the user to observe the operation without actually performing that operation . Its main importance is: how it actually supports the model building.

The tools commonly used for simulation are:
1. CPU network simulation (Queueing network, Petri net simulators)
2. Processor simulation
3. Memory simulation 
4. ALU simulation
5. Logic network simulation

AI Generated Answer

AI is thinking...