PsiLAB Help Manual Page

Section: Integration of functions

Name: integrate

Integrate a function in a given integration intervall.
This function iterates the integral of the function f for the integration intervall a ... b using Romberg's polynomial extrapolation.

[ y:float ] = integrate
f:(float -> float)
a:float
b: float
?maxsteps:int
?eps:float
unit

The optional argument maxstep determines the maximal iteration steps, and eps can be used to control the the termination behaviour (either succesfull or not).
Examples:

[] integrate (fun x -> sqrt(x)/(cos x)) 0.0 100.0 () ;; 
- : float = -794.191961825 
[] integrate sin (-1.0) 1.0 () ;; 
Uncaught exception: Failure "integrate: iteration failed". 
[] integrate sin (-1.0) 1.0 ~eps:0.01 () ;; 
- : float = -1.00646092114e-17 

Printed by PsiLAB