44. Realize the calculation of the Irish B formula and output the table (matlab program)

1. Brief description

      

1. Definition of traffic volume

The traffic volume refers to the product of the number of calls and the average occupied time of each call within a certain period of time.

Traffic reflects the size of the telephone load and is related to call intensity and call hold time. The call intensity is the number of calls that occur per unit time, and the call hold time is the occupied time.
 

Traffic Calculation Method

The traffic formula is: A=C * t.

  • A is traffic volume, the unit is erl (Ireland);

  • C is the number of calls, the unit is times/hour;

  • t is the average occupied time of each call, and the unit is hour/time.

The traffic volume per unit time is equal to the product of call intensity and call hold time using the same time unit , and its unit is Erlang . For example: call intensity = 1800 times/hour, call hold time = (1/60) hour/time, then traffic volume = 1800 times/hour X (1/60) hour/time = 30 Erl.

General traffic is also called hourly calls, and the time range for statistics is 1 hour. It can be seen from this that Erl in Ireland is a dimensionless quantity, and it is only a unit set up to commemorate the person in Ireland.

In a mobile phone system, traffic can be divided into incoming traffic and completed traffic . The incoming traffic depends on the average number of calls occurring per unit time and the average time each call occupies the wireless channel. Among the incoming traffic of the system, the part of the traffic that completes the connection is called the completed traffic. The part of the traffic that has not been connected is called the lost traffic, and the ratio of the lost traffic to the incoming traffic is called the call loss rate . (When multiple channels are shared, the number of users is usually greater than the number of channels. When multiple users require services at the same time but the number of channels is insufficient, only some users can talk first, and other users can talk when the channels are free. The latter part of users cannot talk because there is no idle channel, that is, call failure, referred to as call loss).

Incoming traffic volume = completed traffic volume + lost traffic volume;

Lost traffic volume = incoming traffic volume * call loss rate (call loss rate)

2. Calculation of Irish B formula and Irish C formula

The Irish B formula for calculating the time blocking rate of the Irish instant denial system is expressed as

s represents the number of trunk lines in the system, and a represents the call volume to the system.


The Irish C formula for calculating the call waiting probability for the Irish Waiting System is expressed as


Give the Matlab implementation code of the two formulas

Irish B formula:

 
 
  1. function p=Erlang_B_Formula(s,a);

  2. sum=0;

  3. for r=0:s%用一个for循环实现求和

  4. sum=sum+a^r/factorial(r);

  5. end

  6. p=a^s/(sum*factorial(s));

Irish C formula:

 
 
  1. function p=Erlang_C_Formula(s,a);

  2. sum=a^s/(factorial(s)*(1-a/s));

  3. for k=0:s-1%用for循环实现求和

  4. sum=sum+a^k/factorial(k);

  5. end

  6. p=a^s/(factorial(s)*(1-a/s)*sum);

Simple way:

Irish B formula:

function p=Erlang_B_Formula_1(s,a)

p=a^s/(factorial(s)*sum(a.^[0:s]./factorial([0:s])));

Irish C formula:

function p=Explicit_C_Formula_1(s,a)

p=a^s/(factorial(s)*((1-a/s)*sum(a.^[0:s-1]./factorial([0:s-1]))+a^s/factorial(s)));

In addition, given B(s, a), a or C(s, a), a, s can be deduced inversely.

(This editor is really difficult to use = =, the code block does not have a matlab version, bad reviews, no stars are given~)

2. Code

function ErlangB 
clc;
pn=[];            
s=[];
x=1:100; % abscissa range
m=[4 5 8 10 15 20 25 30 40 50 60 75 90 100]; % switch outlet capacity
L=length (m);
for i=1:L

    for a=1:100% inbound traffic intensity               
        for k=1:m(i)
            s=[s,a.^k/factorial(k)];
            add=sum(s);
        end
        pn0=(a. ^m(i)/factorial(m(i)))./add;
        pn=[pn,pn0]; % probability of customer being rejected
        s=[];           
    end
       
    loglog(x,pn); % logarithmic coordinates
    set (gca,'XGrid','on'); % draw grid lines
    set(gca,'XMinorTick','off');
    set(gca,'XTick',[1 2 4 6 8 10 20 40 60 80 100 ]); %X coordinate axis scale setting
    set(gca,'XMinorGrid','off');    
    set(gca,'Ylim',[0.001 1]); %limit the value range of the vertical coordinate 
    set(gca,'YGrid ',   'on');   
    set(gca,'YMinorTick','off');
    hold on
    pn=[];

end
xlabel('Traffic intensity α(erl)','fontsize',8);
ylabel('Call loss rate Pc','fontsize',8);

for j=1:3 %Enter the y-axis coordinate value
    gtext('2');
    gtext('4');
    gtext('6');
    gtext('8');
end


gtext('m=4'); % input comments on the graphics with the mouse
for i=2:L
    gtext(int2str(m(i)));
end

3. Running results

 

 

Guess you like

Origin blog.csdn.net/m0_57943157/article/details/132178089