public abstract class ODE extends Object implements Serializable, Cloneable
Modifier and Type | Field and Description |
---|---|
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 \(max(|e_i|)\) |
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 $${s = \sqrt {\sum_{i=1}^{neq}{\frac{{e_i}^2}{{w_i}^2}}}}$$ where
\(w_i = e_i/max(|y_i(t)|,1.0)\) and \(neq\) is the number of equations |
static int |
ERROR_NORM_MAX
Used by method
setNorm to indicate that the error norm to be
used is to be the maximum of \(e_i/max(|y_i(t)|, floor)\)
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 \(e_i/max(|y_i(t)|, 1)\) |
Constructor and Description |
---|
ODE() |
Modifier and Type | Method and Description |
---|---|
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.
|
public static final int BEFORE_STEP
examineStep
to indicate examining before
the next steppublic static final int AFTER_SUCCESSFUL_STEP
examineStep
to indicate examining after
a successful steppublic static final int AFTER_UNSUCCESSFUL_STEP
examineStep
to indicate examining after
an unsuccessful steppublic 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 \(e_i/max(|y_i(t)|, 1)\)public static final int ERROR_NORM_ABS
setNorm
to indicate that the error norm to be
used is to be the absolute error, equals \(max(|e_i|)\)public static final int ERROR_NORM_MAX
setNorm
to indicate that the error norm to be
used is to be the maximum of \(e_i/max(|y_i(t)|, floor)\)
where floor
is set via setFloor
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 $${s = \sqrt {\sum_{i=1}^{neq}{\frac{{e_i}^2}{{w_i}^2}}}}$$ where
\(w_i = e_i/max(|y_i(t)|,1.0)\) and \(neq\) is the number of equationsprotected 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 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 \(e_i/max(|y_i(t)|, 1)\) |
ERROR_NORM_ABS |
Absolute error, equals \(max(e_i)\) |
ERROR_NORM_MAX |
Maximum of \(e_i/max(|y_i(t)|, floor)\) |
ERROR_NORM_EUCLIDEAN |
Scaled Euclidean norm defined as $${s = \sqrt {\sum_{i=1}^{neq}{\frac{{e_i}^2}{{w_i}^2}}}}$$ where \(w_i = e_i/max(|y_i(t)|,1.0)\) and \(neq\) 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-6public double getTolerance()
double
specifying the error tolerance.public double getInitialStepsize()
double
specifying the initial internal step size.public double getMinimumStepsize()
double
specifying the minimum internal step size.public double getMaximumStepsize()
double
specifying the maximum internal step size.public double getScale()
double
specifying the scaling factor.public int getNorm()
int
specifying the switch for determining
the error norm.
In the following, \(e_i\) is the absolute
value for an estimate of the error in
\(y_i(t)\).
normMethod | Constraint |
ERROR_NORM_MINABSREL |
Minimum of the absolute error and the relative error, equals the maximum of \(e_i/max(|y_i(t)|, 1)\) |
ERROR_NORM_ABS |
Absolute error, equals \(max(e_i)\) |
ERROR_NORM_MAX |
Maximum of \(e_i/max(|y_i(t)|, floor)\) |
ERROR_NORM_EUCLIDEAN |
Scaled Euclidean norm defined as $${s = \sqrt {\sum_{i=1}^{neq}{\frac{{e_i}^2}{{w_i}^2}}}}$$ where \(w_i = e_i/max(|y_i(t)|,1.0)\) and \(neq\) is the number of equations |
public double getFloor()
double
used in the norm computation.public int getMaxSteps()
int
specifying the maximum number of internal
steps allowed.protected 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 fardouble
scalar value representing the norm of
the vector vCopyright © 2020 Rogue Wave Software. All rights reserved.