|
Notes
of Numeric Calculus |
Integration of non-equispaced data.
Many time we do not know directly the
function to integrate. We have only a set of samples, generally not equispaced.
This is a very common case in experimental sciences and statistics
. We can not recalculate the function sample and not decide how many
sample to use, because the integration function is known only by a vector of a
couple of values
f(x) º { (xi , yi) i
= 0, 1, ... n }
Of course we can not use directly all the algorithm using fixed step.
A good choise is that of reorganizing data generic samples in equispaced
data samples and after that, using standard formulas for fixed step.
|
Generic Samples |
Convert to |
Equispace Samples |
|
{ (xi , yi) i = 0, 1, ... n } |
===> |
{ (xi = x0+i h , yi (xi ) i = 0, 1, ... m } |
This method has
several advantages:
· Uses the standard well know integration formula
for fixed step
· Dimension of equispaced samples can be
different from the original samples.
· Is faster than other non fixed method (Lagrange
interpolation).
Basic steps of this
method are:
Nodes
- Pick-up algorithm
Aitken extrapolation algorithm
Re-computing
data with fixed step
Integration
with fixed step algorithm
Nodes Pick-up algorithm
This is a simple but
inportant step in interpolation data function. If we want to know the
interpolate value at the point x, with a D degree polynomial, we have to
selects the the D+1 nodes nearest the x .
Example: in the table
below, select the nodes for 3° degree extrapolating value at point x=3 and x=9.
As we can see the nearest point at x = 3 are [ x4, x5,
x6, x7], while for x=9 we are [x7, x8, x9, x10].
|
Nodes |
xi |
yi |
extrap. |
extrap. |
|
1 |
1 |
1.0000000000 |
|
|
|
2 |
1.2 |
0.8333333333 |
|
|
|
3 |
1.5 |
0.6666666667 |
|
|
|
4 |
2 |
0.5000000000 |
Ü |
|
|
5 |
2.5 |
0.4000000000 |
Ü |
|
|
6 |
3.2 |
0.3125000000 |
Ü |
|
|
7 |
4.3 |
0.2325581395 |
Ü |
Ü |
|
8 |
5.6 |
0.1785714286 |
|
Ü |
|
9 |
7.5 |
0.1333333333 |
|
Ü |
|
10 |
10 |
0.1000000000 |
|
Ü |

This method is used to
interpolate not equispaced data
f(x) º { (xi , yi) i
= 0, 1, ... n }
This method is efficient as
the
The interpolation value y = f(x) at a given point x, can be
computed by the following iterative algorithm:
for j = 1, 2, 3 .... n-1
for i = j +1, j+2 .... n
yi = [yj (xi - x ) ( yi (xj - x) ]/( xi - xj )
next i
next j
y @ yn
Re-computing data with fixed
step
This step computes the new
values of y(x) with fixed step h.
|
for Xi = x0 + i h |
X is the new value of
abscissa |
|
ß |
|
|
pick-up nearest nodes to
Xi |
y are the old table
data |
|
ß |
|
|
Interpolation of Yi |
Y is the new value of
ordinate |
|
ß |
|
|
Xi , Yi |
X, Y are the new data
table with equispaced step |
The result of equispaced
tabulation can be view in the graph below

Integration with fixed step algorithm
This is the final step. We
can use any Newton-Cotes formula. The only attention we have to pay is the
degree formula of integration. If we have re-builded the data table with an
interpolation Aitken of a set degree, also the integration formula should have
the same degree.