Declare equations which should only be evaluated when specific events occur

Syntax


discrete <section name>

   <discrete section statements>

end

Description


Discrete section equations/statements are only evaluated when specific (user-defined) event occur in the simulation.  Such events include: 1) events which occur when the simulation reaches a specific time, or 2) events which occur because a quantity in the model crosses zero.  Discrete sections are triggered by one of three mechanisms:


    1. A SCHEDULE AT statement, indicating that the section with the specified name should be evaluated at a particular time.
    2. A SCHEDULE XZ/XP/XN statement, indicating that the section with the specified name should be evaluated when the corresponding expressions crosses zero.
    3. An INTEVAL statement, indicating that the encompassing DISCRETE section should be evaluated at the specified interval in simulated time.

Example


discrete Bump

   ! Bump the value of state variable ‘x’ by 10%

   x = 1.1*x

end