|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.domains.ct.kernel.ODESolver
ptolemy.domains.ct.kernel.solver.ExplicitRK23Solver
public class ExplicitRK23Solver
This class implements the Explicit Runge-Kutta 2(3) ODE solving method. For an ODE of the form:
dx/dt = f(x, t), x(0) = x0it does the following:
K0 = f(x(n), tn); K1 = f(x(n)+0.5*h*K0, tn+0.5*h); K2 = f(x(n)+0.75*h*K1, tn+0.75*h); x(n+1) = x(n)+(2/9)*h*K0+(1/3)*h*K0+(4/9)*h*K2;, and error control:
K3 = f(x(n+1), tn+h); LTE = h*[(-5.0/72.0)*K0 + (1.0/12.0)*K1 + (1.0/9.0)*K2 + (-1.0/8.0)*K3]
If the LTE is less than the error tolerance, then this step is considered successful, and the next integration step is predicted as:
h' = 0.8*Math.pow((ErrorTolerance/LTE), 1.0/3.0)This is a second order method, but uses a third order procedure to estimate the local truncation error.
Green (hyzheng) |
Green (hyzheng) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary | |
---|---|
private static double[][] |
_B
|
private static java.lang.String |
_DEFAULT_NAME
|
private static double[] |
_E
|
private static int |
_order
|
private static double[] |
_timeInc
|
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 | |
---|---|
ExplicitRK23Solver()
Construct a solver in the default workspace. |
|
ExplicitRK23Solver(Workspace workspace)
Construct a solver in the given workspace. |
Method Summary | |
---|---|
protected void |
_advanceModelTime()
Override the method in the base abstract class to advance the model time. |
void |
fireStateTransitionActors()
Fire state transition actors. |
int |
getAmountOfHistoryInformation()
Return 0 to indicate that no history information is needed by this solver. |
int |
getIntegratorAuxVariableCount()
Return 4 to indicate that four auxiliary variables are needed by this solver. |
void |
integratorFire(CTBaseIntegrator integrator)
Fire the given integrator. |
boolean |
integratorIsAccurate(CTBaseIntegrator integrator)
Return true if the integration is accurate for the given integrator. |
double |
integratorPredictedStepSize(CTBaseIntegrator integrator)
Provide the predictedStepSize() method for the integrators under this solver. |
Methods inherited from class ptolemy.domains.ct.kernel.ODESolver |
---|
_getRoundCount, _getSchedule, _incrementRoundCount, _isConverged, _makeSolverOf, _resetRoundCount, _setConverged, _voteForConverged, fireDynamicActors, getContainer, resolveStates |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String _DEFAULT_NAME
private static final double[] _timeInc
private static final double[][] _B
private static final double[] _E
private static final int _order
Constructor Detail |
---|
public ExplicitRK23Solver()
public ExplicitRK23Solver(Workspace workspace)
workspace
- Object for synchronization and version tracking.Method Detail |
---|
public void fireStateTransitionActors() throws IllegalActionException
fireStateTransitionActors
in class ODESolver
IllegalActionException
- If thrown in the super class.public final int getAmountOfHistoryInformation()
getAmountOfHistoryInformation
in class ODESolver
public final int getIntegratorAuxVariableCount()
getIntegratorAuxVariableCount
in class ODESolver
public void integratorFire(CTBaseIntegrator integrator) throws IllegalActionException
integratorFire
in class ODESolver
integrator
- The integrator of that calls this method.
IllegalActionException
- If there is no director, or can not
read input, or can not send output.public boolean integratorIsAccurate(CTBaseIntegrator integrator)
integratorIsAccurate
in class ODESolver
integrator
- The integrator of that calls this method.
public double integratorPredictedStepSize(CTBaseIntegrator integrator)
integratorPredictedStepSize
in class ODESolver
integrator
- The integrator of that calls this method.
protected void _advanceModelTime() throws IllegalActionException
_advanceModelTime
in class ODESolver
IllegalActionException
- If thrown in the super class or the
model time can not be set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |