|
JMSLTM Numerical Library 6.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.imsl.math.ODE com.imsl.math.OdeAdamsGear
public class OdeAdamsGear
Extension of the ODE class to solve a stiff initial-value problem for ordinary differential equations using the Adams-Gear methods.
Class OdeAdamsGear
finds an approximation to the solution
of a system of first-order differential equations of the form
Nested Class Summary | |
---|---|
static class |
OdeAdamsGear.DidNotConvergeException
The iteration did not converge within the maximum number of steps allowed (default 500). |
static interface |
OdeAdamsGear.Function
Public interface for user supplied function to OdeAdamsGear object. |
static interface |
OdeAdamsGear.Jacobian
Public interface for the user supplied function to evaluate the Jacobian matrix. |
static class |
OdeAdamsGear.MaxFcnEvalsExceededException
Maximum function evaluations exceeded. |
static class |
OdeAdamsGear.SingularMatrixException
The interpolation matrix is singular. |
static class |
OdeAdamsGear.ToleranceTooSmallException
Tolerance is too small or the problem is stiff. |
Field Summary | |
---|---|
static int |
METHOD_ADAMS
The Adams integration method |
static int |
METHOD_BDF
The BDF integration method |
static int |
SOLVE_CHORD_COMPUTED_DIAGONAL
A chord method and a diagonal matrix based on a directional directive |
static int |
SOLVE_CHORD_COMPUTED_JACOBIAN
A chord or modified Newton method and a divided differences Jacobian |
static int |
SOLVE_CHORD_USER_JACOBIAN
A chord or modified Newton method and a user-supplied Jacobian |
static int |
SOLVE_FUNCTION_ITERATION
A function iteration or successive substitution method |
Fields inherited from class com.imsl.math.ODE |
---|
AFTER_SUCCESSFUL_STEP, AFTER_UNSUCCESSFUL_STEP, BEFORE_STEP, ERROR_NORM_ABS, ERROR_NORM_EUCLIDEAN, ERROR_NORM_MAX, ERROR_NORM_MINABSREL |
Constructor Summary | |
---|---|
OdeAdamsGear(OdeAdamsGear.Function function)
Constructs an ODE solver to solve the initial value problem dy/dt = f(t,y) |
Method Summary | |
---|---|
int |
getIntegrationMethod()
Returns the integration method used. |
int |
getMaximumFunctionEvaluations()
Returns the maximum number of function evaluations of allowed. |
int |
getMaxOrder()
Returns the highest order formula to use of implicit METHOD_ADAMS type or METHOD_BDF type. |
int |
getNumberOfFcnEvals()
Returns the number of function evaluations of made. |
int |
getNumberOfJacobianEvals()
Returns the number of Jacobian matrix evaluations used. |
int |
getNumberOfSteps()
Returns the number of internal steps taken. |
int |
getSolveMethod()
Returns the method for solving the formula equations. |
void |
setIntegrationMethod(int intMethod)
Indicates which integration method is to be used. |
void |
setMaximumFunctionEvaluations(int maxfcn)
Sets the maximum number of function evaluations of allowed. |
void |
setMaximumStepsize(double stepsize)
Sets the maximum internal step size. |
void |
setMaxOrder(int maxOrder)
Sets the highest order formula to use of implicit METHOD_ADAMS type or METHOD_BDF type. |
void |
setSolveMethod(int solveMethod)
Indicates which method to use for solving the formula equations. |
void |
solve(double t,
double tEnd,
double[] y)
Integrates the ODE system from t to tEnd . |
Methods inherited from class com.imsl.math.ODE |
---|
examineStep, getFloor, getInitialStepsize, getMaximumStepsize, getMaxSteps, getMinimumStepsize, getNorm, getScale, getTolerance, setFloor, setInitialStepsize, setMaxSteps, setMinimumStepsize, setNorm, setScale, setTolerance, vnorm |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int METHOD_ADAMS
public static final int METHOD_BDF
public static final int SOLVE_CHORD_COMPUTED_DIAGONAL
public static final int SOLVE_CHORD_COMPUTED_JACOBIAN
public static final int SOLVE_CHORD_USER_JACOBIAN
public static final int SOLVE_FUNCTION_ITERATION
Constructor Detail |
---|
public OdeAdamsGear(OdeAdamsGear.Function function)
function
- implementation of interface Function
that defines the right-hand side function
Method Detail |
---|
public int getIntegrationMethod()
int
indicating the integration method used.
One of the following is returned:
Value | Description |
METHOD_ADAMS |
Use the implicit Adams method. |
METHOD_BDF |
Use backward differentiation formula (BDF) methods. |
public int getMaximumFunctionEvaluations()
int
specifying the maximum number of function
evaluations of allowed.public int getMaxOrder()
METHOD_ADAMS
type or METHOD_BDF
type.
int
specifying the highest order formula
to use of implicit METHOD_ADAMS
type or METHOD_BDF
type.public int getNumberOfFcnEvals()
int
specifying the number of function
evaluations of made.public int getNumberOfJacobianEvals()
int
specifying the number of Jacobian matrix
evaluations used.public int getNumberOfSteps()
int
specifying the number of internal
steps taken.public int getSolveMethod()
int
indicating the method used
for solving the formula equations. One of the
following is returned:
Value | Description |
SOLVE_FUNCTION_ITERATION |
Use a function iteration or successive substitution method. |
SOLVE_CHORD_USER_JACOBIAN |
Use a chord or modified Newton method and a user-supplied Jacobian. |
SOLVE_CHORD_COMPUTED_JACOBIAN |
Use a chord or modified Newton method and a Jacobian approximated by divided differences. |
SOLVE_CHORD_COMPUTED_DIAGONAL |
Use a chord method and a diagonal matrix based on a directional directive. |
public void setIntegrationMethod(int intMethod)
intMethod
- an int
specifying the integration method to be used.
intMethod
must be one of the values
specified in the table which follows.
Default: intMethod
= METHOD_BDF
intMethod | Description |
METHOD_ADAMS |
Use the implicit Adams method. |
METHOD_BDF |
Use backward differentiation formula (BDF) methods. |
public void setMaximumFunctionEvaluations(int maxfcn)
maxfcn
- an int
specifying the maximum number of function
evaluations of allowed.
maxfcn
must be greater than zero.
Default: No limit is enforced.public void setMaximumStepsize(double stepsize)
setMaximumStepsize
in class ODE
stepsize
- a double
specifying the maximum internal step size. stepsize
must be
greater than zero.
Default: stepsize
= 1.7976931348623157e+308public void setMaxOrder(int maxOrder)
METHOD_ADAMS
type or METHOD_BDF
type.
maxOrder
- an int
specifying the highest order formula
to use of implicit METHOD_ADAMS
type or METHOD_BDF
type.
maxOrder
must be greater than zero.
Default: maxOrder
= 12 for METHOD_ADAMS
and
maxOrder
= 5 for METHOD_BDF
.public void setSolveMethod(int solveMethod)
solveMethod
- an int
specifying the method to be used
for solving the formula equations. Note that if the
problem is stiff and a chord or modified Newton
method is most efficient, use SOLVE_CHORD_USER_JACOBIAN
or
SOLVE_CHORD_COMPUTED_JACOBIAN
.
solveMethod
must be one of the values specified in the table
which follows.solveMethod
= SOLVE_CHORD_COMPUTED_JACOBIAN
.
solveMethod | Description |
SOLVE_FUNCTION_ITERATION |
Use a function iteration or successive substitution method. |
SOLVE_CHORD_USER_JACOBIAN |
Use a chord or modified Newton method and a user-supplied Jacobian. |
SOLVE_CHORD_COMPUTED_JACOBIAN |
Use a chord or modified Newton method and a divided differences Jacobian. |
SOLVE_CHORD_COMPUTED_DIAGONAL |
Use a chord method and a diagonal matrix based on a directional directive. |
public void solve(double t, double tEnd, double[] y) throws OdeAdamsGear.DidNotConvergeException, OdeAdamsGear.MaxFcnEvalsExceededException, OdeAdamsGear.ToleranceTooSmallException, OdeAdamsGear.SingularMatrixException
t
to tEnd
.
On all but the first call to solve
, the value of t
must
equal the value of tEnd
from the previous call.
t
- a double
specifying the independent variabletEnd
- a double
specifying the value of t
at which the
solution is desiredy
- on input, a double
array containing the initial values.
On output, a double
array containing the approximate solution.
OdeAdamsGear.DidNotConvergeException
- is thrown if the number of internal steps
exceeds maxSteps (default 500). This can
be an indication that the ODE system is stiff.
This exception can also be thrown if the
error tolerance condition could not be met.
OdeAdamsGear.ToleranceTooSmallException
- is thrown if the computation does not converge
on some step.
OdeAdamsGear.MaxFcnEvalsExceededException
- is thrown if the maximum number of function
evaluations allowed has been exceeded.
SingularMatrixException
- is thrown if the factorization function
encounters a singular matrix during LU
decomposition.
OdeAdamsGear.SingularMatrixException
|
JMSLTM Numerical Library 6.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |