%Multichannel service system with denial
P=[];v=[];w=[];W=[];A=[];
M=4;%number of states=number of chanels + 1
o=1;%position of graph of the grid 2x2 
n=1.5/10;%density of demand flow
m=.5/10;%density of survice flow
%The matrix
P=zeros(M);
for i=1:M-1;P(i+1,i)=n;P(i,i+1)=i*m;end;for i=1:M;P(i,i)=1-sum(P(:,i));end
[v,w]=eig(P);W=diag(w)';
for i=1:M;if abs(W(i)-1)<10^(-5);f=i;end;end;f
Sa=v(:,f)./sum(v(:,f))%asymptotic distribution
%its graph
figure(1);
subplot(2,2,o);bar(Sa);axis([.4 7.6 0 .5])
