Previous Page Parent Page Next Page TOC

Discontinuities

Discontinuities

Discontinuities can be introduced into the mathematical model through nodes of type CHOICE|IF, FUNCTION|CEIL, FUNCTION|FLOOR, and OPERATOR|MODULUS. These discontinuities are in general not handled correctly in any integrator as they might be missed or recognized to late based on the internals of the integration method. To deal with this issue we need to inform the integrator whenever a discontinuous change occurs. We can use the existing event and root finding method to achieve this. What is missing is the creation of these events.

Algorithm

  1. Create the Math Model and its dependency tree.
  2. Determine all nodes which may introduce discontinuities in expressions for objects and event triggers.
  3. For each node create an object of type discontinuity where the associated expression's root node is derived from the discontinuous node.
  4. We replace the original discontinuous node with a node pointing to the value of the object created in previous step.
  5. Create events for the each discontinuity object.
Trigger Expression for Events created by Dicontinuities
Node Type Event Trigger
CHOICE | IF If expression
FUNCTION | CEIL sin($\pi$ x) > 0   (sin is zero whenever x is an integer)
FUNCTION | FLOOR sin($\pi$ x) > 0
OPERATOR | MODULUS sin($\pi$ x) > 0 || sin($\pi$ y) > 0


  1. For each node of type CHOICE | IF, FUNCTION | CEIL, and FUNCTION | FLOOR we create a mathematical object of type Discontinuous, which is calculated by the expression derived from the discontinuous node.
  2. For each discontinuous node created in step 1), which depends on state values of type ODE, ReactionIndependent, and ReactionDependent and which is used in the calculation of rates of type ODE, ReactionIndependent, and ReactionDependent we add an event.