comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » replace integration by summation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: replace integration by summation [message #84905 is a reply to message #84904] Tue, 18 June 2013 03:56 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Tuesday, June 18, 2013 12:36:02 PM UTC+2, fd_...@mail.com wrote:
> Hi,
>
> I've been trying to replece the INT_TABULATED by total but the answer is very different and I don't see why.
>
>
>
> integration: A2= INT_TABULATED(t[0:i], A1[0:i])
>
>
>
> summation: A2 = (t[1]-t[0])*total(A1,/cumulative)
>
>
>
> I haven't been able to find out what is going wrong because these two commands seems similar to me and I didn't expect to get so wrong results. Can anyone help?
>
>
>
> With Thanks
>
> Maria

Well, I would suppose that the two types of integration methods are very different in how they integrate. In one case the so-called method of the rectangle rule (summation of array elements with /cumulative) will give very different results from int_tabulated specially when the data is very noisy and you're not sampling enough...

So, I would guess that the problem are the number of points you are using are not enough to describe the noise.

Try playing around with this:
x = (findgen(1001)/1000.0)*!pi
y = sin(x)*(RANDOMU(S,1001)*0.5)
print, (x[1]-x[0])*(total(y,/cumulative))[-1], INT_TABULATED(x,y)

the less points you use and the higher the noise, the more the results will differ (not tested, it's a guess...)

Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: convert .dat to .fits
Next Topic: GRID3 Problems

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 21:47:16 PDT 2025

Total time taken to generate the page: 0.07498 seconds