No BSD License  

Highlights from
An Introduction to Stochastic Processes

image thumbnail
[X]=e2311
function [X]=e2311
%
%  Example 2.3.11  - M(t)/M/3  Queue
%  Differential Equation Approach
%
t0=0; tf=90; NS=20; NS1=NS+1;
x0=zeros(1,NS1); x0(1,1)=1;
[t,x]=ode45('e2311d',t0,tf,x0);
[n,m]=size(x); a=ones(1,NS); b=cumsum(a); b=[0 b];
r1=[]; r2=[];
for k=1:n
pi=x(k,:);
L=sum(b.*pi); b2=b.^2; L2=sum(b2.*pi); V=L2-L^2;
r1=[r1 L]; r2=[r2 V];
end
X=zeros(n,3); X(:,1)=t; X(:,2)=r1'; X(:,3)=r2';

Contact us at files@mathworks.com