Class FluidMomentTerms

java.lang.Object
jline.solvers.fluid.moments.FluidMomentTerms

public class FluidMomentTerms extends Object
Event-based representation of the fluid population process, as required by the moment-closure methods of SolverFluid. Java twin of the MATLAB fluid_moment_terms.

The closing ODEs are a density-dependent Markov population process

   dx/dt = F(x) = D * r(x),     r_e(x) = rateBase(e) * g_e(x)
 

with D the jump matrix and g the rate-factor vector of FluidRateFactors. The closing analyzer discards D and r once it has composed the right-hand side, but the covariance equation of the linear noise approximation needs them separately: the diffusion matrix is D*diag(r(x))*D', which cannot be recovered from F alone. This class rebuilds that representation and exposes drift, rate and Jacobian evaluations that all take the closure variance as an explicit argument.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int[][]
     
    final int[]
    Coordinates carrying a real population, i.e.
    final Matrix
    Jump matrix (nstate x nevents).
    final Matrix
    [nEventsReduced x nEventsOriginal] expected firings of each original event per firing of each reduced one; the identity when no immediate coordinate was eliminated.
    final boolean[][]
     
    final int[]
     
    final int[]
    Source state coordinate of each event.
    final boolean[]
    Event classification, so throughputs can be read off the rate vector.
    final int[]
     
    final Matrix
    Projector taking an initial condition onto the surviving coordinates: the identity on a coordinate the immediate reduction kept and the absorption distribution on one it folded away, so a zero diagonal marks an eliminated coordinate.
    final boolean[]
     
    final int
     
    final Matrix
     
    final Matrix
     
    final int
     
    final boolean[]
    Stations whose occupancy cannot reach their server count, where min(n,c) is the identity and the Gaussian closure must stay first order.
    final int
     
    final Matrix
     
    final Matrix
    Constant rate factor of each event (nevents x 1).
    final Matrix
    Effective server counts, with an infinite server replaced by the closed population.
     
    final int[][]
    State coordinates of each station, and of each (station, class).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Refuses any station whose discipline has no drift branch.
    drift(double[] x, double[] sigma2, Matrix[] covblk)
    Fluid drift F(x) = D*r(x).
    int
    driftKinkStation(double[] x, double[] sigma2)
    First station sitting on the saturation kink of the first-order rate factor, or -1 when none does.
    factors(double[] x, double[] sigma2, Matrix[] covblk)
    Per-coordinate service shares at the given closure variance.
    jacobian(double[] x, double[] sigma2, Matrix[] covblk)
    Analytic Jacobian dF/dx = D*(rateBase .* G(eventIdx,:)).
    double[]
    nudgedOffKink(double[] x, double[] sigma2, double rel)
    The state with every kinked station moved strictly onto one side of its kink.
    rates(double[] x, double[] sigma2, Matrix[] covblk)
    Event rates, i.e.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • M

      public final int M
    • K

      public final int K
    • nstate

      public final int nstate
    • D

      public final Matrix D
      Jump matrix (nstate x nevents).
    • rateBase

      public final Matrix rateBase
      Constant rate factor of each event (nevents x 1).
    • eventIdx

      public final int[] eventIdx
      Source state coordinate of each event.
    • qIndices

      public final Matrix qIndices
    • Kic

      public final Matrix Kic
    • enabled

      public final boolean[][] enabled
    • sched

      public final SchedStrategy[] sched
    • S

      public final Matrix S
      Effective server counts, with an infinite server replaced by the closed population.
    • lldscaling

      public final Matrix lldscaling
    • stationBlock

      public final int[][] stationBlock
      State coordinates of each station, and of each (station, class).
    • classBlock

      public final int[][] classBlock
    • covIdx

      public final int[] covIdx
      Coordinates carrying a real population, i.e. everything but the EXT source pools.
    • isExt

      public final boolean[] isExt
    • minExact

      public final boolean[] minExact
      Stations whose occupancy cannot reach their server count, where min(n,c) is the identity and the Gaussian closure must stay first order. See buildMinExact.
    • evIsDeparture

      public final boolean[] evIsDeparture
      Event classification, so throughputs can be read off the rate vector.
    • evStation

      public final int[] evStation
    • evClass

      public final int[] evClass
    • Emap

      public final Matrix Emap
      [nEventsReduced x nEventsOriginal] expected firings of each original event per firing of each reduced one; the identity when no immediate coordinate was eliminated. Event attributes above are indexed by ORIGINAL event, so a throughput is read as r' * (Emap * indicatorOverOriginalEvents).
    • immediateAbsorb

      public final Matrix immediateAbsorb
      Projector taking an initial condition onto the surviving coordinates: the identity on a coordinate the immediate reduction kept and the absorption distribution on one it folded away, so a zero diagonal marks an eliminated coordinate. Null when nothing was eliminated.
  • Constructor Details

    • FluidMomentTerms

      public FluidMomentTerms(NetworkStruct sn, SolverOptions options)
      Parameters:
      sn - network structure, after the non-Markovian to phase-type conversion
      options - solver options
  • Method Details

    • factors

      public Matrix factors(double[] x, double[] sigma2, Matrix[] covblk)
      Per-coordinate service shares at the given closure variance.
    • rates

      public Matrix rates(double[] x, double[] sigma2, Matrix[] covblk)
      Event rates, i.e. the rate base scaled by the service shares.
    • drift

      public Matrix drift(double[] x, double[] sigma2, Matrix[] covblk)
      Fluid drift F(x) = D*r(x).
    • driftKinkStation

      public int driftKinkStation(double[] x, double[] sigma2)
      First station sitting on the saturation kink of the first-order rate factor, or -1 when none does. See FluidRateFactors.driftKinkStation(double[], double[]): at such a point jacobian(double[], double[], jline.util.matrix.Matrix[]) exists only one-sidedly, so a caller needing a differentiable drift must check this rather than trust the returned slope.
    • nudgedOffKink

      public double[] nudgedOffKink(double[] x, double[] sigma2, double rel)
      The state with every kinked station moved strictly onto one side of its kink. See FluidRateFactors.nudgedOffKink(double[], double[], double).
    • jacobian

      public Matrix jacobian(double[] x, double[] sigma2, Matrix[] covblk)
      Analytic Jacobian dF/dx = D*(rateBase .* G(eventIdx,:)).
    • checkSupported

      public void checkSupported()
      Refuses any station whose discipline has no drift branch.