       Re: List Integration

• To: mathgroup at smc.vnet.net
• Subject: [mg28370] Re: [mg28332] List Integration
• From: Otto Linsuain <linsuain+ at andrew.cmu.edu>
• Date: Sat, 14 Apr 2001 01:28:40 -0400 (EDT)
• References: <200104120617.CAA03089@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Frank,

for a simple list of x anf f[x] values your problem reduces to the following:

imagine plotting the points on a 2D grid. Then for the value of F[x] at
point x[[i]](in your case the velocity at point x[[i]]), you just want
the area under the curve from x[] to x[[i]]. How can you estimate the
area under the graph of f by knowing the values of the function f at
specified discrete points? this is the oldest question in numerical
integration and there are hundreds of well known methods, even to deal
with tricky cases such as singularities and such. If you don't have that
kind of problem, then a simple trapezoidal method will do. Deriving the
formulae is High School homework and I won't go into it, the book
Numerical Recipes In C and its Fortran version (available free on-line
at www.nr.com ) lists more recipes than any reasonable person will care
to know. Of course, you cannot feed a list of numbers to Integrate or
NIntegrate in Mathematica, because these functions (which implement the
same kind of recipes as covered in the book) ask you for a function, so
THEY CAN CHOOSE at which points to evaluate it. In your problem the
points are already chosen, so maybe you could fit a polynomial through
them (look into Fit and InterpolatingPolynomial) and feed that
polynomial to NIntegrate. That would also be a solution.

Notice that this area will just give you the integral of f[x]dx from
x[] to x[[i]]. That is the change in velocity, rather than the
velocity. You have to add in the initial velocity (there is always an
arbitrary constant of integration, right?)

For multidimensional integration life is more complicated. The book I
mentioned above goes into that a little.

Hope it helps. Otto Linsuain.

Excerpts from mail: 12-Apr-101 [mg28332] List Integration (816)

> Dear All,

> I need to integrate a list of coordinates, as would be done in the
> creation of a phase space. i.e., I have list of acceleration values
> that I would like to integrate to a list of velocity values.

> A similar scenario would be as follows :

> ListPlot[Table[{x,Cos[x]},{x,0,2*Pi,Pi/16}]]

> of course, gives a smooth Cosine curve. I would like to integrate
> these points to get a smooth Sine curve.

> I should point out that I need to solve both of these problems, that
> is integrating from a list of values, as well as from a list of n-
> dimensional points.

> Thanks
> Frank

```

• Prev by Date: Re: Fonts for Yap DVI-PS
• Next by Date: Re: matrix
• Previous by thread: List Integration
• Next by thread: Why the Interpolation function cannot make a serious of points be linked smoothly?