|
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
public abstract class ODE
ODE represents and solves an initial-value problem for ordinary differential equations.
Field Summary | |
---|---|
static int |
AFTER_SUCCESSFUL_STEP
Used by method examineStep to indicate examining after
a successful step |
static int |
AFTER_UNSUCCESSFUL_STEP
Used by method examineStep to indicate examining after
an unsuccessful step |
static int |
BEFORE_STEP
Used by method examineStep to indicate examining before
the next step |
static int |
ERROR_NORM_ABS
Used by method setNorm to indicate that the error norm to be
used is to be the absolute error, equals |
static int |
ERROR_NORM_EUCLIDEAN
Used by method setNorm to indicate that the error norm to be
used is to be the scaled Euclidean norm defined as |
static int |
ERROR_NORM_MAX
Used by method setNorm to indicate that the error norm to be
used is to be the maximum of
where floor is set via setFloor |
static int |
ERROR_NORM_MINABSREL
Used by method setNorm to indicate that the error norm to be
used is to be the minimum of the absolute error and the relative error, equals
the maximum of |
Constructor Summary | |
---|---|
ODE()
|
Method Summary | |
---|---|
protected void |
examineStep(int state,
double t,
double[] y)
Called before and after each internal step. |
double |
getFloor()
Returns the value used in the norm computation. |
double |
getInitialStepsize()
Returns the initial internal step size. |
double |
getMaximumStepsize()
Returns the maximum internal step size. |
int |
getMaxSteps()
Returns the maximum number of internal steps allowed. |
double |
getMinimumStepsize()
Returns the minimum internal step size. |
int |
getNorm()
Returns the switch for determining the error norm. |
double |
getScale()
Returns the scaling factor. |
double |
getTolerance()
Returns the error tolerance. |
void |
setFloor(double floor)
Sets the value used in the norm computation. |
void |
setInitialStepsize(double stepsize)
Sets the initial internal step size. |
void |
setMaximumStepsize(double stepsize)
Sets the maximum internal step size. |
void |
setMaxSteps(int maxSteps)
Sets the maximum number of internal steps allowed. |
void |
setMinimumStepsize(double stepsize)
Sets the minimum internal step size. |
void |
setNorm(int normMethod)
Sets the switch for determining the error norm. |
void |
setScale(double scale)
Sets the scaling factor. |
void |
setTolerance(double tolerance)
Sets the error tolerance. |
protected double |
vnorm(double[] v,
double[] y,
double[] ymax)
Returns the norm of a vector. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int AFTER_SUCCESSFUL_STEP
examineStep
to indicate examining after
a successful step
public static final int AFTER_UNSUCCESSFUL_STEP
examineStep
to indicate examining after
an unsuccessful step
public static final int BEFORE_STEP
examineStep
to indicate examining before
the next step
public static final int ERROR_NORM_ABS
setNorm
to indicate that the error norm to be
used is to be the absolute error, equals
public static final int ERROR_NORM_EUCLIDEAN
setNorm
to indicate that the error norm to be
used is to be the scaled Euclidean norm defined as where
and is the number of equations
public static final int ERROR_NORM_MAX
setNorm
to indicate that the error norm to be
used is to be the maximum of
where floor
is set via setFloor
public static final int ERROR_NORM_MINABSREL
setNorm
to indicate that the error norm to be
used is to be the minimum of the absolute error and the relative error, equals
the maximum of
Constructor Detail |
---|
public ODE()
Method Detail |
---|
protected void examineStep(int state, double t, double[] y)
t
and y
.
state
- an int
, one of BEFORE_STEP
, AFTER_SUCCESSFUL_STEP
or AFTER_UNSUCCESSFUL_STEP
.t
- double
representing the independent variable.y
- double
array containing the dependent variables.public double getFloor()
double
used in the norm computation.public double getInitialStepsize()
double
specifying the initial internal step size.public double getMaximumStepsize()
double
specifying the maximum internal step size.public int getMaxSteps()
int
specifying the maximum number of internal
steps allowed.public double getMinimumStepsize()
double
specifying the minimum internal step size.public int getNorm()
int
specifying the switch for determining
the error norm.
In the following, is the absolute
value for an estimate of the error in
.
normMethod | Constraint |
ERROR_NORM_MINABSREL |
Minimum of the absolute error and the relative error, equals the maximum of |
ERROR_NORM_ABS |
Absolute error, equals |
ERROR_NORM_MAX |
Maximum of |
ERROR_NORM_EUCLIDEAN |
Scaled Euclidean norm defined as where and is the number of equations |
public double getScale()
double
specifying the scaling factor.public double getTolerance()
double
specifying the error tolerance.public void setFloor(double floor)
floor
- a double
used in the norm computation. floor
must be
greater than zero.floor
= 1.0public void setInitialStepsize(double stepsize)
stepsize
- a double
specifying the initial internal step size.
stepsize
must be greater than or equal to zero.
Default: stepsize
= 0.0public void setMaximumStepsize(double stepsize)
stepsize
- a double
specifying the maximum internal step size. stepsize
must be
greater than zero.setMaximumStepsize
method in the subclasses for the default values used.public void setMaxSteps(int maxSteps)
maxSteps
- an int
specifying the maximum number of internal
steps allowed. maxSteps
must be greater than zero.
Default: maxSteps
= 500public void setMinimumStepsize(double stepsize)
stepsize
- a double
specifying the minimum internal step size. stepsize
must be
greater than or equal to zero.
Default: stepsize
= 0.0public void setNorm(int normMethod)
normMethod
- an int
specifying the switch for determining
the error norm.normMethod
= ERROR_NORM_MINABSREL
normMethod | Constraint |
ERROR_NORM_MINABSREL |
Minimum of the absolute error and the relative error, equals the maximum of |
ERROR_NORM_ABS |
Absolute error, equals |
ERROR_NORM_MAX |
Maximum of |
ERROR_NORM_EUCLIDEAN |
Scaled Euclidean norm defined as where and is the number of equations |
public void setScale(double scale)
scale
- a double
specifying the scaling factor. scale
must be
greater than zero.scale
= 1.0public void setTolerance(double tolerance)
tolerance
- a double
specifying the error tolerance.
tolerance
must be greater than zero.
Default: tolerance
= 1.0e-6protected double vnorm(double[] v, double[] y, double[] ymax)
setNorm
.
v
- a double
array containing the vector whose
norm is to be computedy
- a double
array containing the values of the
dependent variableymax
- a double
array containing the maximum y values
computed thus far
double
scalar value representing the norm of
the vector v
|
JMSLTM Numerical Library 6.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |