Re: Numerical integration of a series




In article <1aedc6af-5858-4305-8796-a42bdfe5f03f@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Ragu <ssragunath@xxxxxxxxx> writes:
This is my first post in s.m.n forum. I have a set of equally spaced
acceleration (accel) data points. I need to integrate it to obtain
velocity (vel) and displacement (disp).
NIntegrate[accel(t)] = vel(t)
NIntegrate[vel(t)] = disp(t)
>
accel(0) = aval1
accel(0+dt) = aval2
accel(0+2*dt) = aval3
accel(0+3*dt) = aval4
.
accel(0+(n-1)*dt) = avaln

I need to integrate this data with respect to t so that I get
vel(0) = vval1
vel(0+dt) = vval2
vel(0+2*dt) = vval3
vel(0+3*dt) = vval4
.
vel(0+(n-1)*dt) = avaln

I would like to get the most accurate solution (or exact solution if
possible). I had used trapezoidal rule (in school) and remember
getting a third order error.

Could someone please suggest me a standard way of performing higher
order integration for the above problem using readily available
routines (either Intel MKL or IMSL libraries)? The standard routines
available for Univariate Quadrature are given for an interval from A
to B. This would mean that I will have to split my data into n
intervals, fit a straight line for each interval and then call the
univariate quadrature subroutine "n" times. For obtaining displacement
from velocity, I will fit a second degree curve for each interval,
then integrate "n" times.

Is this the way to implement a solution for this problem? My feeling
is that there should be other easier / elegant ways, but I am totally
new to numerical analysis domain. Please advice.

Thanks.


first of all, you need to know initial values for vel(0) and disp(0) since

vel'(t0=accel(t) =>
vel(t)=vel(0) + integral_{0 to t } accel(s)ds
and similarly
disp(t)=disp(0) + integral_{0 to t} vel(s)ds

next, how to proceed depends:
either you get the values "aval_i" in your notation in real time
and want to integrate in real time. then doing the integral
step by step using e.g. the trapezoidal rule
with dt=h =step size:
integral_new=integral_old+(h/2)*(new_aval+last_aval)
as a first solution
and if the values "aval_i" are no exact, but have some measurement errors
there will be little sense in using a "better" routine.

In principle you could use, given enough grid points, any useful
formula for equidistent nodes
for example, you could use simpsons rule with an odd number of available
points and the (3/8)-rule (sometimes also called the "pulcherrima", devil knows
why)
what I mean:

integral_{i*dt to (i+2)*dt} = (dt/3)*
( f(i*dt) + 4*f((i+1)*dt)
+f((i+2)*dt) )



or

integral_{i*dt to (i+3)*dt} = (3*dt/8)* (f(i*dt) + 3*f((i+1)*dt)
+ 3*f((i+2)*dt)+f((i+3)*dt) )
these two formulas are exact for polynomials up to order three
and the local error is dt^5

there are formulas of even higher order, but these make little sense if
the number of grid points used goes above 9 ,say.
nevertheless, as said, if your data have even little noise , this is
questionable anyway.

if, on the other side, you have _all_ data available _at once_ , possibly with noise,
then I would compute a smooting spline first and integrate this one exactly
afterwards two times.

finally, you might rely on the ode-solver :
vel(0)= vel_0_given
disp(0) = disp_0_given

vel'(t) = accel(t)
disp'(t) = vel(t)

but this requires you have a code which accepts instead of a function
on the right hand side an input of grid_data (and manages the necessary
interpolation himself)



hth
peter

.



Relevant Pages

  • Re: Off Road storing of untaxed vehicles
    ... Any bend/wiggle in the road within that time span will reduce the displacement - resulting in a 'speed' figure that is lower than the true value. ... No current GPS set determines velocity in the way that you describe. ... The pseudo range rate is an averaging system, ... static gps receiver without smoothing and clock correction would appear to ...
    (uk.business.agriculture)
  • Re: Please check my calculations
    ... Anon wrote: ... the initial velocity, fis the equation for velocity, Fis the ... and the horizontal displacement at the max altitude. ...
    (sci.math)
  • Re: Please check my calculations
    ... Anon wrote: ... the initial velocity, fis the equation for velocity, Fis the ... and the horizontal displacement at the max altitude. ... 90 degrees means "straight up". ...
    (sci.math)
  • Re: E=F/q=vB Magnetic Force does not work on the charge
    ... force is PERPENDICULAR to the velocity and hence to the displacement ... magnetic force also does not affect a perpendicularly moving charge, ...
    (sci.physics.relativity)
  • Re: Numerical Integration
    ... I have a rectangular domain and equally spaced points on ... I dont have any functions for temperature and velocity, ...
    (comp.soft-sys.matlab)