Package jline.solvers

Class SolverOptions.ODESolvers

java.lang.Object
jline.solvers.SolverOptions.ODESolvers
Enclosing class:
SolverOptions

public static class SolverOptions.ODESolvers extends Object
Configuration for ordinary differential equation solvers used in fluid analysis. Contains different integrators optimized for various problem characteristics.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    org.apache.commons.math3.ode.FirstOrderIntegrator
    Accurate integrator for non-stiff problems
    Accurate integrator for stiff problems
    org.apache.commons.math3.ode.FirstOrderIntegrator
    Fast integrator for non-stiff problems
    Fast integrator for stiff problems
    double
    Maximum step size for ODE integration
    double
    Minimum step size for ODE integration
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    copy(double tol)
    Returns a copy for a cloned SolverOptions.
    org.apache.commons.math3.ode.FirstOrderIntegrator
    integratorFor(double t0, double t1, double tol, boolean fast)
    The non-stiff integrator to use over [t0,t1], under the same odeset MaxStep default as stiffIntegratorFor(double, double, double, boolean).
    void
    setDefaults(double minStep, double maxStep, double tol)
    Installs the built-in integrators, mirroring MATLAB SolverOptions.m: fastOdeSolver/accurateOdeSolver are the non-stiff pair (@ode23 / @ode113 there, their adaptive Runge-Kutta and Adams-Moulton counterparts here) and the stiff pair is LSODA, as @ode15s is there.
    stiffIntegratorFor(double t0, double t1, double tol, boolean fast)
    The stiff integrator to use over [t0,t1].

    Methods inherited from class java.lang.Object

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

    • odeminstep

      public double odeminstep
      Minimum step size for ODE integration
    • odemaxstep

      public double odemaxstep
      Maximum step size for ODE integration
    • fastODESolver

      public org.apache.commons.math3.ode.FirstOrderIntegrator fastODESolver
      Fast integrator for non-stiff problems
    • accurateODESolver

      public org.apache.commons.math3.ode.FirstOrderIntegrator accurateODESolver
      Accurate integrator for non-stiff problems
    • fastStiffODESolver

      public LSODA fastStiffODESolver
      Fast integrator for stiff problems
    • accurateStiffODESolver

      public LSODA accurateStiffODESolver
      Accurate integrator for stiff problems
  • Constructor Details

    • ODESolvers

      public ODESolvers()
  • Method Details

    • setDefaults

      public void setDefaults(double minStep, double maxStep, double tol)
      Installs the built-in integrators, mirroring MATLAB SolverOptions.m: fastOdeSolver/accurateOdeSolver are the non-stiff pair (@ode23 / @ode113 there, their adaptive Runge-Kutta and Adams-Moulton counterparts here) and the stiff pair is LSODA, as @ode15s is there.
      Parameters:
      minStep - minimum step size
      maxStep - maximum step size
      tol - absolute and relative tolerance
    • stiffIntegratorFor

      public LSODA stiffIntegratorFor(double t0, double t1, double tol, boolean fast)
      The stiff integrator to use over [t0,t1].

      MATLAB's odeset leaves MaxStep at 0.1*|tf-t0| unless the caller pins it, and every MATLAB fluid ODE call but solver_fluid_kp takes that default. The JAR left the step unbounded, and an unbounded step lets LSODA's Nordsieck interpolation drift off a fixed point by ~1e-6 instead of settling on it, so a closed model's throughputs stopped balancing flow. The bound is applied only to the built-in integrators and only while odemaxstep is infinite, so an integrator or a maximum step the caller supplied is left alone.

      Parameters:
      t0 - window start
      t1 - window end
      tol - absolute and relative tolerance
      fast - true for the coarse-tolerance integrator
      Returns:
      the integrator to drive over this window
    • integratorFor

      public org.apache.commons.math3.ode.FirstOrderIntegrator integratorFor(double t0, double t1, double tol, boolean fast)
      The non-stiff integrator to use over [t0,t1], under the same odeset MaxStep default as stiffIntegratorFor(double, double, double, boolean).
      Parameters:
      t0 - window start
      t1 - window end
      tol - absolute and relative tolerance
      fast - true for the coarse-tolerance integrator
      Returns:
      the integrator to drive over this window
    • copy

      public SolverOptions.ODESolvers copy(double tol)
      Returns a copy for a cloned SolverOptions. Integrators carry mutable state (step handlers, and LSODA's whole working set), so each copy gets its own instance of every DEFAULT integrator -- but an integrator the caller assigned is carried over as-is, because there is no way to rebuild it and silently replacing it would discard the caller's choice.
      Parameters:
      tol - tolerance for the rebuilt default integrators
      Returns:
      the copy