These algorithms perform integration with stepsize control, which means the user does not specify the integration step but rather a tolerance on error. The error threshold is computed as
threshold_i = absTol_i + relTol_i * max (abs (ym), abs (ym+1))where absTol_i is the absolute tolerance for component i of the state vector and relTol_i is the relative tolerance for the same component. The user can also use only two scalar values absTol and relTol which will be used for all components.
If the Ordinary Differential Equations is an extended ODE rather than a basic ODE, then
only the primary part
of the state vector is used for stepsize control, not the complete state vector.
If the estimated error for ym+1 is such that
sqrt((sum (errEst_i / threshold_i)^2 ) / n) < 1(where n is the main set dimension) then the step is accepted, otherwise the step is rejected and a new attempt is made with a new stepsize.
| Modifier and Type | Field and Description |
|---|---|
| private double | initialStep
User supplied initial step. |
| protected int | mainSetDimension
Main set dimension. |
| private double | maxStep
Maximal step. |
| private double | minStep
Minimal step. |
| protected double | scalAbsoluteTolerance
Allowed absolute scalar error. |
| protected double | scalRelativeTolerance
Allowed relative scalar error. |
| protected double[] | vecAbsoluteTolerance
Allowed absolute vectorial error. |
| protected double[] | vecRelativeTolerance
Allowed relative vectorial error. |
| Access | Constructor and Description |
|---|---|
| public | AdaptiveStepsizeIntegrator(final String
name of the method name, final double minimal step (sign is irrelevant, regardless of
integration direction, forward or backward), the last step can
be smaller than this minStep, final double maximal step (sign is irrelevant, regardless of
integration direction, forward or backward), the last step can
be smaller than this maxStep, final double allowed absolute error scalAbsoluteTolerance, final double allowed relative error scalRelativeTolerance)Build an integrator with the given stepsize bounds. |
| public | AdaptiveStepsizeIntegrator(final String
name of the method name, final double minimal step (sign is irrelevant, regardless of
integration direction, forward or backward), the last step can
be smaller than this minStep, final double maximal step (sign is irrelevant, regardless of
integration direction, forward or backward), the last step can
be smaller than this maxStep, final double[] allowed absolute error vecAbsoluteTolerance, final double[] allowed relative error vecRelativeTolerance)Build an integrator with the given stepsize bounds. |
| Modifier and Type | Method and Description |
|---|---|
| protected double | Returns: a bounded integration step (h if no bound is reach, or a bounded value)signed step h, final boolean forward integration indicator forward, final boolean if true, steps smaller than the minimal value
are silently increased up to this value, if false such small
steps generate an exception acceptSmall)Filter the integration step. |
| public double | getCurrentStepStart()
Overrides org. Implements org. Get the current value of the step start time ti. |
| public double | |
| public double | |
| public double | Returns: first integration stepforward integration indicator forward, final int order of the method order, final double[] scaling vector for the state vector (can be shorter than state vector) scale, final double start time t0, final double[] state vector at t0 y0, final double[] first time derivative of y0 yDot0, final double[] work array for a state vector y1, final double[] work array for the first time derivative of y1 yDot1)Initialize the integration step. |
| public abstract void | integrate(ExpandableStatefulODE
complete set of differential equations to integrate equations, double target time for the integration
(can be set to a value smaller than t)t0 for backward integration)Implements abstract org. Integrate a set of differential equations up to the given time. |
| protected void | |
| protected void | sanityChecks(final ExpandableStatefulODE
set of differential equations equations, final double target time for the integration t)Overrides org. Check the integration span. |
| public void | setInitialStepSize(final double
initial step size to use (must be positive even
for backward integration ; providing a negative value or a value
outside of the min/max step interval will lead the integrator to
ignore the value and compute the initial step size by itself) initialStepSize)Set the initial step size. |
| public void | setStepSizeControl(final double
minimal step (must be positive even for backward
integration), the last step can be smaller than this minimalStep, final double maximal step (must be positive even for backward
integration) maximalStep, final double allowed absolute error absoluteTolerance, final double allowed relative error relativeTolerance)Set the adaptive step size control parameters. |
| public void | setStepSizeControl(final double
minimal step (must be positive even for backward
integration), the last step can be smaller than this minimalStep, final double maximal step (must be positive even for backward
integration) maximalStep, final double[] allowed absolute error absoluteTolerance, final double[] allowed relative error relativeTolerance)Set the adaptive step size control parameters. |
| initialStep | back to summary |
|---|---|
| private double initialStep User supplied initial step. | |
| mainSetDimension | back to summary |
|---|---|
| protected int mainSetDimension Main set dimension. | |
| maxStep | back to summary |
|---|---|
| private double maxStep Maximal step. | |
| minStep | back to summary |
|---|---|
| private double minStep Minimal step. | |
| scalAbsoluteTolerance | back to summary |
|---|---|
| protected double scalAbsoluteTolerance Allowed absolute scalar error. | |
| scalRelativeTolerance | back to summary |
|---|---|
| protected double scalRelativeTolerance Allowed relative scalar error. | |
| vecAbsoluteTolerance | back to summary |
|---|---|
| protected double[] vecAbsoluteTolerance Allowed absolute vectorial error. | |
| vecRelativeTolerance | back to summary |
|---|---|
| protected double[] vecRelativeTolerance Allowed relative vectorial error. | |
| AdaptiveStepsizeIntegrator | back to summary |
|---|---|
| public AdaptiveStepsizeIntegrator(final String name, final double minStep, final double maxStep, final double scalAbsoluteTolerance, final double scalRelativeTolerance) Build an integrator with the given stepsize bounds. The default step handler does nothing.
| |
| AdaptiveStepsizeIntegrator | back to summary |
|---|---|
| public AdaptiveStepsizeIntegrator(final String name, final double minStep, final double maxStep, final double[] vecAbsoluteTolerance, final double[] vecRelativeTolerance) Build an integrator with the given stepsize bounds. The default step handler does nothing.
| |
| filterStep | back to summary |
|---|---|
| protected double filterStep(final double h, final boolean forward, final boolean acceptSmall) throws NumberIsTooSmallException Filter the integration step.
| |
| getCurrentStepStart | back to summary |
|---|---|
| public double getCurrentStepStart() Overrides org. Implements org. Doc from org. Get the current value of the step start time ti. This method can be called during integration (typically by
the object implementing the The result is undefined if the method is called outside of
calls to
| |
| getMaxStep | back to summary |
|---|---|
| public double getMaxStep() Get the maximal step.
| |
| getMinStep | back to summary |
|---|---|
| public double getMinStep() Get the minimal step.
| |
| initializeStep | back to summary |
|---|---|
| public double initializeStep(final boolean forward, final int order, final double[] scale, final double t0, final double[] y0, final double[] yDot0, final double[] y1, final double[] yDot1) throws MaxCountExceededException, DimensionMismatchException Initialize the integration step.
| |
| integrate | back to summary |
|---|---|
| public abstract void integrate(ExpandableStatefulODE equations, double t) throws NumberIsTooSmallException, DimensionMismatchException, MaxCountExceededException, NoBracketingException Implements abstract org. Doc from org. Integrate a set of differential equations up to the given time. This method solves an Initial Value Problem (IVP). The set of differential equations is composed of a main set, which can be extended by some sets of secondary equations. The set of equations must be already set up with initial time and partial states. At integration completion, the final time and partial states will be available in the same object. Since this method stores some internal state variables made
available in its public interface during integration (
| |
| resetInternalState | back to summary |
|---|---|
| protected void resetInternalState() Reset internal state to dummy values. | |
| sanityChecks | back to summary |
|---|---|
| protected void sanityChecks(final ExpandableStatefulODE equations, final double t) throws DimensionMismatchException, NumberIsTooSmallException Overrides org. Doc from org. Check the integration span.
| |
| setInitialStepSize | back to summary |
|---|---|
| public void setInitialStepSize(final double initialStepSize) Set the initial step size. This method allows the user to specify an initial positive step size instead of letting the integrator guess it by itself. If this method is not called before integration is started, the initial step size will be estimated by the integrator.
| |
| setStepSizeControl | back to summary |
|---|---|
| public void setStepSizeControl(final double minimalStep, final double maximalStep, final double absoluteTolerance, final double relativeTolerance) Set the adaptive step size control parameters.
A side effect of this method is to also reset the initial
step so it will be automatically computed by the integrator
if
| |
| setStepSizeControl | back to summary |
|---|---|
| public void setStepSizeControl(final double minimalStep, final double maximalStep, final double[] absoluteTolerance, final double[] relativeTolerance) Set the adaptive step size control parameters.
A side effect of this method is to also reset the initial
step so it will be automatically computed by the integrator
if
| |