function y = laplace2(which,z,Ps1,Ps2,delta,mu,p2not,p2,r,s,x,q,xnot,qnot,beta,mndpevt,littlegama) % laplace transform of response time tail cdf if which==1 y=Ps1*mu/(mu+z); d=(mu/(mu+z)); y=y+p2not*d*(s*mu+delta(1,1))/(s*mu+delta(1,1)+z); for k=1:r-1 d=(mu/(mu+z))*(s*mu+delta(k+1,1))/(s*mu+delta(k+1,1)+z); y=y+p2(k,1)*d; end y=(1-y)/z; % laplace transform of time to abandon-time cdf elseif which==2 ahat=zeros(r,1); ahat(1,1)= littlegama(1,1)*(1/mndpevt(1,1))/((1/mndpevt(1,1))+z); for k = 2:r ahat(k,1) = littlegama(k,1)*(1/mndpevt(k,1))/((1/mndpevt(k,1))+z); Prod(k,1) = (1-littlegama(k,1))*(1/mndpevt(k,1))/((1/mndpevt(k,1))+z); for j = 2:k Prod(k,j) = Prod(k,j-1)*(1-littlegama(k,j))*(1/mndpevt(k,j))/((1/mndpevt(k,j))+z); ahat(k,1) = ahat(k,1) + (littlegama(k,j)*((1/mndpevt(k,j))/((1/mndpevt(k,j))+z))*Prod(k,j-1)); end end y=x(s)*(1-beta)*qnot*ahat(1,1); for k=1:r-1 y=y+x(s+k,1)*(1-beta)*q(k)*ahat(k+1,1); end y = y/z; % laplace transform of step function elseif which==3 y=(1-exp(-z))/z; % laplace transform of exponential ccdf with lambda=1 elseif which==4 y=1/(1+z); %Laplace transform of waiting-time cdf for served customers elseif which==5 d = zeros(r,1); for k=1:r d(k,1) =(1/mndpevt(k,1))/((1/mndpevt(k,1))+z); for j=2:k d(k,1) = d(k,1)*(1/mndpevt(k,j))/((1/mndpevt(k,j))+z); end end y=p2not*d(1,1); for k=1:r-1 y=y+p2(k,1)*d(k+1,1); end y=y/(Ps2*z); end