Forum archive 2000-2006

Michael Gage - romberg

Michael Gage - romberg

by Arnold Pizer -
Number of replies: 0
inactiveTopicromberg topic started 8/28/2001; 8:16:40 PM
last post 8/28/2001; 8:16:40 PM
userMichael Gage - romberg  blueArrow
8/28/2001; 8:16:40 PM (reads: 2393, responses: 0)

romberg

Description
Implements the romberg integration method. (Richardson acceleration applied to the trapezoid rule.) The first three arguments are required.

Syntax

$area = romberg($rf_func, $start, $end, %options);

Params

$rf_func refers to a subroutine of one variable defining the function.
$start is the left hand endpoint of the integral.
$end is the right hand endpoint of the integral.

Options

Option keyOption valueDefault
levelsThe number of levels of iteration used in applying the romberg method. 6

Returns

A number representing the definite integral.

Examples

$area = romberg(sub { my $x=shift; $x**3;}, 0, 5, level =>3); # evaluation of x^3 on the interval from 0 to 5.

See Also

trapezoid, inv_romberg

 

<| Post or View Comments |>