LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
matlab_ilt.h File Reference

Numerical inverse Laplace transform in the Abate-Whitt framework, the port of matlab/lib/thirdparty/iltcme/matlab_ilt.m. More...

#include <algorithm>
#include <cmath>
#include <complex>
#include <cstddef>
#include <functional>
#include <vector>
#include "line/api/mam/iltcme_table.h"
#include "line/util/error.h"
Include dependency graph for matlab_ilt.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::mam

Enumerations

enum class  line::mam::IltMethod { line::mam::Cme , line::mam::Euler , line::mam::Gaver }
 Which Abate-Whitt weights to use. More...

Functions

std::vector< double > line::mam::matlab_ilt (const std::function< std::complex< double >(const std::complex< double > &)> &fun, const std::vector< double > &times, std::size_t maxFnEvals, IltMethod method=IltMethod::Cme)
 Invert a Laplace transform at the requested time points.

Detailed Description

Numerical inverse Laplace transform in the Abate-Whitt framework, the port of matlab/lib/thirdparty/iltcme/matlab_ilt.m.

Every variant evaluates the same quadrature

f(t) ~= (1/t) sum_k Re( eta_k F(beta_k / t) )

and differs only in the (eta, beta) pair:

  • cme (the default, and the only one solver_mam_transient_qbd uses): concentrated matrix exponential weights read from the vendored ILT-CME table. The entry chosen is the steepest – smallest cv2 – whose n+1 does not exceed the evaluation budget, which is exactly the reference's scan.
  • euler: binomial (Euler) weights, no table.
  • gaver: Gaver-Stehfest weights, no table.

WHY cme IS NOT INTERCHANGEABLE WITH THE OTHER TWO, since it is tempting to reach for a table-free variant: they are different quadratures with different error behaviour, so substituting one for another changes the answer. The reference defaults to cme; a port that quietly used euler would produce numbers that are not the reference's while reporting the same method. That is why the table is vendored rather than avoided.

ARITHMETIC. Double only, and deliberately: the transform is evaluated at COMPLEX arguments, and the whole route is transcendental. The signature takes a std::function over std::complex<double> so a caller supplies its own transform.

Definition in file matlab_ilt.h.