ptolemy.domains.ct.kernel.solver
Class ForwardEulerSolver

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.domains.ct.kernel.ODESolver
          extended by ptolemy.domains.ct.kernel.solver.FixedStepSolver
              extended by ptolemy.domains.ct.kernel.solver.ForwardEulerSolver
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

public class ForwardEulerSolver
extends FixedStepSolver

The Forward Euler ODE solver. For ODE

 dx/dt = f(x, u, t), x(0) = x0;
 
The Forward Euler method approximates the x(t+h) as:
 x(t+h) =  x(t) + h * f(x(t), u(t), t)
 
No error control and step size control is performed. This is the simplest algorithm for solving an ODE. It is a first order method, and has stability problem for some systems.

Since:
Ptolemy II 0.2
Version:
$Id: ForwardEulerSolver.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Jie Liu, Haiyang Zheng
See Also:
Serialized Form
Accepted Rating:
Green (hyzheng)
Proposed Rating:
Green (hyzheng)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
private static java.lang.String _DEFAULT_NAME
           
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
ForwardEulerSolver()
          Construct a solver in the default workspace with an empty string as name.
ForwardEulerSolver(Workspace workspace)
          Construct a solver in the given workspace.
 
Method Summary
 void integratorFire(CTBaseIntegrator integrator)
          Fire the integrator to resolve states.
 
Methods inherited from class ptolemy.domains.ct.kernel.solver.FixedStepSolver
_advanceModelTime, fireDynamicActors, fireStateTransitionActors, getAmountOfHistoryInformation, getIntegratorAuxVariableCount, integratorIsAccurate, integratorPredictedStepSize
 
Methods inherited from class ptolemy.domains.ct.kernel.ODESolver
_getRoundCount, _getSchedule, _incrementRoundCount, _isConverged, _makeSolverOf, _resetRoundCount, _setConverged, _voteForConverged, getContainer, resolveStates
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getContainedObject, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateExistence, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setName, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_DEFAULT_NAME

private static final java.lang.String _DEFAULT_NAME
See Also:
Constant Field Values
Constructor Detail

ForwardEulerSolver

public ForwardEulerSolver()
Construct a solver in the default workspace with an empty string as name. The solver is added to the list of objects in the workspace. Increment the version number of the workspace. The name of the solver is set to "CT_Forward_Euler_Solver".


ForwardEulerSolver

public ForwardEulerSolver(Workspace workspace)
Construct a solver in the given workspace. If the workspace argument is null, use the default workspace. The director is added to the list of objects in the workspace. The name of the solver is set to "CT_Forward_Euler_Solver". Increment the version number of the workspace.

Parameters:
workspace - Object for synchronization and version tracking
Method Detail

integratorFire

public void integratorFire(CTBaseIntegrator integrator)
                    throws IllegalActionException
Fire the integrator to resolve states.

Specified by:
integratorFire in class ODESolver
Parameters:
integrator - The integrator to be fired.
Throws:
IllegalActionException - If there is no director, or can not read input, or can not send output.