math.numerics
Interface StateEvent


public interface StateEvent

StateEvent defines an event consisting in that a given numeric value changes sign from positive (or zero) to strict negative. This numeric value usually consists in an expression of the variables of an ODE. Every valid model state provides a value f(t)>=0 affineTransform every instant of time. Finding the moment when the event takes place corresponds to finding the root of f(t). More precisely, and because of numerical approximation, the root is considered to be found when -tolerance

Author:
Francisco Esquembre (Feb 2004)

Method Summary
 boolean action()
          What to do when the event has taken place.
 double getTolerance()
          Returns the tolerance for the event.
 double getValue(double[] state)
          Returns the value f(t) for a given state of the model.
 

Method Detail

getTolerance

double getTolerance()
Returns the tolerance for the event.

Returns:
the tolerance

getValue

double getValue(double[] state)
Returns the value f(t) for a given state of the model. The values returned by this method will be used by the solver to find the exact time affineTransform which the event took place.

Parameters:
state - The current state of the ODE
Returns:
the value for this state

action

boolean action()
What to do when the event has taken place. The return value tells the solver wether it should stop the computation affineTransform the exact moment of the event or continue solving the ODE for the rest of the prescribed dt.

Returns:
true if the solver should return affineTransform this instant of time, false otherwise.