> # Maple worksheet to demonstrate use of Ph(t)/Ph(t)/Infinity procedures
> # from Nelson and Taaffe (1999). Last update 6/30/99.
> with(linalg):
> A := matrix(3,3,[.2,.1,.7, .4,.2,.4, .8,.2,0.]);
> lambda := vector(2,[7.,9.]);
> B := matrix(3,3,[0,1,0, 0,0,1, 0.3, 0.7, 0]);
> mu := vector(2, [2+sin(t), 2+sin(t/2)]);
>
> # Evaluate the moment differential equations at time t = 5
> read(`PhPhInfNumericEmpty`):
> mdeq := PhPhInfNumericEmpty(A, lambda, B, mu);
> mdeq(5);
>
> # show the moment differential equations for this queue starting empty and idle
> read(`PhPhInfSymbolic`):
> PhPhInfSymbolic(A, lambda, B, mu);
>
> # compute the mean and variance of number in the queue for 0 < t < 50
> # (the mean and variance appear to be the same for this example)
> read(`PhPhInfMoments`):
> PhPhInfMoments(A, lambda, B, mu, 0, 50);
>
> # compute the mean, variance and cdf of the sojourn time of a customer
> # arriving at time 5
> read(`c:PhPhInfNumericInit`):> read(`PhPhInfSojourn`):
> sojourn := PhPhInfSojourn(A, lambda, B, mu, 5):
> sojourn[1]; # mean
> sojourn[2]; # variance
> sojourn[3]; #cdf
>
>
> # Create initial conditions that correspond to 1 customer in the queue and no new arrivals
> InitP := vector(2, [0,0]);
> InitN := vector(2, [.3, .7]);
> InitNN := vector(2):
> InitNN[1] := matrix(2,2, 0);
> InitNN[2] := matrix(2,2,0);
> InitNA := matrix(2, 2, [0,0,0,0]);
> # create a procedure to evaluate the moment differential equations with these
> # initial condition in place at time t = 5
> mom := PhPhInfNumericInit(A, lambda, B, mu, 5, InitP, InitN, InitNA, InitNN);
> mom(5);
> mom(10);
>