Skip to content

Experiment - 1 -Answers

A. Take calls in progress,average holding time and period of observation as input from users, Calculate traffic in erlang and display it

Formula:

$Traffic-Intensity$ = $\frac {C \times h}{T}$

In [1]:
c=input('Enter the no. of calls per hour=');
th=input('Enter the holding duration of eah call=');
T=input('Time = ');
Enter the no. of calls per hour=120
Enter the holding duration of eah call=6
Time =60
In [2]:
function erlang(C,h,T)
    A = (C * h) / T
endfunction
In [3]:
erlang(c,th,T)
A =  12

B. For number of trunks = 6, take total traffic A from 0 to 50 erlang (in steps of 5). Plot Blocking Probability (y axis) vs traffic in erlang (x axis)

Formula:

alt text

In [4]:
%pkg install -forge queueing  # Installing Packages
For information about changes from previous versions of the queueing package, run 'news queueing'.
In [5]:
pkg load queueing            # Loading Package
In [6]:
clc;clear all;close all;
N = input('Enter the  number of trunks =' );
A = input('Enter the No. traffic in erlang = ');

A = 1:6:50

Pb = erlangb(A,N);
Enter the  number of trunks =6
Enter the No. traffic in erlang =50
A =

    1    7   13   19   25   31   37   43   49

In [8]:
grid on;
plot(A,Pb,'r+:')
xlabel('No of Erlangs = ');
ylabel(' Blocking probability =');
title('Program to simulate LCC model');

C. For grade of service of = 0.02, take total traffic A from 0 to 50 erlang (in steps of 5) and plot number of trunks required to carry this traffic. ). Plot No. of trunks (y axis) vs traffic in erlang (x axis).

In [19]:
%------Part-2 Plot Pb Vs Traffic----------%
clc;clear all;close all;
x=[0 5 10 15 20 25 30 35 40 45 50];
y=[0 0.1918 0.4845 0.6341 0.7181 0.7712 0.8076 0.8340 0.8541 0.8699 0.8826];

grid on;
 
plot(x(1,:),y(1,:),'rx+-')
 
names = {'  (0,0)  '};  
text(x(1,1),y(1,1),names)
 
names = {'  (5 , 0.1918)  '};   
text(x(1,2),y(1,2),names)
 
names = {'  (10 , 0.4845)  '};   
text(x(1,3),y(1,3),names)
 
names = {'  (15 , 0.6341)  '};   
text(x(1,4),y(1,4),names)
 
names = {'  (20 , 0.7181)  '};   
text(x(1,5),y(1,5),names)

names = {'  (25 , 0.7712)  '};   
text(x(1,6),y(1,6),names)
 
names = {'  (30 , 0.8076)  '};   
text(x(1,7),y(1,7),names)
 
names = {'  (35 , 0.8340)  '};   
text(x(1,8),y(1,8),names)
 
names = {'  (40 , 0.8541)  '};   
text(x(1,9),y(1,9),names)

names = {'  (45 , 0.8699)  '};   
text(x(1,10),y(1,10),names)

names = {'  (50 , 0.8826)  '};   
text(x(1,11),y(1,11),names)
xlabel('Traffic in erlangs');
ylabel(' Blocking probability=');
title('Program to simulate LCC model');