{
Numerical integration
author: Nikolai Shokhirev http://www.shokhirev.com/nikolai.html)
created: 2002.02.02
last modified: 2004.12.24
ŠNikolai V. Shokhirev, 2001-2004 }
unit uIntegrals;
interface
uses
uMatTypes;
{
Pascal version by Nikolai V. Shokhirev
PURPOSE:
Estimate the integral of FUN(X) from A to B to a user provided tolerance.
This is an automatic adaptive routine based on the 8-panel Newton-Cotes rule.
Ref.
George E. Forsythe, Michael A. Malcolm, and Cleve B. Moler.
"Computer Methods for Mathematical Computations". Prentice-Hall, 1977.
INPUT:
a - lower limit of integration
b - upper limit of integration
abserr - absolute error tolerance (>0)
relerr - relative error tolerance (>0)
OUTPUT:
result - approx. value of integral
errest - estimate of actual error
nofun - no. of function evaluations
flag - reliability indicator. ( = 0 is O.K.) }
procedure Quanc8(Fun: TFloatFunction1D; const a, b, abserr, relerr: TFloat;
var result, errest, flag: TFloat; var nofun: TInt);
implementation
uses
math;
initialization
end.
Back
Generated by Lore's Source to HTML Converter(http://www.newty.de/lsc/index.html)