LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
matlab
src
api
qsys
qsys_gig1_approx_myskja2.m
1
function [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
11
if 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
15
end
16
ra = (1+ca^2)/2;
17
rs = (1+cs^2)/2;
18
rho=lambda/mu;
19
theta=(rho*(qa-ra)-(qa-ra^2))/(2*rho*(ra-1));
20
d=(1+1/ra)*(1-rs)*(1-(q0/qa)^3)*(1-rho^3);
21
D = (rs-theta)^2+(2*rs-1+d)*(ra-1);
22
D = max(D,0); % guard small negative values due to round-off
23
W=(rho/(1-rho))/lambda*(rs+(1/rho)*(sqrt(D)-(rs-theta)));
24
rhohat = W*lambda/(1+W*lambda); % so that M/M/1 formulas still hold
25
end
Generated by
1.9.8