Class BogackiShampine23Integrator
- All Implemented Interfaces:
org.apache.commons.math3.ode.FirstOrderIntegrator,org.apache.commons.math3.ode.ODEIntegrator
ode23 implements.
LINE's fluid solver selects a fast and an accurate non-stiff integrator by
tolerance, mirroring ode_solve.m, whose fast handle is @ode23.
Apache Commons Math 3.6.1 ships no order-3 embedded Runge-Kutta method, so the
JAR previously stood HighamHall54Integrator in that slot and ran the
fast arm at order 5(4). This class closes that order mismatch.
The Butcher tableau is the one published in Bogacki and Shampine, "A 3(2) pair of Runge-Kutta formulas", Appl. Math. Lett. 2(4):321-325, 1989: three stages advance the solution and a fourth, first-same-as-last stage evaluates the drift at the new point, serving both the second-order error estimate and the first stage of the next step.
This class lives in the Commons Math package because
EmbeddedRungeKuttaIntegrator's constructor takes a
RungeKuttaStepInterpolator, which is package private and therefore not
nameable from any other package; the code itself is original to LINE.
- Since:
- 1.0
- See Also:
-
BogackiShampine23StepInterpolator
-
Field Summary
Fields inherited from class org.apache.commons.math3.ode.nonstiff.AdaptiveStepsizeIntegrator
mainSetDimension, scalAbsoluteTolerance, scalRelativeTolerance, vecAbsoluteTolerance, vecRelativeToleranceFields inherited from class org.apache.commons.math3.ode.AbstractIntegrator
isLastStep, resetOccurred, stepHandlers, stepSize, stepStart -
Constructor Summary
ConstructorsConstructorDescriptionBogackiShampine23Integrator(double minStep, double maxStep, double[] vecAbsoluteTolerance, double[] vecRelativeTolerance) Builds an integrator with per-component tolerances.BogackiShampine23Integrator(double minStep, double maxStep, double scalAbsoluteTolerance, double scalRelativeTolerance) Builds an integrator with scalar tolerances. -
Method Summary
Modifier and TypeMethodDescriptionprotected doubleestimateError(double[][] yDotK, double[] y0, double[] y1, double h) intgetOrder()Returns the order of the propagated solution, which sets the step-size control exponent, matching the1/3powerode23uses.Methods inherited from class org.apache.commons.math3.ode.nonstiff.EmbeddedRungeKuttaIntegrator
getMaxGrowth, getMinReduction, getSafety, integrate, setMaxGrowth, setMinReduction, setSafetyMethods inherited from class org.apache.commons.math3.ode.nonstiff.AdaptiveStepsizeIntegrator
filterStep, getCurrentStepStart, getMaxStep, getMinStep, initializeStep, resetInternalState, sanityChecks, setInitialStepSize, setStepSizeControl, setStepSizeControlMethods inherited from class org.apache.commons.math3.ode.AbstractIntegrator
acceptStep, addEventHandler, addEventHandler, addStepHandler, clearEventHandlers, clearStepHandlers, computeDerivatives, getCounter, getCurrentSignedStepsize, getEvaluations, getEvaluationsCounter, getEventHandlers, getExpandable, getMaxEvaluations, getName, getStepHandlers, initIntegration, integrate, setEquations, setMaxEvaluations, setStateInitialized
-
Constructor Details
-
BogackiShampine23Integrator
public BogackiShampine23Integrator(double minStep, double maxStep, double scalAbsoluteTolerance, double scalRelativeTolerance) Builds an integrator with scalar tolerances.- Parameters:
minStep- minimal step, the sign is irrelevantmaxStep- maximal step, the sign is irrelevantscalAbsoluteTolerance- allowed absolute errorscalRelativeTolerance- allowed relative error
-
BogackiShampine23Integrator
public BogackiShampine23Integrator(double minStep, double maxStep, double[] vecAbsoluteTolerance, double[] vecRelativeTolerance) Builds an integrator with per-component tolerances.- Parameters:
minStep- minimal step, the sign is irrelevantmaxStep- maximal step, the sign is irrelevantvecAbsoluteTolerance- allowed absolute error, one entry per componentvecRelativeTolerance- allowed relative error, one entry per component
-
-
Method Details
-
getOrder
public int getOrder()Returns the order of the propagated solution, which sets the step-size control exponent, matching the1/3powerode23uses.- Specified by:
getOrderin classorg.apache.commons.math3.ode.nonstiff.EmbeddedRungeKuttaIntegrator- Returns:
- 3
-
estimateError
protected double estimateError(double[][] yDotK, double[] y0, double[] y1, double h) - Specified by:
estimateErrorin classorg.apache.commons.math3.ode.nonstiff.EmbeddedRungeKuttaIntegrator
-