public final class Integral
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
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.
|
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 tolerancepublic 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 partitionsjava.lang.IllegalArgumentExceptionpublic 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 tolerancepublic static double romberg(Function f, double a, double b, int n, double tol)
f - the functiona - b - n - tol - tolerancepublic 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 tolerancepublic 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 pointspublic 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[][]