public class StepsizeHelper extends Object
Constructor and Description |
---|
StepsizeHelper(double minStep,
double maxStep,
double[] vecAbsoluteTolerance,
double[] vecRelativeTolerance)
Simple constructor..
|
StepsizeHelper(double minStep,
double maxStep,
double scalAbsoluteTolerance,
double scalRelativeTolerance)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
filterStep(double h,
boolean forward,
boolean acceptSmall)
Filter the integration step.
|
<T extends CalculusFieldElement<T>> |
filterStep(T h,
boolean forward,
boolean acceptSmall)
Filter the integration step.
|
double |
getDummyStepsize()
Get a dummy step size.
|
double |
getInitialStep()
Get the initial step.
|
int |
getMainSetDimension()
Get the main set dimension.
|
double |
getMaxStep()
Get the maximal step.
|
double |
getMinStep()
Get the minimal step.
|
double |
getRelativeTolerance(int i)
Get the relative tolerance for one component.
|
double |
getTolerance(int i,
double scale)
Get the tolerance for one component.
|
<T extends CalculusFieldElement<T>> |
getTolerance(int i,
T scale)
Get the tolerance for one component.
|
void |
setInitialStepSize(double initialStepSize)
Set the initial step size.
|
protected void |
setMainSetDimension(int mainSetDimension)
Set main set dimension.
|
public StepsizeHelper(double minStep, double maxStep, double scalAbsoluteTolerance, double scalRelativeTolerance)
minStep
- minimal step (sign is irrelevant, regardless of
integration direction, forward or backward), the last step can
be smaller than thismaxStep
- maximal step (sign is irrelevant, regardless of
integration direction, forward or backward), the last step can
be smaller than thisscalAbsoluteTolerance
- allowed absolute errorscalRelativeTolerance
- allowed relative errorpublic StepsizeHelper(double minStep, double maxStep, double[] vecAbsoluteTolerance, double[] vecRelativeTolerance)
minStep
- minimal step (sign is irrelevant, regardless of
integration direction, forward or backward), the last step can
be smaller than thismaxStep
- maximal step (sign is irrelevant, regardless of
integration direction, forward or backward), the last step can
be smaller than thisvecAbsoluteTolerance
- allowed absolute errorvecRelativeTolerance
- allowed relative errorprotected void setMainSetDimension(int mainSetDimension) throws MathIllegalArgumentException
mainSetDimension
- dimension of the main setMathIllegalArgumentException
- if adaptive step size integrators
tolerance arrays dimensions are not compatible with equations settingspublic int getMainSetDimension()
public double getRelativeTolerance(int i)
i
- component to selectpublic double getTolerance(int i, double scale)
i
- component to selectscale
- scale factor for relative tolerance (i.e. y[i])public <T extends CalculusFieldElement<T>> T getTolerance(int i, T scale)
T
- type of the field elementsi
- component to selectscale
- scale factor for relative tolerance (i.e. y[i])public double filterStep(double h, boolean forward, boolean acceptSmall) throws MathIllegalArgumentException
h
- signed stepforward
- forward integration indicatoracceptSmall
- if true, steps smaller than the minimal value
are silently increased up to this value, if false such small
steps generate an exceptionMathIllegalArgumentException
- if the step is too small and acceptSmall is falsepublic <T extends CalculusFieldElement<T>> T filterStep(T h, boolean forward, boolean acceptSmall) throws MathIllegalArgumentException
T
- type of the field elementsh
- signed stepforward
- forward integration indicatoracceptSmall
- if true, steps smaller than the minimal value
are silently increased up to this value, if false such small
steps generate an exceptionMathIllegalArgumentException
- if the step is too small and acceptSmall is falsepublic void setInitialStepSize(double initialStepSize)
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.
initialStepSize
- 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)public double getInitialStep()
public double getMinStep()
public double getMaxStep()
public double getDummyStepsize()
getMinStep()
and getMaxStep()
Copyright © 2016-2021 CS GROUP. All rights reserved.