![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
A symbolic description of the fluid ODE system: a port of solver_fluid_symodes.m, which is what @@SolverFLD/exportODEs renders. More...
#include <algorithm>#include <cmath>#include <cstddef>#include <cstdio>#include <limits>#include <string>#include <vector>#include "line/lang/qn/network_struct.h"#include "line/solvers/fluid/fluid_matrix.h"#include "line/solvers/fluid/fluid_odes.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::fluid::SymFactor |
| The state-dependent factor attached to one event's driving variable. More... | |
| struct | line::fluid::FluidSymSystem |
| The symbolic system, in whichever of the two forms the method implies. More... | |
| struct | line::fluid::FluidSymbolicDrift |
| The drift as expression strings, one per state variable, plus their names. More... | |
| struct | line::fluid::FluidSymbolicJacobian |
| What @@SolverFLD/getJacobian returns: d f_i / d x_j as expression strings. More... | |
Namespaces | |
| namespace | line |
| namespace | line::fluid |
Functions | |
| template<class T> | |
| FluidSymSystem | line::fluid::fluid_symodes (const qn::NetworkStruct< T > &sn, const std::string &method_in, double pstar, const std::vector< double > &init_sol) |
| Build the symbolic system of sn under opt.method. | |
| FluidSymbolicDrift | line::fluid::fluid_symbolic_drift (const FluidSymSystem &sys) |
| Port of @@SolverFLD/getSymbolicDrift: the right-hand side of the mean-field ODE system as expression strings, one per state variable. | |
| FluidSymbolicJacobian | line::fluid::fluid_symbolic_jacobian (const FluidSymSystem &sys) |
| Port of @@SolverFLD/getJacobian: d f_i / d x_j of the mean-field drift, as expression strings. | |
A symbolic description of the fluid ODE system: a port of solver_fluid_symodes.m, which is what @@SolverFLD/exportODEs renders.
WHY THE SOLVER CANNOT SIMPLY BE ASKED. The numerical path evaluates the drift at a point; it never holds the drift as an object. Anything that wants to PRINT the system, differentiate it by hand, or hand it to another tool needs the coefficients and the shape of every term, and that is what this builds. It is deliberately a SECOND construction of the same dynamics: it mirrors the numerical code path term by term, so a divergence between the two is a real defect and not a rendering artefact.
TWO FORMS, MATCHING THE TWO SOLVER PATHS.
form W (methods default, matrix, pnorm) dx/dt = W' theta(x) + lambda theta_s(x) = x_s min(n_i, S_i)/n_i, or the p-norm smoothing of it, and theta_s = 0 at a Source. This is solver_fluid_matrix and is taken from the SAME assembly the integrator uses, so the two cannot drift.
form J (methods closing, statedep, softmin) dx/dt = J r(x), r_e(x) = coeff_e * factor_e(x) with one event per (departure, phase change) and a factor whose shape is fixed by the scheduling strategy of the station that drives it.
THE FACTOR TYPES, which are the whole content of the J form: lin x_v (INF, and unhandled policies) min x_v min(n_i, S_i)/n_i (PS, FCFS under closing) ext1 1 - sum of the other phases at a Source dpsmin x_v min(n_i, S_i)/ntilde_i, the weight w_ir folded into coeff dpspw piecewise: x_v below S_i, weighted above it fcfsw x_v min(n_i, S_i)/nhat_i, phase weight folded into coeff fcfsws the same with softmin in place of min
WHAT IS REFUSED BY NAME: tbi, diffusion and mfq have no ODE system of this shape at all – tbi partitions and re-solves, diffusion adds a noise term, mfq solves a queue analytically – and statedep/softmin have no open-model branch, exactly as in the reference.
Definition in file fluid_symodes.h.