Class Integrator

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

    public class Integrator
    extends DETransformer
    Output the discrete integral of the input. Inputs are multiplied by the time gap from the previous input and accumulated. Output is not generated until two inputs have been consumed.

    The output type of this actor is forced to be double.

    In postfire(), if an event is present on the reset port, this actor resets to its initial state, and will not output until two subsequent inputs have been consumed. This is useful if the input signal is switched on and off, in which case the time gap between events becomes large and would otherwise effect the value of the integral.

    The integrator performs linear interpolation between input events, where the output of the integrator follows the equation y[n] = y[n-1] + (x[n-1] + x[n])*dt/2 where dt is the time differential between events. This equates to the trapezoidal method of approximating a Riemann integral.

    Since:
    Ptolemy II 8.0
    Version:
    $Id$
    Author:
    Jeff C. Jensen
    See Also:
    Accumulator
    • Field Detail

      • reset

        public TypedIOPort reset
        The reset port, which has undeclared type. If this port receives a token, this actor resets to its initial state, and no output is generated until two inputs have been received.
      • initialValue

        public Parameter initialValue
        The value produced by the actor on its first iteration. The default value of this parameter is the double 0.0.