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

Home » Public Forums » archive » Re: An approximation of the cumulative integral of Y
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: An approximation of the cumulative integral of Y [message #67279] Mon, 13 July 2009 22:23
Vijay Shah is currently offline  Vijay Shah
Messages: 5
Registered: June 2008
Junior Member
Thanks for the the info. I don't have function but only have series of
dataset to integrate.
I did find http://idlastro.gsfc.nasa.gov/ftp/pro/math/tsum.pro
that allows takes the discrete sequence.

.
On Jul 12, 4:00 pm, Jeremy Bailin <astroco...@gmail.com> wrote:
> On Jul 12, 11:58 am, Vijay Shah <vijayps...@gmail.com> wrote:
>
>> Hi Vince,
>> Thanks for the info.
>> I checked the int_tabulated. But the IDL help files indicate  "Data
>> that is highly oscillatory requires a sufficient number of samples for
>> an accurate integral approximation."
>> I am not sure for 10 to 12 samples what would work best. I will search
>> google to find more information on this. If you know of any paper
>> about comparison, please feel to send it.
>
>> Regards,
>> Vijay
>
> That statement is not particular to INT_TABULATED, but is quite
> general: if your sampling is insufficient, the numerical integral will
> be inaccurate no matter what method you use.
>
> -Jeremy.
Re: An approximation of the cumulative integral of Y [message #67302 is a reply to message #67279] Sun, 12 July 2009 13:00 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Jul 12, 11:58 am, Vijay Shah <vijayps...@gmail.com> wrote:
> Hi Vince,
> Thanks for the info.
> I checked the int_tabulated. But the IDL help files indicate  "Data
> that is highly oscillatory requires a sufficient number of samples for
> an accurate integral approximation."
> I am not sure for 10 to 12 samples what would work best. I will search
> google to find more information on this. If you know of any paper
> about comparison, please feel to send it.
>
> Regards,
> Vijay

That statement is not particular to INT_TABULATED, but is quite
general: if your sampling is insufficient, the numerical integral will
be inaccurate no matter what method you use.

-Jeremy.
Re: An approximation of the cumulative integral of Y [message #67303 is a reply to message #67302] Sun, 12 July 2009 12:40 Go to previous message
Chris[6] is currently offline  Chris[6]
Messages: 84
Registered: July 2008
Member
On Jul 12, 5:58 am, Vijay Shah <vijayps...@gmail.com> wrote:
> Hi Vince,
> Thanks for the info.
> I checked the int_tabulated. But the IDL help files indicate  "Data
> that is highly oscillatory requires a sufficient number of samples for
> an accurate integral approximation."
> I am not sure for 10 to 12 samples what would work best. I will search
> google to find more information on this. If you know of any paper
> about comparison, please feel to send it.
>
> Regards,
> Vijay
>
> On Jul 11, 1:07 pm, Vince Hradil <vincehra...@gmail.com> wrote:
>
>> On Jul 11, 11:43 am, Vince Hradil <vincehra...@gmail.com> wrote:
>
>>> On Jul 11, 12:39 am, Vijay Shah <vijayps...@gmail.com> wrote:
>
>>>> Hi,
>>>> Is there any subroutine in IDL that allows to computes an
>>>> approximation of the cumulative integral of Y via the trapezoidal
>>>> method (with unit spacing)?
>
>>>> Regards,
>>>> Vijay
>
>>> INT_TABULATED() works nicely (not really what you want, but better?)
>
>>> It would be easy enough to write using SHIFT().  Something like
>
>>> y2 = (y+shift(y,1))/2
>>> x2 = (x+shift(x,1))/2
>>> integral = total(x2*y2); or total(x2*y2,/cumulative)
>
>>> You have to figure out how to deal with the "ends" from the shift...
>
>> Let's see, I think that should be:
>> x2 = x-shift(x,1)
>> or use delta x if it doesn't change
>
>

Check out
http://idlastro.gsfc.nasa.gov/ftp/pro/math/qtrap.pro

Chris
Re: An approximation of the cumulative integral of Y [message #67304 is a reply to message #67303] Sun, 12 July 2009 08:58 Go to previous message
Vijay Shah is currently offline  Vijay Shah
Messages: 5
Registered: June 2008
Junior Member
Hi Vince,
Thanks for the info.
I checked the int_tabulated. But the IDL help files indicate "Data
that is highly oscillatory requires a sufficient number of samples for
an accurate integral approximation."
I am not sure for 10 to 12 samples what would work best. I will search
google to find more information on this. If you know of any paper
about comparison, please feel to send it.


Regards,
Vijay

On Jul 11, 1:07 pm, Vince Hradil <vincehra...@gmail.com> wrote:
> On Jul 11, 11:43 am, Vince Hradil <vincehra...@gmail.com> wrote:
>
>
>
>> On Jul 11, 12:39 am, Vijay Shah <vijayps...@gmail.com> wrote:
>
>>> Hi,
>>> Is there any subroutine in IDL that allows to computes an
>>> approximation of the cumulative integral of Y via the trapezoidal
>>> method (with unit spacing)?
>
>>> Regards,
>>> Vijay
>
>> INT_TABULATED() works nicely (not really what you want, but better?)
>
>> It would be easy enough to write using SHIFT().  Something like
>
>> y2 = (y+shift(y,1))/2
>> x2 = (x+shift(x,1))/2
>> integral = total(x2*y2); or total(x2*y2,/cumulative)
>
>> You have to figure out how to deal with the "ends" from the shift...
>
> Let's see, I think that should be:
> x2 = x-shift(x,1)
> or use delta x if it doesn't change
Re: An approximation of the cumulative integral of Y [message #67308 is a reply to message #67304] Sat, 11 July 2009 10:07 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Jul 11, 11:43 am, Vince Hradil <vincehra...@gmail.com> wrote:
> On Jul 11, 12:39 am, Vijay Shah <vijayps...@gmail.com> wrote:
>
>> Hi,
>> Is there any subroutine in IDL that allows to computes an
>> approximation of the cumulative integral of Y via the trapezoidal
>> method (with unit spacing)?
>
>> Regards,
>> Vijay
>
> INT_TABULATED() works nicely (not really what you want, but better?)
>
> It would be easy enough to write using SHIFT().  Something like
>
> y2 = (y+shift(y,1))/2
> x2 = (x+shift(x,1))/2
> integral = total(x2*y2); or total(x2*y2,/cumulative)
>
> You have to figure out how to deal with the "ends" from the shift...

Let's see, I think that should be:
x2 = x-shift(x,1)
or use delta x if it doesn't change
Re: An approximation of the cumulative integral of Y [message #67309 is a reply to message #67308] Sat, 11 July 2009 09:43 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Jul 11, 12:39 am, Vijay Shah <vijayps...@gmail.com> wrote:
> Hi,
> Is there any subroutine in IDL that allows to computes an
> approximation of the cumulative integral of Y via the trapezoidal
> method (with unit spacing)?
>
> Regards,
> Vijay

INT_TABULATED() works nicely (not really what you want, but better?)

It would be easy enough to write using SHIFT(). Something like

y2 = (y+shift(y,1))/2
x2 = (x+shift(x,1))/2
integral = total(x2*y2); or total(x2*y2,/cumulative)

You have to figure out how to deal with the "ends" from the shift...
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Menu Question
Next Topic: Re: Call external 64bit

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

Current Time: Wed Oct 08 15:56:28 PDT 2025

Total time taken to generate the page: 0.00625 seconds