Package jline.solvers.fluid
Class LSODAExt
java.lang.Object
odesolver.LSODA
jline.solvers.fluid.LSODAExt
- All Implemented Interfaces:
org.apache.commons.math3.ode.FirstOrderIntegrator,org.apache.commons.math3.ode.ODEIntegrator
Extended LSODA solver that supports configurable maximum internal steps.
The upstream lsoda-java library hardcodes mxstep=1000000 inside the lsoda()
method, ignoring any reflection-based field setting. This subclass overrides
integrate() to call the public lsoda() method directly with the desired
mxstep value.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionLSODAExt(double minStep, double maxStep, double rtol, double atol, int meth, int miter, int maxSteps) Create an LSODAExt solver with configurable max steps. -
Method Summary
Modifier and TypeMethodDescriptionstatic longThe first negative istate code observed, or 0 if none.static longTotal integrate() calls since the last reset.static longCalls that returned normally with a negative istate, i.e.doubleintegrate(org.apache.commons.math3.ode.FirstOrderDifferentialEquations equations, double t0, double[] y0, double t, double[] yOut) the ODE integrating methodstatic voidMethods inherited from class odesolver.LSODA
addEventHandler, addEventHandler, addStepHandler, clearEventHandlers, clearStepHandlers, FirstOrderSystem, getCurrentSignedStepsize, getCurrentStepStart, getEvaluations, getEventHandlers, getJacobianEvaluations, getMaxComponent, getMaxEvaluations, getName, getStepHandlers, getStepsTaken, getTvec, getYvec, isForceStiff, lsoda, setForceStiff, setMaxEvaluations, setOutputTimes, setStopCondition
-
Constructor Details
-
LSODAExt
public LSODAExt(double minStep, double maxStep, double rtol, double atol, int meth, int miter, int maxSteps) Create an LSODAExt solver with configurable max steps.- Parameters:
minStep- minimum step size (absolute value)maxStep- maximum step size (absolute value)rtol- relative toleranceatol- absolute tolerancemeth- method flag (12 = nonstiff/stiff auto)miter- iteration method (5 = diagonal Jacobian)maxSteps- maximum number of internal steps (replaces hardcoded 1000000)
-
-
Method Details
-
getIntegrateCallCount
public static long getIntegrateCallCount()Total integrate() calls since the last reset. -
getNegativeIstateCount
public static long getNegativeIstateCount()Calls that returned normally with a negative istate, i.e. silent failures. -
getFirstNegativeIstate
public static long getFirstNegativeIstate()The first negative istate code observed, or 0 if none. -
resetIstateCounters
public static void resetIstateCounters() -
integrate
public double integrate(org.apache.commons.math3.ode.FirstOrderDifferentialEquations equations, double t0, double[] y0, double t, double[] yOut) Description copied from class:LSODAthe ODE integrating method- Specified by:
integratein interfaceorg.apache.commons.math3.ode.FirstOrderIntegrator- Overrides:
integratein classLSODA- Parameters:
equations- the definition of the ordinary differential equationst0- the initial value of ty0- the initial valuest- the output stationyOut- the array used to store the integrating result
-