|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.numerics.Integral
public final class Integral
Class Integral defines various integration algorithms. This class cannot be subclassed or instantiated because all methods are static.
Method Summary | |
---|---|
static double[][] |
fillArray(Function f,
double start,
double stop,
double tol,
double[][] data)
Fills the given data array with the intgral of the given function. |
static double[][] |
fillArray(Function f,
double start,
double stop,
double tol,
int n)
Fills a data array with the integral of the given function. |
static double |
ode(Function f,
double start,
double stop,
double tol)
Computes the integral of the function using an ODE solver. |
static double |
romberg(Function f,
double a,
double b,
int n,
double tol)
Integrates the function using Romberg's algorithm based on Richardson's deferred approach. |
static double |
simpson(double[] f,
double h)
Uses Simpson's rule to find the area of an array representing a function that's been evaluated at N intervals of size h, where N is an odd integer. |
static double |
simpson(Function f,
double start,
double stop,
int n)
Numerical integration using Simpson's rule. |
static double |
simpson(Function f,
double start,
double stop,
int n,
double tol)
Numerical integration using Simpson's rule. |
static double |
trapezoidal(Function f,
double start,
double stop,
int n,
double tol)
Integrates the function using the trapezoidal method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static double trapezoidal(Function f, double start, double stop, int n, double tol)
f
- the functionstart
- the first ordinate.stop
- the last ordinate.n
- the number of partitionstol
- relative tolerance
public static double simpson(Function f, double start, double stop, int n) throws java.lang.IllegalArgumentException
f
- a function.start
- the first ordinate.stop
- the last ordinate.n
- the number of partitions
java.lang.IllegalArgumentException
public static double simpson(Function f, double start, double stop, int n, double tol)
f
- the functionstart
- the first ordinate.stop
- the last ordinate.n
- minimum number of partitionstol
- relative tolerance
public static double romberg(Function f, double a, double b, int n, double tol)
f
- the functiona
- b
- n
- tol
- tolerance
public static double simpson(double[] f, double h)
public static double ode(Function f, double start, double stop, double tol)
f
- the functionstart
- stop
- tol
- relative tolerance
public static double[][] fillArray(Function f, double start, double stop, double tol, int n)
f
- Function to be integratedstart
- double start of integralstop
- double end of integraltol
- double computation tolerancen
- int number of data points
public static double[][] fillArray(Function f, double start, double stop, double tol, double[][] data)
f
- Function to be integratedstart
- double start of integralstop
- double end of integraltol
- double computation tolerancedata
- double[][]
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |