|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.numerics.ODEMultistepSolver
public class ODEMultistepSolver
ODEMultistepSolver performs multiple ODE steps so that a uniform step size is maintained.
| Nested Class Summary | |
|---|---|
protected class |
ODEMultistepSolver.InternalODE
A class that saves an internal state that may be different from the orginal ODE. |
| Field Summary | |
|---|---|
protected boolean |
enableExceptions
|
protected int |
err_code
|
protected java.lang.String |
err_msg
|
protected double |
fixedStepSize
|
protected ODEMultistepSolver.InternalODE |
internalODE
|
protected int |
maxIterations
|
protected ODEAdaptiveSolver |
odeEngine
|
| Fields inherited from interface org.opensourcephysics.numerics.ODEAdaptiveSolver |
|---|
BISECTION_EVENT_NOT_FOUND, DID_NOT_CONVERGE, NO_ERROR |
| Constructor Summary | |
|---|---|
protected |
ODEMultistepSolver()
Constructs a ODEMultistepSolver without an ODE so that a factory method can create a custom solver. |
|
ODEMultistepSolver(ODE ode)
Constructs an ODEMultiStep ODE solver for a system of ordinary differential equations. |
| Method Summary | |
|---|---|
void |
enableRuntimeExpecptions(boolean enable)
Enables runtime exceptions if the solver does not converge. |
int |
getErrorCode()
Gets the error code. |
double |
getStepSize()
Gets the step size. |
double |
getTolerance()
Gets the tolerance of the adaptive ODE solver. |
void |
initialize(double stepSize)
Initializes the ODE solver. |
static ODEAdaptiveSolver |
MultistepRK45(ODE ode)
A factory method that creates a multisetp solver using the RK45 engine. |
void |
setMaximumNumberOfErrorMessages(int n)
Sets the number of error messages if ODE solver did not converge. |
void |
setMaxIterations(int n)
Sets the maximum number of iterations. |
protected ODEMultistepSolver.InternalODE |
setODE(ODE ode)
Sets the ODE for this solver. |
void |
setStepSize(double stepSize)
Sets the fixed step size. |
void |
setTolerance(double tol)
Sets the tolerance of the adaptive ODE solver. |
double |
step()
Steps (advances) the differential equations by the stepSize. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int err_code
protected int maxIterations
protected boolean enableExceptions
protected java.lang.String err_msg
protected ODEAdaptiveSolver odeEngine
protected double fixedStepSize
protected ODEMultistepSolver.InternalODE internalODE
| Constructor Detail |
|---|
public ODEMultistepSolver(ODE ode)
ode - protected ODEMultistepSolver()
| Method Detail |
|---|
protected ODEMultistepSolver.InternalODE setODE(ODE ode)
ode - ODE
public static ODEAdaptiveSolver MultistepRK45(ODE ode)
ode - ODE
public void enableRuntimeExpecptions(boolean enable)
enable - booleanpublic void setMaxIterations(int n)
n - maximumpublic void setTolerance(double tol)
setTolerance in interface ODEAdaptiveSolvertol - the tolerancepublic double getTolerance()
getTolerance in interface ODEAdaptiveSolverpublic int getErrorCode()
getErrorCode in interface ODEAdaptiveSolverpublic double step()
step in interface ODESolverpublic void initialize(double stepSize)
initialize in interface ODESolverstepSize - public void setStepSize(double stepSize)
setStepSize in interface ODESolverstepSize - public void setMaximumNumberOfErrorMessages(int n)
n - intpublic double getStepSize()
getStepSize in interface ODESolver
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||