![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Stationary mean fluid level E[X] of a first- or second-order level-dependent (multi-regime) Markovian fluid queue, in closed form from the matrix-exponential building blocks. More...
#include <cstddef>#include <vector>#include "line/num/number.h"#include "line/util/error.h"#include "line/util/expm.h"#include "line/util/linalg.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::mam::LevelDependentFluidBlocks< T > |
| The matrix-exponential building blocks of a multi-regime fluid queue, the output of mfq_ld_solve. More... | |
Namespaces | |
| namespace | line |
| namespace | line::mam |
Functions | |
| template<class T> | |
| T | line::mam::mfq_ld_mean (const LevelDependentFluidBlocks< T > &b) |
| Stationary mean fluid level of a level-dependent fluid queue. | |
Stationary mean fluid level E[X] of a first- or second-order level-dependent (multi-regime) Markovian fluid queue, in closed form from the matrix-exponential building blocks.
Port of matlab/src/api/mam/mfq_ld_mean.m and the BUTools LevelDependentFluidStationaryMean it wraps. Its inputs are exactly the outputs of mfq_ld_solve, and it calls nothing else, so it is complete on its own terms: a caller holding the blocks from any source can use it.
THE DENSITY. Over regime k, that is over the level interval [T(k), T(k+1)], the stationary density is the sum of a forward and a backward matrix exponential,
pi_k(x) = iniF_k exp(KF_k (x - T(k))) cloF_k
+ iniB_k exp(KB_k (T(k+1) - x)) cloB_k,
one anchored at each end of the regime, plus point masses at the K+1 thresholds. E[X] is then the mass contribution sum_j T(j) masses_j e plus the integral of x pi_k(x) over each regime.
THE INTEGRALS. Both regime integrals reduce to J0 = int_0^L exp(M u) du and J1 = int_0^L u exp(M u) du, which are read off ONE matrix exponential of the nilpotent augmentation
A = [ M I 0 ; 0 0 I ; 0 0 0 ], W = exp(A L), J0 = W(1:n, n+1:2n), J1 = L J0 - W(1:n, 2n+1:3n).
That form is used rather than the obvious M^-1 (exp(M L) - I) because KF and KB are SINGULAR whenever a regime has a zero-drift direction, which is the normal case and not an edge case; the augmentation never inverts anything and is exact for a singular M. The forward integral is anchored at T(k), giving the weight T(k) J0 + J1, and the backward one runs the other way, giving T(k+1) J0 - J1.
ARITHMETIC. Gated on num_traits<T>::has_transcendental because it calls expm, which is a tolerance-controlled Pade approximation in any arithmetic. The rest is finite exact linear algebra.
Definition in file mfq_ld_mean.h.