ch.sahits.math
Class Integration

java.lang.Object
  extended by ch.sahits.math.Integration

public class Integration
extends java.lang.Object

The integration is realised with the fifth Gau�-Legendre-Formula. The values C0, ..., C4 are the sampling points with the weights W0, ..., W2.
The integral is aproximated by the wheighted mean of the function values at the sampling points. If the function is sufficient differenciable the desiered double precicion is reached with some function calls (maximum some hundred).

Version:
1.0
Author:
Andi Hotz (c) by Sahits.ch 2007

Field Summary
static int MAXK
          maximum of the iterations
static double TOL
          Tollerence for the desired double precision
 
Constructor Summary
Integration()
           
 
Method Summary
static double integral(IFunction f, double a, double b)
          Integrate the function f in the interval [a..b].
static double intk(IFunction f, double a, double b, int k)
          function call
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOL

public static final double TOL
Tollerence for the desired double precision

See Also:
Constant Field Values

MAXK

public static final int MAXK
maximum of the iterations

See Also:
Constant Field Values
Constructor Detail

Integration

public Integration()
Method Detail

intk

public static double intk(IFunction f,
                          double a,
                          double b,
                          int k)
function call

Parameters:
f - function
a - begin of the interval
b - end of the intervall
k -
Returns:
approximation

integral

public static double integral(IFunction f,
                              double a,
                              double b)
Integrate the function f in the interval [a..b].

Parameters:
f - function
a - begin of the interval
b - end of the intervall
Returns:
size of the area under (over) the function f between a and b