LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
qsys_gig1_approx_myskja2.m
1function [W,rhohat]=qsys_gig1_approx_myskja2(lambda,mu,ca,cs,q0,qa)
2% [W,RHOHAT]=QSYS_GIG1_APPROX_MYSKJA2(LAMBDA,MU,CA,CS,Q0,QA)
3%
4% Myskja's enhanced third-moment approximation of the mean response time
5% (time in system). For ca=1 the interpolation parameter theta is a 0/0
6% form, so the exact M/G/1 result is returned instead.
7%
8% qa = third relative moment E[X^3]/6/E[X]^3, X=inter-arrival time r.v.
9% q0 = lowest value of the relative third moment for a given mean and SCV
10
11if abs(ca^2-1) < 1e-8
12 % M/G/1 case: exact (also the interpolation anchor of the method)
13 [W,rhohat] = qsys_mg1(lambda,mu,cs);
14 return
15end
16ra = (1+ca^2)/2;
17rs = (1+cs^2)/2;
18rho=lambda/mu;
19theta=(rho*(qa-ra)-(qa-ra^2))/(2*rho*(ra-1));
20d=(1+1/ra)*(1-rs)*(1-(q0/qa)^3)*(1-rho^3);
21D = (rs-theta)^2+(2*rs-1+d)*(ra-1);
22D = max(D,0); % guard small negative values due to round-off
23W=(rho/(1-rho))/lambda*(rs+(1/rho)*(sqrt(D)-(rs-theta)));
24rhohat = W*lambda/(1+W*lambda); % so that M/M/1 formulas still hold
25end