|
Boost : |
From: Matt Sutton (matt.sutton_at_[hidden])
Date: 2002-10-24 11:30:32
> 1D Numerical Integration
>
> All,
>
> I have replied to my own post to start a discussion on the
> interface for a
> 1D numerical integration library. It seems that most everyone
> agrees that
> separation of the interface for 1D, 2D, etc. is the right
> thing to do. I
> also think everyone agrees that 1D numerical integration is
> straightforward
> and could be part of boost.
>
> Here are what I would suggest to be the high-level requirements for
> whichever direction we go for 1D numerical integration:
>
> 1. They must be able to integrate a user-defined function
> from point a to
> point b in increments of deltax.
> 2. They must be able to integrate a set of results, i.e.
> results of f(x),
> from point a to point b, given that the deltax can either be
> provided by the
> user or it is implied that the deltax can be calculated by
> 1/(number of data
> points - 1).
[snip]
Might I also toss into the mix the notion of an adaptive quadrature
algorithm for scenarios where a mathematical function f(x) is to be
integrated. From the requirements mentioned above, an adaptive method
*seems* to be excluded based on the assumption that a fixed deltax is either
supplied or computed. As you are probably aware, adaptive methods seek to
evaluate the integral with as few function evaluations as necessary while
computing the integral to a user specified accuracy. One simple technique
for adaptive quadrature is to subdivide the orignal interval into to sub
intervals and then integrate those intervals until the specified accuracy is
reached in the sub interval. This obviously continues recursively, and the
function evaluations at the boundaries of the parent intervals can be used
in the computations for the child intervals.
In a crude graphic form
f(a)------------------------------f(b) Step 1
Reuse Reuse
f(a)-------------f(m1)------------f(b) Step 2
Reuse Reuse Reuse
f(a)----f(m2)----f(m1)----f(m3)---f(b) Step 3
.
.
.
Matt Sutton
Phoenix Analysis and Design Technologies
www.padtinc.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk