Class FluidODEsExporter

java.lang.Object
jline.solvers.fluid.FluidODEsExporter

public class FluidODEsExporter extends Object
Symbolic export of the mean-field ODE system integrated by SolverFluid. Mirrors the MATLAB implementation in solver_fluid_symodes.m and SolverFLD/exportODEs.m so that all codebases emit the same LaTeX document for a given model. Two representations are produced: form = "W": dx/dt = W'*theta(x) + lambda (methods: default, matrix, pnorm) form = "J": dx/dt = J*r(x) (methods: closing, statedep, softmin)
  • Method Details

    • build

      public static FluidODEsExporter.SymODEs build(NetworkStruct sn, SolverOptions options)
      Build the structural description of the ODE system for the method set in the solver options.
    • render

      public static String render(FluidODEsExporter.SymODEs sys, SolverOptions options, String modelName, String notation)
      Render the LaTeX document for the given system.
      Parameters:
      sys - structural description built by build()
      options - solver options (hide_immediate remark)
      modelName - model name shown in the document
      notation - "scalar" or "matrix"
      Returns:
      LaTeX source
    • stateVariables

      public static List<String> stateVariables(FluidODEsExporter.SymODEs sys)
      State variable names of the exported drift, x1 ... xn.
      Parameters:
      sys - the ODE system
      Returns:
      the variable names
    • symbolicDrift

      public static List<String> symbolicDrift(FluidODEsExporter.SymODEs sys)
      Right-hand side of the ODE system as expression strings, one per state variable, in the format the symbolic backend parses.

      ONLY SMOOTH DRIFTS ARE EXPORTED. The default, matrix, closing and statedep methods scale rates by min(n_i, S_i), which is not differentiable at n_i = S_i, so their Jacobian does not exist there; emitting a one-sided derivative would be a silent lie exactly at the regime switch that matters. Use the p-norm smoothing (options.config.pstar) or the softmin method.

      FineTol is carried in exactly the places the integrated systems put it, and nowhere else: the p-norm drift offsets the station total, the softmin drift offsets the phase-weighted total but not the plain station total that feeds the softmin, and the closing rates offset neither. Mirrors @SolverFLD/getSymbolicDrift.m.

      Parameters:
      sys - the ODE system
      Returns:
      one expression per state variable
      Throws:
      RuntimeException - if the drift is not differentiable