ptolemy.domains.ct.lib
Class Integrator

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.InstantiableNamedObj
          extended byptolemy.kernel.Entity
              extended byptolemy.kernel.ComponentEntity
                  extended byptolemy.actor.AtomicActor
                      extended byptolemy.actor.TypedAtomicActor
                          extended byptolemy.domains.ct.kernel.CTBaseIntegrator
                              extended byptolemy.domains.ct.lib.Integrator
All Implemented Interfaces:
Actor, Changeable, java.lang.Cloneable, CTDynamicActor, CTStatefulActor, CTStepSizeControlActor, Debuggable, DebugListener, Derivable, Executable, Instantiable, ModelErrorHandler, MoMLExportable, Nameable, java.io.Serializable, TimedActor, TypedActor

public class Integrator
extends CTBaseIntegrator

An integrator in the continuous time (CT) domain. This actor has one input port and one output port. Conceptually, the input is the derivative of the output w.r.t. time. So an ordinary differential equation dx/dt = f(x, t) can be built by:

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

An integrator is a dynamic actor that can emit a token (the state) without knowing the input. An integrator is a step size control actor that can control the accuracy of the ODE solution by adjusting step sizes. An integrator has memory, which is its state.

An integrator has one parameter: the initialState. At the initialization stage of the simulation, the state of the integrator is set to the initial state. Changes of the initialState parameter are ignored after the execution starts, unless the initialize() method is called again. The default value of the parameter is 0.0 of type DoubleToken.

To help solving the ODE, a set of variables are used:
state: This is the value of the state variable at a time point, which has beed confirmed by all the step size control actors. tentative state: This is the value of the state variable which has not been confirmed. It is a starting point for other actors to estimate the accuracy of this integration step. history: The previous states and their derivatives. History may be used by multistep methods.

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

An integrator can possibly have several auxiliary variables for the the ODE solvers to use. The number of the auxiliary variables is checked before each iteration. 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 is a wrapper for the CTBaseIntegrator class.

Since:
Ptolemy II 0.3
Version:
$Id: Integrator.java,v 1.26 2004/04/13 03:27:26 cxh Exp $
Author:
Jie Liu
See Also:
CTBaseIntegrator, Serialized Form
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (liuj)

Nested Class Summary
 
Nested classes inherited from class ptolemy.domains.ct.kernel.CTBaseIntegrator
CTBaseIntegrator.History
 
Nested classes inherited from class ptolemy.kernel.Entity
Entity.ContainedObjectsIterator
 
Field Summary
 
Fields inherited from class ptolemy.domains.ct.kernel.CTBaseIntegrator
_history, initialState, input, output
 
Fields inherited from class ptolemy.actor.AtomicActor
_stopRequested
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Constructor Summary
Integrator(CompositeEntity container, java.lang.String name)
          Construct an integrator.
 
Methods inherited from class ptolemy.domains.ct.kernel.CTBaseIntegrator
clearHistory, emitTentativeOutputs, fire, getAuxVariables, getDerivative, getHistory, getHistoryCapacity, getState, getTentativeState, getValidHistoryCount, goToMarkedState, initialize, isThisStepAccurate, markState, postfire, predictedStepSize, prefire, pruneDependencies, refinedStepSize, setAuxVariables, setHistoryCapacity, setTentativeDerivative, setTentativeState
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, attributeTypeChanged, clone, newPort, typeConstraintList
 
Methods inherited from class ptolemy.actor.AtomicActor
_createReceivers, clone, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, iterate, newReceiver, outputPortList, preinitialize, removeDependency, setContainer, stop, stopFire, terminate, wrapup
 
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, propagateExistence, setName
 
Methods inherited from class ptolemy.kernel.Entity
_description, _exportMoMLContents, _removePort, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName, validateSettables
 
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ptolemy.actor.Actor
getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface ptolemy.actor.Executable
iterate, preinitialize, stop, stopFire, terminate, wrapup
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getFullName, getName, getName
 

Constructor Detail

Integrator

public Integrator(CompositeEntity container,
                  java.lang.String name)
           throws NameDuplicationException,
                  IllegalActionException
Construct an integrator.

Parameters:
container - The container.
name - The name.
Throws:
NameDuplicationException - If another star already had this name.
IllegalActionException - If there was an internal problem.
See Also:
CTBaseIntegrator