Package org.opensourcephysics.numerics
Interface ODEAdaptiveSolver
- All Superinterfaces:
ODESolver
- All Known Subinterfaces:
ODEInterpolationSolver
- All Known Implementing Classes:
CashKarp45
,DormandPrince45
,ODEBisectionEventSolver
,ODEMultistepSolver
,RK45
,RK45MultiStep
ODEAdaptiveSolver extends the ODE solver to add adaptive step size capabilities.
Adaptive ODE solvers adjust the step size until that the desired tolerance is reached.
The client's state can effect the internal state of the ODE solver. Some adaptive solvers
advance an internal copy of client's state. This internal state is then copied to the client after
every step. Other solvers estimate the optimal time step using the client's state. Clients
should therfore always invoke the solver's initialize method after setting their initial conditions.
- Author:
- Wolfgang Christian
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the error code.double
Gets the tolerance of the adaptive ODE sovler.void
setTolerance
(double tol) Sets the tolerance of the adaptive ODE sovler.Methods inherited from interface org.opensourcephysics.numerics.ODESolver
getStepSize, initialize, setStepSize, step
-
Field Details
-
NO_ERROR
static final int NO_ERROR- See Also:
-
DID_NOT_CONVERGE
static final int DID_NOT_CONVERGE- See Also:
-
BISECTION_EVENT_NOT_FOUND
static final int BISECTION_EVENT_NOT_FOUND- See Also:
-
-
Method Details
-
setTolerance
void setTolerance(double tol) Sets the tolerance of the adaptive ODE sovler.- Parameters:
tol
- the tolerance
-
getTolerance
double getTolerance()Gets the tolerance of the adaptive ODE sovler.- Returns:
-
getErrorCode
int getErrorCode()Gets the error code. Error codes: ODEAdaptiveSolver.NO_ERROR ODEAdaptiveSolver.DID_NOT_CONVERGE ODEAdaptiveSolver.BISECTION_EVENT_NOT_FOUND=2;- Returns:
- int
-