Skip to content

romberg_util

Source: base/tealdef/scripts/util/romberg_util.d.tl

Notes

Types of /scripts/util/romberg.tl (RombergUtil), numerical integration with Romberg's method.

RombergUtil

record global base/tealdef/scripts/util/romberg_util.d.tl:3

global record RombergUtil

Notes

Numerical integration returned by ug_require "/scripts/util/romberg.tl".

Functions

rombergIntegration(a : number, h : number, tolerance : number, maxCols : integer, fn : function(number) : number) : {number, number} base/tealdef/scripts/util/romberg_util.d.tl:4

Notes

Integrates fn from a to a + h with Romberg's method (trapezoidal rule plus Richardson extrapolation).

Parameter Type Description
a number Lower limit of integration.
h number Length of the interval; the upper limit is a + h.
tolerance number Stop when the estimate changes by less than this.
maxCols integer Maximum number of extrapolation columns (capped at 27).
fn function(number) : number The function to integrate.

Returns {number, number}: {integral, err}: err is 0 if the tolerance was reached and -1 if not.