Class PetriSystem

java.lang.Object
jline.solvers.fluid.petri.PetriSystem

public final class PetriSystem extends Object
The closed enabling term of every transition mode, the rate of every event column, and the drift Jacobian. Java twin of the MATLAB fluid_petri_theta, fluid_petri_rates and fluid_petri_jacobian.
  • Method Details

    • theta

      public static PetriSystem.Theta theta(PetriTerms t, double[] x, double[] s2)
      The closed enabling term of every mode, and its derivative.
        theta_j = ( prod_b Phi((thr_b - m_b)/sd_b) ) * E[ min_a(m_a/w_a), c_j ]

      Both factors collapse to their first-order form at zero variance -- Phi becomes the hard indicator and the min closure becomes min() -- so the mean-field limit is one code path, not two.

      THE INHIBITOR GATE IS WHY A PETRI NET NEEDS A SMOOTHED CLOSURE AT ALL, quite apart from accuracy: the indicator is a step, and a Newton solver has no derivative to descend on a step.

      THE VARIANCES ARE UNKNOWNS, NOT FUNCTIONS OF X: s2 is pinned by its own consistency row in the DAE, so the derivative is with respect to the MEANS only.

    • theta

      public static PetriSystem.Theta theta(PetriTerms t, double[] x, double[] s2, double gateWidth)
      As theta(PetriTerms, double[], double[]), with the zero-variance inhibitor gate smoothed to Phi((thr_b - m_b)/(gateWidth*max(1,thr_b))) when gateWidth is positive. Only the first-order seed asks for it: its hard step makes a discontinuous drift that chatters at the threshold, and a stiff stepper then cannot get past it.
    • theta

      public static PetriSystem.Theta theta(PetriTerms t, double[] x, double[] s2, double gateWidth, double guardWidth)
      As theta(PetriTerms, double[], double[], double), with a separate zero-variance width for the FLUID guards. A fluid guard is the same gate on a level: 1{f_c >= tau} closes to Phi((f_c - tau)/sd_c) and 1{f_c <= tau} to Phi((tau - f_c)/sd_c), and joins the inhibitor product, so a mode whose guard is closed runs no servers; it neither fires nor pumps. A fluid rate dependence h(f_c) multiplies the firing multiplier dep, evaluated at the mean level.
    • rates

      public static double[] rates(PetriTerms t, double[] x, double[] phi, double[] mu, PetriSystem.Theta th)
      The rate of every event column.
         kind 1  firing of mode j    single phase: rateBase*theta*dep
                                     multi  phase: rateBase*y(j,h)
         kind 2  internal phase change             rateBase*y(j,h)
         kind 3  exogenous arrival                 a constant
         kind 4  firing of an IMMEDIATE mode       phi_j, an algebraic unknown
         kind 5  the server latch                  mu_j, a free-sign unknown
         kind 6  fluid flow of mode j              rateBase*theta_j, per running server; dep does
                                                   not scale it, since it times the firing, not the flow
       
    • jacobian

      public static Matrix jacobian(PetriTerms t, PetriSystem.Theta th)
      Drift Jacobian A = D * dR/dX.

      This is what the Lyapunov equation of the linear noise approximation is written about, so it has to be the derivative of the SAME rate vector rates(jline.solvers.fluid.petri.PetriTerms, double[], double[], double[], jline.solvers.fluid.petri.PetriSystem.Theta) returns: a covariance solved about an inconsistent Jacobian is not the covariance of anything. THE VARIANCES ARE HELD.

    • isTimed

      public static boolean isTimed(PetriMode md)
      Whether a mode is timed, spelled once.