rkm.butcher
Class ButcherMatrix
java.lang.Object
rkm.butcher.ButcherMatrix
- Direct Known Subclasses:
- CustomButcherMatrix, ForwardEuler, Heun, Merson, Midpoint, ModifiedEuler, RungeKutta3, RungeKutta4, ThreeEights
public abstract class ButcherMatrix
- extends java.lang.Object
Butcher matrix representation of a Runge-Kutta method.
This class also keeps track of all available subclasses.
Field Summary |
protected double[][] |
a
|
protected double[] |
b
|
protected double[] |
c
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
a
protected double[][] a
b
protected double[] b
c
protected double[] c
ButcherMatrix
public ButcherMatrix()
a
public double a(int i,
int j)
- Returns:
- element (i,j) of submatrix A.
Both indices range from 1 to order.
b
public double b(int i)
- Returns:
- element i of submatrix B.
The range of i is from 1 to order.
c
public double c(int i)
- Returns:
- element i of submatrix C.
The range of i is from 1 to order.
order
public abstract int order()
- Returns:
- the order of the matrix.
This is the size (n) of submatrices A (nxn), B (1xn) and C (nx1).
toString
public abstract java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- Returns:
- a description of the Runge-Kutta method this matrix represents.
getAvailableMethods
public static ButcherMatrix[] getAvailableMethods()
- Returns:
- an array of ButcherMatrices, one of each available subclass.
getCustomButcherMatrix
public static ButcherMatrix getCustomButcherMatrix(double[][] a,
double[] b,
double[] c)
- Returns:
- a custom-built Butcher matrix built with the given submatrices.