|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.domains.ct.kernel.ODESolver
Abstract base class for ODE solvers. The key method for the class is resolveState(), which executes the integration method for one step. This method does not consider any breakpoints. In general, resolveState() will resolve the integrators' new states. Step size control (including error control) is performed by the director, but solvers may provide support for it. How the states are resolved and how the errors are controlled are solver dependent. Derived classes may implement these methods according to individual ODE solving algorithms.
The behavior of integrators also changes when changing the ODE solver, so this class provides some methods for the integrators too, including the fire() method and the step size control related methods. Here we use the strategy and delegation design patterns. CTBaseIntegrator delegated its corresponding methods to this class. And subclasses of this class provide concrete implementations of these methods.
An integer called "round" is used to indicate the number of firing rounds within one iteration. For some integration methods, (i.e. the so called explicit methods) the round of firings are fixed. For some others (i.e. implicit methods), the round could be an arbitrary positive integer.
A round counter is a counter for the number of fire() rounds in one iteration to help the actors that may behave differently under different rounds. The round can be got by the getRound() method. The incrementRound() method will increase the counter by one, and resetRound() will always reset the counter to 0.
Conceptually, ODE solvers do not maintain simulation parameters, like step sizes and error tolerance. They get these parameters from the director. So the same set of parameters are shared by all the solvers in a simulation.
| Green (yuhong) |
| Green (liuj) |
| Nested Class Summary |
| Nested classes inherited from class ptolemy.kernel.util.NamedObj |
NamedObj.ContainedObjectsIterator |
| Field Summary |
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Constructor Summary | |
ODESolver()
Construct a solver in the default workspace with an empty string as name. |
|
ODESolver(Workspace workspace)
Construct a solver in the given workspace with a null string name. |
|
ODESolver(Workspace workspace,
java.lang.String name)
Construct a solver in the given workspace with the given name. |
|
| Method Summary | |
protected void |
_makeSolverOf(Director dir)
Make this solver to be the solver of the given Director. |
protected void |
_prefireIfNecessary(Actor actor)
If the specified actor has not be prefired() in the current iteration, then prefire() it. |
NamedObj |
getContainer()
Return the director that contains this solver. |
abstract int |
getHistoryCapacityRequirement()
Return the number of history information needed by this solver. |
abstract int |
getIntegratorAuxVariableCount()
Return the number of auxiliary variables that an integrator should provide when solving the ODE. |
int |
getRound()
Return the round counter record. |
void |
incrementRound()
Increase the round counter by one. |
abstract void |
integratorFire(CTBaseIntegrator integrator)
The fire() method of integrators is delegated to this method. |
abstract boolean |
integratorIsAccurate(CTBaseIntegrator integrator)
The isThisStepAccurate() method of integrators is delegated to this method. |
abstract double |
integratorPredictedStepSize(CTBaseIntegrator integrator)
The predictedStepSize() method of the integrator is delegated to this method. |
void |
resetRound()
Reset the round counter to 0. |
abstract boolean |
resolveStates()
Return true if the state of the system is resolved successfully. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ODESolver()
public ODESolver(Workspace workspace)
workspace - Object for synchronization and version tracking
public ODESolver(Workspace workspace,
java.lang.String name)
throws IllegalActionException
workspace - Object for synchronization and version trackingname - Name of this solver.
IllegalActionException - If the name has a period.| Method Detail |
public final NamedObj getContainer()
getContainer in interface NameablegetContainer in class NamedObjpublic abstract int getHistoryCapacityRequirement()
public abstract int getIntegratorAuxVariableCount()
public int getRound()
public void incrementRound()
public abstract void integratorFire(CTBaseIntegrator integrator)
throws IllegalActionException
integrator - The integrator of that calls this method.
IllegalActionException - Not thrown in this base class.
May be needed by the derived class.public abstract boolean integratorIsAccurate(CTBaseIntegrator integrator)
integrator - The integrator of that calls this method.
public abstract double integratorPredictedStepSize(CTBaseIntegrator integrator)
integrator - The integrator of that calls this method.
public void resetRound()
public abstract boolean resolveStates()
throws IllegalActionException
IllegalActionException - Thrown in derived classes if
the exception is thrown by * one of the execution methods of some
actors.protected void _makeSolverOf(Director dir)
dir - The CT director
protected void _prefireIfNecessary(Actor actor)
throws IllegalActionException
actor - The actor to prefire().
IllegalActionException - If the actor returns false.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||