Simulation and Modelling 2075

Tribhuwan University
Institute of Science and Technology
2075
Bachelor Level / Fifth Semester / Science
Computer Science and Information Technology ( CSC317 )
( Simulation and Modelling )
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)

1.  Differentiate between analog and digital methods of simulation. Explain the analog method of simulation with the help of suitable example.

10 marks view

Analog simulation and Digital simulation differs in the following ways:

  • The goal of digital simulation is much simpler to achieve than analog simulation because the circuit is discrete in nature and has no circuit constraints to meet, such as Kirchhoff's Current Law (KCL).
  • Digital simulation runs orders of magnitude faster than analog simulation because digital simulation deals with high-level behavior only, while in analog simulation the same elements have analog implementations.
  • Digital simulation abstracts away important electrical characteristics that might be revealed by the analog simulation.


Analog Method of simulation

Analog computers are those computers that are unified with devices like adder and integral so as to simulate the continuous mathematical model of the system, which generates continuous outputs.

Analog method of system simulation is for use of analog computer and other analog devices in the simulation of continuous system. The analog computation is sometimes called differential analyser. Electronics analog computers for simulation are based on the use of high gain dc amplifiers called operational amplifier (op amps). In such analog computer, voltages are equated to mathematical variables and the op amps can add and integrate the voltages. The proper configurations can handle addition of several input voltages each representing the input variables. The analog computer provides limited accuracy because op amps have many assumptions which can never be true in reality.

The general method to apply analog computers for the simulation of continuous system models involves following components:


Example: Automobile Suspension Problem

The general method by which analog computers are applied can be demonstrated using second order differential equation.

    M x" + D x' + K x = K F(t)

Solving the equation for the highest order derivate gives,

    M x" = K F(t) – D x' - K x

        Fig: Automobile suspension problem

Suppose a variable representing the input F(t) is supplied, assume there exist variables representing -x and -x'. These three variables can be scaled and added to produce Mx". Integrating it with a scale factor 1/M produces X'. Changing sign produces -x', further integrating produces -x, a further sign inverter is included to produce +x as output.

2.  Use multiplicative congruential method to generate a sequence of three digits random numbers between (0, 1) with X0=27, a=3 and m=1000. Use any one of the uniformity test to find out whether the generated numbers are uniformly distributed or not? (Critical value for α=0.05 and N=5 is 0.565).

10 marks view

Given,

    X27

    α = 3,

    m=1000

We have,

For multiplicative congruential method:

        Xi+1 = (α X) mod m

        & R=Xi/m,

The sequence of random numbers are calculated as follows:

X= 27

R0 = 27/1000 = 0.027

X1 = (α X0) mod m = (3*27) mod 1000 = 81 mod 1000 = 81

R1 = 81/1000 = 0.081

X2 = (α X1) mod m = (3*81) mod 1000 = 243 mod 1000 = 243

R2 = 243/1000 = 0.243

X3 = (α X2) mod m = (3*243) mod 1000 = 729 mod 1000 = 729

R3 = 729/1000 = 0.729

X4(α X3 ) mod m = (3*729) mod 1000 = 2187 mod 1000 = 187

R= 187/1000 = 0.187

Therefore,
The sequence of random numbers are 0.027, 0.081, 0.243, 0.729, 0.187

Now, to find out whether these random numbers are uniformly distributed or not using Kolmogorov--Smirnov test 

Arranging the above random numbers number in ascending order:

    0.027, 0.081, 0.187, 0.243,, 0.729

Here, N = 5

Calculation table for Kolmogorov-Smirnov test :

i



10.0270.20.1730.027
20.0810.40.319-
30.1870.60.413-
40.2430.80.557-
50.72910.271-

Now, calculating

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

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

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

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

Since the computed value, D = 0.557, 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.

3.  Why is GPSS called transaction flow oriented language? A machine tool in a manufacturing shop is turning out parts at the rate of every 5 minutes. When they are finished, the parts are sent to an inspector, who takes 4±3 minutes to examine each one and rejects 15% of the parts. Draw and explain a block diagram and write a GPSS program to simulate using the concept of facility.

10 marks view

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. Therefore GPPS is called transaction flow oriented language.

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.15, so that 85 % of the parts go to the next location called ACC, to represent accepted parts and 15 % 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.15  ACC   REJ
ACC TERMINATE     1

REJ TERMINATE     1

Group B

Short answer Questions:

Attempt any eight questions.                                                                                       (5x8=40)

4.  Differentiate between static physical and dynamic physicals models.

5 marks view
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.

5.  Describe different phases of simulation study with the help of flow chart.

5 marks view

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.

6.  Why the random numbers generated by computer called pseudo random number? List out different types of errors that may occur while generating pseudo-random numbers.

5 marks view

In computer random numbers are derived from a known starting point and is typically repeated over and over using some known methods (algorithms) to produce a sequence of numbersThe sequence of numbers are not completely random as the set of random numbers can be replicated because of use of some known method. So, the random numbers generated by computer called pseudo random numbers.

Every new number is generated from the previous ones by an algorithm. This means that the new value is fully determined by the previous ones. But, depending on the algorithm, they often have properties making them very suitable for simulations.

When generating pseudo-random numbers, certain problems or errors can occur. Some examples include the following:

1. The generated numbers might not be uniformly distributed.
2. The generated numbers might be discrete valued instead of continuous valued.
3. The mean of the generated numbers might be too high or too low.
4. The variance of the generated numbers might be too high or too low.
5. There might be presence of correlation between the generated numbers.

7.  Define confidence interval. How do you use estimation method in simulation output analysis? Explain.

5 marks view

The confidence interval is the range of possible values for the parameter based on a set of data (e.g. the simulation results.) Confidence intervals are based on the premise that the data being produced by the simulation is represented well by a probability model.

Estimation method estimates the range for the random variable so that the desired output can be achieved. A random variable is drawn from an infinite population that has a stationary probability distribution with a finite mean, μ, and finite variance, σ ². These random variables are independently and identically distributed (i.e. IID variables). 
Let x(i=1,2,…,n) be the n IID random variables. Then normal variate:
In terms of sample mean  
    Where, 
Since the sample mean is some of the random variables, it is itself a random variable. So, a confidence interval about its computed value needs to be established.  Suppose the model is the normally distributed with mean   , Variance σ² and we have a sample of n size then the confidence interval is given by:
The population variance σ ² is usually not known; in which case it is replaced by an estimate calculated from the formula
In terms of the estimated variance s2, the confidence interval for   is defined by

Hence the estimation method gives the desired range of the sample variable taken from infinite population.

8.  Describe the process of model building, verification and validation in detail with example.

5 marks view

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.

9.  Define traffic intensity and server utilization. Write down the kendall’s notation for queuing system.

5 marks view

Traffic Intensity

The ratio of the mean service time to the mean inter arrival time is called traffic intensity. I.e. u= λ"Ts or u=Ts/Ta 

Server Utilization

Server utilization is the percentage of the time that all servers are busy. Server utilization factor (ρ ) is the ratio of average arrival rate (λ) to the average service rate (μ).

ρ = λ/μ in the case of a single server model

ρ = λ/μn in the case of a “n” server model

Kendall's notation

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.

10.  What do you understand by feedback systems? Explain

5 marks view

The system takes feedback from the output i.e. input is coupled with output. A significant factor in the performance of many systems is that coupling occurs between the input and output of the system. The term feedback is used to describe the phenomenon.

One example of feedback system in which there is continuous control is the aircraft system. Here the input is a desired aircraft heading and the output is the actual heading. The gyroscope of the autopilot is able to detect the difference between the two headings. A feedback is established by using the difference to operate the control surface. Since change of heading will then affect the signal being used to control the heading.

The difference between the desired signal θt and actual heading θ0 is called the error signal, since it is a measure of the extent to which the system from the desired condition. It is denoted by є.

We also know that, in terms of angular acceleration

From equation (1), (2) & (3)

Dividing both sides by I, and making the following substitutions in equation (4)

 (where  is damping factor)

    This is a second order differential equation.

11.  How do you update the clock time in simulation? Explain.

5 marks view

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.

12.  “There is no unified theory in simulation”. Verify it.

5 marks view

Explain....

13.  List out the entities, attributes, activities and events for Banking, Communication, Production, Inventory and Supermarket systems.

5 marks view

a. Banking

    Entities: Customers

    Attributes: Checking-account balance

    Activities:  Making deposits

    Events: Arrival, departure

b. Communication

    Entities: Messages

    Attributes: Length, destination

    Activities: Transmitting

    Events: Arrival at destination

c. Production

    Entities: Machines

    Attributes: Speed, capacity, breakdown rate

    Activities: welding, stamping

    Events: Breakdown

d. Inventory

    Entities:  Warehouse

    Attributes: Capacity

   Activities:  Withdrawing

    Events: Demand

    State variables: Levels of inventory, background

e. Supermarkets

    Entities: Customers, cashier, salesperson

    Attributes: Faster, reliable, responsible, punctual, skilled in sales

    Activities:  sell product, fill displays, organize the supermarket carts

    Events: Arrival and departure of customers, reception of products, lack of products