|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.mathematics.analysis.NumericalMathUtils
public final class NumericalMathUtils
The numerical math library. This class cannot be subclassed or instantiated because all methods are static.
| Method Summary | |
|---|---|
static double[] |
differentiate(int N,
PrimitiveMapping func,
double a,
double b)
Numerical differentiation. |
static double[][] |
differentiate(PrimitiveMappingND func,
double[] x,
double[] dx)
Numerical differentiation in multiple dimensions. |
static double[] |
euler(double[] y,
PrimitiveMapping func,
double dt)
Uses the Euler method to solve an ODE. |
static double |
gaussian4(int N,
PrimitiveMapping func,
double a,
double b)
Numerical integration using the Gaussian integration formula (4 points). |
static double |
gaussian8(int N,
PrimitiveMapping func,
double a,
double b)
Numerical integration using the Gaussian integration formula (8 points). |
static double[] |
leapFrog(double[] y,
PrimitiveMapping func,
double dt)
Uses the Leap-Frog method to solve an ODE. |
static double[] |
metropolis(double[] list,
PrimitiveMapping func,
double dx)
The Metropolis algorithm. |
static double |
richardson(int N,
PrimitiveMapping func,
double a,
double b)
Numerical integration using the Richardson extrapolation. |
static double[] |
rungeKutta2(double[] y,
DoubleFunction2D func,
double t0,
double dt)
Uses the 2nd order Runge-Kutta method to solve an ODE. |
static double[] |
rungeKutta2(double[] y,
PrimitiveMapping func,
double dt)
Uses the 2nd order Runge-Kutta method to solve an ODE. |
static double[] |
rungeKutta4(double[] y,
DoubleFunction2D func,
double t0,
double dt)
Uses the 4th order Runge-Kutta method to solve an ODE. |
static double[] |
rungeKutta4(double[] y,
PrimitiveMapping func,
double dt)
Uses the 4th order Runge-Kutta method to solve an ODE. |
static double |
simpson(int N,
PrimitiveMapping func,
double a,
double b)
Numerical integration using Simpson's rule. |
static double[] |
solveCubic(double a,
double b,
double c,
double d)
Calculates the roots of the cubic equation, a must be different from 0 (or use quadratic equation solver). |
static double[] |
solveLinear(double a,
double b)
Calculates the roots of the linear equation, a must be different from 0. |
static double[] |
solveQuadratic(double a,
double b,
double c)
Calculates the roots of the quadratic equation, a must be different from 0 (or use linear equation solver). |
static double[] |
solveQuartic(double a,
double b,
double c,
double d,
double e)
Calculates the roots of the quartics equation, a must be different from 0 (or use cubic equation solver). |
static double |
trapezium(int N,
PrimitiveMapping func,
double a,
double b)
Numerical integration using the trapezium rule. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static double[] solveLinear(double a,
double b)
public static double[] solveQuadratic(double a,
double b,
double c)
public static double[] solveCubic(double a,
double b,
double c,
double d)
public static double[] solveQuartic(double a,
double b,
double c,
double d,
double e)
public static double[] euler(double[] y,
PrimitiveMapping func,
double dt)
y - an array to be filled with y values, set y[0] to initial condition.func - dy/dt as a function of y.dt - step size.
public static double[] leapFrog(double[] y,
PrimitiveMapping func,
double dt)
y - an array to be filled with y values, set y[0], y[1] to initial conditions.func - dy/dt as a function of y.dt - step size.
public static double[] rungeKutta2(double[] y,
PrimitiveMapping func,
double dt)
y - an array to be filled with y values, set y[0] to initial condition.func - dy/dt as a function of y.dt - step size.
public static double[] rungeKutta2(double[] y,
DoubleFunction2D func,
double t0,
double dt)
y - an array to be filled with y values, set y[0] to initial condition.func - dy/dt as a function of y and t.t0 - initial time.dt - step size.
public static double[] rungeKutta4(double[] y,
PrimitiveMapping func,
double dt)
y - an array to be filled with y values, set y[0] to initial condition.func - dy/dt as a function of y.dt - step size.
public static double[] rungeKutta4(double[] y,
DoubleFunction2D func,
double t0,
double dt)
y - an array to be filled with y values, set y[0] to initial condition.func - dy/dt as a function of y and t.dt - step size.
public static double trapezium(int N,
PrimitiveMapping func,
double a,
double b)
N - the number of strips to use.func - a function.a - the first ordinate.b - the last ordinate.
public static double simpson(int N,
PrimitiveMapping func,
double a,
double b)
N - the number of strip pairs to use.func - a function.a - the first ordinate.b - the last ordinate.
public static double richardson(int N,
PrimitiveMapping func,
double a,
double b)
N - the number of strip pairs to use (lower value).func - a function.a - the first ordinate.b - the last ordinate.
public static double gaussian4(int N,
PrimitiveMapping func,
double a,
double b)
N - the number of strips to use.func - a function.a - the first ordinate.b - the last ordinate.
public static double gaussian8(int N,
PrimitiveMapping func,
double a,
double b)
N - the number of strips to use.func - a function.a - the first ordinate.b - the last ordinate.
public static double[] differentiate(int N,
PrimitiveMapping func,
double a,
double b)
N - the number of points to use.func - a function.a - the first ordinate.b - the last ordinate.
public static double[][] differentiate(PrimitiveMappingND func,
double[] x,
double[] dx)
func - a function.x - coordinates at which to differentiate about.dx - step size.
public static double[] metropolis(double[] list,
PrimitiveMapping func,
double dx)
list - an array to be filled with values distributed according to func, set list[0] to initial value.func - distribution function.dx - step size.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||