Class MultistepIntegrator
- java.lang.Object
-
- org.apache.commons.math.ode.AbstractIntegrator
-
- org.apache.commons.math.ode.nonstiff.AdaptiveStepsizeIntegrator
-
- org.apache.commons.math.ode.MultistepIntegrator
-
- All Implemented Interfaces:
FirstOrderIntegrator
,ODEIntegrator
- Direct Known Subclasses:
AdamsIntegrator
public abstract class MultistepIntegrator extends AdaptiveStepsizeIntegrator
This class is the base class for multistep integrators for Ordinary Differential Equations.We define scaled derivatives si(n) at step n as:
s1(n) = h y'n for first derivative s2(n) = h2/2 y''n for second derivative s3(n) = h3/6 y'''n for third derivative ... sk(n) = hk/k! y(k)n for kth derivative
Rather than storing several previous steps separately, this implementation uses the Nordsieck vector with higher degrees scaled derivatives all taken at the same step (yn, s1(n) and rn) where rn is defined as:
rn = [ s2(n), s3(n) ... sk(n) ]T
(we omit the k index in the notation for clarity)Multistep integrators with Nordsieck representation are highly sensitive to large step changes because when the step is multiplied by a factor a, the kth component of the Nordsieck vector is multiplied by ak and the last components are the least accurate ones. The default max growth factor is therefore set to a quite low value: 21/order.
- Since:
- 2.0
- See Also:
AdamsBashforthIntegrator
,AdamsMoultonIntegrator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MultistepIntegrator.NordsieckTransformer
Transformer used to convert the first step to Nordsieck representation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getMaxGrowth()
Get the maximal growth factor for stepsize control.double
getMinReduction()
Get the minimal reduction factor for stepsize control.double
getSafety()
Get the safety factor for stepsize control.ODEIntegrator
getStarterIntegrator()
Get the starter integrator.void
setMaxGrowth(double maxGrowth)
Set the maximal growth factor for stepsize control.void
setMinReduction(double minReduction)
Set the minimal reduction factor for stepsize control.void
setSafety(double safety)
Set the safety factor for stepsize control.void
setStarterIntegrator(FirstOrderIntegrator starterIntegrator)
Set the starter integrator.-
Methods inherited from class org.apache.commons.math.ode.nonstiff.AdaptiveStepsizeIntegrator
getCurrentStepStart, getMaxStep, getMinStep, initializeStep, integrate, setInitialStepSize
-
Methods inherited from class org.apache.commons.math.ode.AbstractIntegrator
addEventHandler, addStepHandler, clearEventHandlers, clearStepHandlers, computeDerivatives, getCurrentSignedStepsize, getEvaluations, getEventHandlers, getMaxEvaluations, getName, getStepHandlers, setMaxEvaluations
-
-
-
-
Method Detail
-
getStarterIntegrator
public ODEIntegrator getStarterIntegrator()
Get the starter integrator.- Returns:
- starter integrator
-
setStarterIntegrator
public void setStarterIntegrator(FirstOrderIntegrator starterIntegrator)
Set the starter integrator.The various step and event handlers for this starter integrator will be managed automatically by the multi-step integrator. Any user configuration for these elements will be cleared before use.
- Parameters:
starterIntegrator
- starter integrator
-
getMinReduction
public double getMinReduction()
Get the minimal reduction factor for stepsize control.- Returns:
- minimal reduction factor
-
setMinReduction
public void setMinReduction(double minReduction)
Set the minimal reduction factor for stepsize control.- Parameters:
minReduction
- minimal reduction factor
-
getMaxGrowth
public double getMaxGrowth()
Get the maximal growth factor for stepsize control.- Returns:
- maximal growth factor
-
setMaxGrowth
public void setMaxGrowth(double maxGrowth)
Set the maximal growth factor for stepsize control.- Parameters:
maxGrowth
- maximal growth factor
-
getSafety
public double getSafety()
Get the safety factor for stepsize control.- Returns:
- safety factor
-
setSafety
public void setSafety(double safety)
Set the safety factor for stepsize control.- Parameters:
safety
- safety factor
-
-