ptolemy.domains.ct.kernel
Interface CTStepSizeControlActor

All Superinterfaces:
Actor, Executable, Initializable, Nameable
All Known Implementing Classes:
Case, CTBaseIntegrator, CTCase, CTCompositeActor, CTRefinement, Integrator, LevelCrossingDetector, ModalModel, Refinement, TDLModule, TDLRefinement, ThresholdMonitor, TransitionRefinement, ZeroCrossingDetector

public interface CTStepSizeControlActor
extends Actor

Interface for actors that control integration step sizes for handling unpredictable breakpoints or controlling local truncation error when resolving states. Typically, actors that implement this interface are event detectors and dynamic actors.

Actors can affect the integration step size in two ways. The first one is by introducing predictable breakpoints. For example, when the fireAt() method of CTDirector is called with an argument t, the CTDirector will treat t as a breakpoint. Actors that only introduce predictable breakpoints need not implement this interface.

The second way of controlling step size is through checking the accuracy after each integration step. We treat an integration step accurate if the numerical integration error is less than the error tolerance and there is no (unpredictable) breakpoints within this step. Actors that use this mechanism need to implement this interface. At the end of each integration step, each CTStepSizeControlActor will be asked whether this step is accurate by calling its isOutputAccurate() or isStateAccurate() method. If either method returns false, that actor will then be asked to suggest a refined step size. If there are more than one actor finds that this step is not accurate, then the smallest of the suggested steps size will be used by the director to restart the integration step.

If all step size control actors find the integration step accurate, then they will be asked for a (predicted) next step size. The smallest predicted next step size will be used for the next integration step.

If there are no step size control actors in a model, the step size is controlled by the director. Most (or possibly all) CT directors will leave the default step size at its initial value and only deviate from these steps when there is a predictable breakpoint that does not coincide with one of these steps.

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

Field Summary
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Method Summary
 boolean isOutputAccurate()
          Implementations of this method should return true if this actor declares the current integration step is accurate w.r.t. its output values.
 boolean isStateAccurate()
          Implementations of this method should return true if this actor declares the current integration step is accurate w.r.t. its current states.
 double predictedStepSize()
          Implementations of this method should return the predicted next step size.
 double refinedStepSize()
          Implementations of this method should return the refined step size for restarting the current integration.
 
Methods inherited from interface ptolemy.actor.Actor
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface ptolemy.actor.Executable
fire, isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
 
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, initialize, preinitialize, removeInitializable, wrapup
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
 

Method Detail

isOutputAccurate

boolean isOutputAccurate()
Implementations of this method should return true if this actor declares the current integration step is accurate w.r.t. its output values.

Returns:
True if the current step is accurate.

isStateAccurate

boolean isStateAccurate()
Implementations of this method should return true if this actor declares the current integration step is accurate w.r.t. its current states.

Returns:
True if the current step is accurate.

predictedStepSize

double predictedStepSize()
Implementations of this method should return the predicted next step size. If the current integration step is accurate, the actor will be asked for the prediction of the next step size. If the actor that implement this interface does not know how to predict the next step size, it should return java.lang.Double.MAX_VALUE.

Returns:
The predicted next step size.

refinedStepSize

double refinedStepSize()
Implementations of this method should return the refined step size for restarting the current integration. If this actor returns false when calling the isOutputAccurate() or isStateAccurate() method, then it will be asked for a refined step size. If the actor does not want to restart the current integration step, this method should return the current step size of the director.

Returns:
The refined step size.