
CTBaseIntegrator |
ptolemy.domains.ct.kernel.CTBaseIntegrator |
The base class for integrators in the continuous-time (CT) domain.
An integrator 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 (ODE) 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 (a state) at a time
without knowing the input at that time. 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.
To help solving the ODE, a set of internal 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 integration 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, basic abstract ODESolver class, and the
concrete ODE solver classes. Some solver-dependent methods of integrators
delegate to the concrete ODE solvers.
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 made during
execution cause the state to be reset to the specified value.
The default value of the parameter is 0.0 of type double.
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.
Author(s): Jie Liu, Haiyang Zheng
Version:$Id: CTBaseIntegrator.java,v 1.123 2006/03/28 23:58:20 cxh Exp $
Pt.Proposed Rating:Yellow (hyzheng)
Pt.Accepted Rating:Red (yuhong)
input
The input port. This is a single port of type double.
output
The output port. This is a single port of type double.
initialState
The initial state of type DoubleToken. The default value is 0.0.