|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.ode.SwitchState
class SwitchState
This class handles the state for one switching function
during integration steps.
Each time the integrator proposes a step, the switching function should be checked. This class handles the state of one function during one integration step, with references to the state at the end of the preceding step. This information is used to determine if the function should trigger an event or not during the proposed step (and hence the step should be reduced to ensure the event occurs at a bound rather than inside the step).
Field Summary | |
---|---|
private double |
convergence
Convergence threshold for event localisation. |
private SwitchingFunction |
function
Switching function. |
private double |
g0
Value of the switching function at the beginning of the step. |
private boolean |
g0Positive
Simulated sign of g0 (we cheat when crossing events). |
private boolean |
increasing
Variation direction around pending event. |
private double |
maxCheckInterval
Maximal time interval between switching function checks. |
private int |
maxIterationCount
Upper limit in the iteration count for event localisation. |
private int |
nextAction
Next action indicator. |
private boolean |
pendingEvent
Indicator of event expected during the step. |
private double |
pendingEventTime
Occurrence time of the pending event. |
private double |
previousEventTime
Occurrence time of the previous event. |
private static long |
serialVersionUID
Serializable version identifier. |
private double |
t0
Time at the beginning of the step. |
Constructor Summary | |
---|---|
SwitchState(SwitchingFunction function,
double maxCheckInterval,
double convergence,
int maxIterationCount)
Simple constructor. |
Method Summary | |
---|---|
boolean |
evaluateStep(StepInterpolator interpolator)
Evaluate the impact of the proposed step on the switching function. |
double |
getEventTime()
Get the occurrence time of the event triggered in the current step. |
void |
reinitializeBegin(double t0,
double[] y0)
Reinitialize the beginning of the step. |
boolean |
reset(double t,
double[] y)
Let the switching function reset the state if it wants. |
void |
stepAccepted(double t,
double[] y)
Acknowledge the fact the step has been accepted by the integrator. |
boolean |
stop()
Check if the integration should be stopped at the end of the current step. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private SwitchingFunction function
private double maxCheckInterval
private double convergence
private int maxIterationCount
private double t0
private double g0
private boolean g0Positive
private boolean pendingEvent
private double pendingEventTime
private double previousEventTime
private boolean increasing
private int nextAction
Constructor Detail |
---|
public SwitchState(SwitchingFunction function, double maxCheckInterval, double convergence, int maxIterationCount)
function
- switching functionmaxCheckInterval
- maximal time interval between switching
function checks (this interval prevents missing sign changes in
case the integration steps becomes very large)convergence
- convergence threshold in the event time searchmaxIterationCount
- upper limit of the iteration count in
the event time searchMethod Detail |
---|
public void reinitializeBegin(double t0, double[] y0) throws FunctionEvaluationException
t0
- value of the independent time variable at the
beginning of the stepy0
- array containing the current value of the state vector
at the beginning of the step
FunctionEvaluationException
- if the switching function
value cannot be evaluated at the beginning of the steppublic boolean evaluateStep(StepInterpolator interpolator) throws DerivativeException, FunctionEvaluationException, ConvergenceException
interpolator
- step interpolator for the proposed step
DerivativeException
- if the interpolator fails to
compute the function somewhere within the step
FunctionEvaluationException
- if the switching function
cannot be evaluated
ConvergenceException
- if an event cannot be locatedpublic double getEventTime()
public void stepAccepted(double t, double[] y) throws FunctionEvaluationException
t
- value of the independent time variable at the
end of the stepy
- array containing the current value of the state vector
at the end of the step
FunctionEvaluationException
- if the value of the switching
function cannot be evaluatedpublic boolean stop()
public boolean reset(double t, double[] y)
t
- value of the independent time variable at the
beginning of the next stepy
- array were to put the desired state vector at the beginning
of the next step
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |