Class Integrator

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, ContinuousStatefulComponent, ContinuousStepSizeController, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class Integrator
    extends ContinuousIntegrator
    The integrator in the continuous domain.

    The derivative port receives the derivative of the state of the integrator with respect to time. The state output port shows the state of the integrator. So an ordinary differential equation (ODE), dx/dt = f(x, t), can be built as follows:

                +---------------+
         dx/dt  |               |   x
     +--------->|   Integrator  |---------+----->
     |          |               |         |
     |          +----^-----^----+         |
     |                                    |
     |             |---------|            |
     +-------------| f(x, t) |<-----------+
                   |---------|
     

    An integrator also has a port-parameter called initialState. The parameter provides the initial state for integration during the initialization stage of execution. If during execution an input token is provided on the port, then the state of the integrator will be reset at that time to the value of the token. The default value of the parameter is 0.0.

    An integrator also has an input port named impulse. When present, a token at the impulse input port is interpreted as the weight of a Dirac delta function. It cause an instantaneous increment or decrement to the state. If both impulse and initialState have data, then initialState dominates.

    An integrator can generate an output (its current state) before the derivative input is known, and hence can be used in feedback loops like that above without creating a causality loop. The impulse and initialState inputs ports must be known, however, before an output can be produced. The effect of data at these inputs on the output is instantaneous.

    For different ODE solving methods, the functionality of an integrator may be different. The delegation and strategy design patterns are used in this class, the abstract ODESolver class, and the concrete ODE solver classes. Some solver-dependent methods of integrators delegate to the concrete ODE solvers.

    An integrator can possibly have several auxiliary variables for the the ODE solvers to use. The ODE solver class provides the number of variables needed for that particular solver. The auxiliary variables can be set and get by setAuxVariables() and getAuxVariables() methods.

    This class is based on the CTIntegrator by Jie Liu.

    Since:
    Ptolemy II 6.0
    Version:
    $Id$
    Author:
    Haiyang Zheng and Edward A. Lee
    Pt.AcceptedRating:
    Green (eal)
    Pt.ProposedRating:
    Green (hyzheng)