public class ODESolver
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
EULER
Constant representing Euler algorithm.
|
static int |
ILLEGAL
Constant representing an illegal (unknown) algorithm.
|
static int |
MIDPOINT_RULE
Constant representing Midpoint Rule Algorithm.
|
static int |
MODIFIED_EULER
Constant representing Modified Euler Algorithm.
|
static int |
RUNGE_KUTTA_4
Constant representing Runge-Kutta 4 Algorithm.
|
static int |
RUNGE_KUTTA_FEHLBERG
Constant representing Runge-Kutta-Fehlberg Algorithm.
|
Constructor and Description |
---|
ODESolver() |
Modifier and Type | Method and Description |
---|---|
static java.util.Vector |
euler(VField f,
double[] y0,
double h,
int maxSteps)
Version of euler with trivial constraints.
|
static java.util.Vector |
euler(VField f,
double[] y0,
double h,
int maxSteps,
Constraints c) |
static int |
getAlgorithm(java.lang.String name) |
static java.lang.String |
getAlgorithmName(int algorithm) |
static int |
getAlgorithmNumber() |
static java.lang.String |
getErrorMessage() |
static java.util.Vector |
integrate(int method,
VField f,
double[] y0,
double h,
int maxSteps)
Version of integrate with trivial constraints.
|
static java.util.Vector |
integrate(int method,
VField f,
double[] y0,
double h,
int maxSteps,
Constraints c)
Selects an algorithm according to the first argument and calls
one of the implemented solvers.
|
static java.util.Vector |
midpointRule(VField f,
double[] y0,
double h,
int maxSteps)
Version of midpointRule with trivial constraints.
|
static java.util.Vector |
midpointRule(VField f,
double[] y0,
double h,
int maxSteps,
Constraints c) |
static java.util.Vector |
modifiedEuler(VField f,
double[] y0,
double h,
int maxSteps)
Version of modifiedEuler with trivial constraints.
|
static java.util.Vector |
modifiedEuler(VField f,
double[] y0,
double h,
int maxSteps,
Constraints c) |
static java.util.Vector |
rungeKutta4(VField f,
double[] y0,
double h,
int maxSteps)
Version of rungeKutta4 with trivial constraints.
|
static java.util.Vector |
rungeKutta4(VField f,
double[] y0,
double h,
int maxSteps,
Constraints c) |
static java.util.Vector |
rungeKuttaFehlberg(VField f,
double[] y0,
double h,
int maxSteps)
Version of rungeKuttaFehlberg with trivial constraints.
|
static java.util.Vector |
rungeKuttaFehlberg(VField f,
double[] y0,
double h,
int maxSteps,
Constraints c)
Runge-Kutta-Fehlberg integrator
|
public static final int ILLEGAL
public static final int EULER
public static final int MODIFIED_EULER
public static final int MIDPOINT_RULE
public static final int RUNGE_KUTTA_4
public static final int RUNGE_KUTTA_FEHLBERG
public static final java.lang.String getAlgorithmName(int algorithm)
public static final int getAlgorithmNumber()
public static final int getAlgorithm(java.lang.String name)
public static java.util.Vector rungeKutta4(VField f, double[] y0, double h, int maxSteps, Constraints c)
f
- Vector fieldy0
- Initial conditions.h
- Step size.maxSteps
- Maximal number of steps.c
- Constraints which solution must satisfypublic static java.util.Vector rungeKuttaFehlberg(VField f, double[] y0, double h, int maxSteps, Constraints c)
f
- Vector fieldy0
- Initial conditions.maxSteps
- Maximal number of steps.c
- Constraints which solution must satisfypublic static java.util.Vector euler(VField f, double[] y0, double h, int maxSteps, Constraints c)
f
- Vector fieldy0
- Initial conditions.h
- Step size.maxSteps
- Maximal number of steps.c
- Constraints which solution must satisfypublic static java.util.Vector modifiedEuler(VField f, double[] y0, double h, int maxSteps, Constraints c)
f
- Vector fieldy0
- Initial conditions.h
- Step size.maxSteps
- Maximal number of steps.c
- Constraints which solution must satisfypublic static java.util.Vector midpointRule(VField f, double[] y0, double h, int maxSteps, Constraints c)
f
- Vector fieldy0
- Initial conditions.h
- Step size.maxSteps
- Maximal number of steps.c
- Constraints which solution must satisfypublic static java.util.Vector rungeKutta4(VField f, double[] y0, double h, int maxSteps)
public static java.util.Vector euler(VField f, double[] y0, double h, int maxSteps)
public static java.util.Vector modifiedEuler(VField f, double[] y0, double h, int maxSteps)
public static java.util.Vector midpointRule(VField f, double[] y0, double h, int maxSteps)
public static java.util.Vector rungeKuttaFehlberg(VField f, double[] y0, double h, int maxSteps)
public static java.lang.String getErrorMessage()
public static java.util.Vector integrate(int method, VField f, double[] y0, double h, int maxSteps, Constraints c)
method
- Constant representing method of integration.f
- Vector field.y0
- Vector of initial conditions.h
- Step.maxSteps
- Maximal number of steps. The actual number of steps can be smaller if
during integration vector field cannot be evaluated.c
- Constraints which must be satisfied by the solution point.public static java.util.Vector integrate(int method, VField f, double[] y0, double h, int maxSteps)