Class JSci.maths.NumericalMath
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.maths.NumericalMath

java.lang.Object
   |
   +----JSci.maths.NumericalMath

public final class NumericalMath
extends Object
The numerical math library. This class cannot be subclassed or instantiated because all methods are static.

Method Index

 o differentiate(int, Mapping, double, double)
Numerical differentiation.
 o euler(double[], Mapping, double)
Uses the Euler method to solve an ODE.
 o gaussian4(int, Mapping, double, double)
Numerical integration using the Gaussian integration formula (4 points).
 o gaussian8(int, Mapping, double, double)
Numerical integration using the Gaussian integration formula (8 points).
 o leapFrog(double[], Mapping, double)
Uses the Leap-Frog method to solve an ODE.
 o metropolis(double[], Mapping, double)
The Metropolis algorithm.
 o richardson(int, Mapping, double, double)
Numerical integration using the Richardson extrapolation.
 o rungeKutta(double[], Mapping, double)
Uses the Runge-Kutta method to solve an ODE.
 o simpson(int, Mapping, double, double)
Numerical integration using Simpson's rule.
 o trapezium(int, Mapping, double, double)
Numerical integration using the trapezium rule.

Methods

 o euler
  public static double[] euler(double y[],
                               Mapping func,
                               double dt)
Uses the Euler method to solve an ODE.
Parameters:
y - an array to be filled with y values, set y[0] to initial condition
func - -dy/dt
dt - step size
Returns:
y
 o leapFrog
  public static double[] leapFrog(double y[],
                                  Mapping func,
                                  double dt)
Uses the Leap-Frog method to solve an ODE.
Parameters:
y - an array to be filled with y values, set y[0],y[1] to initial conditions
func - -dy/dt
dt - step size
Returns:
y
 o rungeKutta
  public static double[] rungeKutta(double y[],
                                    Mapping func,
                                    double dt)
Uses the Runge-Kutta method to solve an ODE.
Parameters:
y - an array to be filled with y values, set y[0] to initial condition
func - -dy/dt
dt - step size
Returns:
y
 o trapezium
  public static double trapezium(int N,
                                 Mapping func,
                                 double a,
                                 double b)
Numerical integration using the trapezium rule.
Parameters:
N - the number of strips to use
func - a function
a - the first ordinate
b - the last ordinate
 o simpson
  public static double simpson(int N,
                               Mapping func,
                               double a,
                               double b)
Numerical integration using Simpson's rule.
Parameters:
N - the number of strip pairs to use
func - a function
a - the first ordinate
b - the last ordinate
 o richardson
  public static double richardson(int N,
                                  Mapping func,
                                  double a,
                                  double b)
Numerical integration using the Richardson extrapolation.
Parameters:
N - the number of strip pairs to use (lower value)
func - a function
a - the first ordinate
b - the last ordinate
 o gaussian4
  public static double gaussian4(int N,
                                 Mapping func,
                                 double a,
                                 double b)
Numerical integration using the Gaussian integration formula (4 points).
Parameters:
N - the number of strips to use
func - a function
a - the first ordinate
b - the last ordinate
 o gaussian8
  public static double gaussian8(int N,
                                 Mapping func,
                                 double a,
                                 double b)
Numerical integration using the Gaussian integration formula (8 points).
Parameters:
N - the number of strips to use
func - a function
a - the first ordinate
b - the last ordinate
 o differentiate
  public static double[] differentiate(int N,
                                       Mapping func,
                                       double a,
                                       double b)
Numerical differentiation.
Parameters:
N - the number of points to use
func - a function
a - the first ordinate
b - the last ordinate
 o metropolis
  public static double[] metropolis(double list[],
                                    Mapping func,
                                    double dx)
The Metropolis algorithm.
Parameters:
list - an array to be filled with values distributed according to func, set list[0] to initial value
func - distribution function
dx - step size
Returns:
list

All Packages  Class Hierarchy  This Package  Previous  Next  Index