Class DefaultStopper
java.lang.Object
cnuphys.rk4.DefaultStopper
- All Implemented Interfaces:
IStopper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleGet the final independent variable (typically path length in meters)voidsetFinalT(double finalT) Set the final independent variable (typically path length in meters)booleanstopIntegration(double t, double[] y) Given the current state of the integration, should we stop?Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IStopper
terminateIntegration
-
Constructor Details
-
DefaultStopper
public DefaultStopper()
-
-
Method Details
-
stopIntegration
public boolean stopIntegration(double t, double[] y) Description copied from interface:IStopperGiven the current state of the integration, should we stop? This allows the integration to stop, for example, if some distance from the origin has been exceeded or if the independent variable passes some threshold. It won't be precise, because the check may not happen on every step, but it should be close.- Specified by:
stopIntegrationin interfaceIStopper- Parameters:
t- the current value of the independent variable (typically pathlength)y- the current state vector (typically [x, y, z, vx, vy, vz])- Returns:
trueif we should stop now.
-
getFinalT
-
setFinalT
-