Re: Numerical integration [message #56801] |
Thu, 15 November 2007 13:37 |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
tarequeaziz@gmail.com wrote:
> Hello Gurus,Pundits& Bosses of IDL,
>
> Need help on 'int_tabulated'. One of the array has duplicate
> elements(=same elements) and thus int_tabulated refuses to move any
> further.
>
> Is there any way out?
what about cutting your array where you have an X duplicate, then run
int_tabulated on each sub-array, and sum everything up at the end?
Jean
|
|
|
Re: Numerical integration [message #56803 is a reply to message #56801] |
Thu, 15 November 2007 13:00  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Nov 15, 2:58 pm, tarequea...@gmail.com wrote:
> Hello Gurus,Pundits& Bosses of IDL,
>
> Need help on 'int_tabulated'. One of the array has duplicate
> elements(=same elements) and thus int_tabulated refuses to move any
> further.
>
> Is there any way out?
So you have a jump in your function (where Y changes but X stays the
same)? INT_TABULATED won't like this because it interpolates the
data, and your function is not smooth. You could try just a
simple trapezoidal integration, such as in the function
http://idlastro.gsfc.nasa.gov/ftp/pro/math/tsum.pro
--Wayne
|
|
|
Re: Numerical integration [message #56805 is a reply to message #56803] |
Thu, 15 November 2007 12:55  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
tarequeaziz@gmail.com wrote:
> Hello Gurus,Pundits& Bosses of IDL,
>
> Need help on 'int_tabulated'. One of the array has duplicate
> elements(=same elements) and thus int_tabulated refuses to move any
> further.
>
> Is there any way out?
Yes. Remove the duplicate x-values and try again.
cheers,
paulv
>
> I tried QROMB, QSIMP etc. I can not use them because to do that I need
> to define a 'function' which they integrate. I can not make a function
> out of my 2 arrays (at least that's what I think).
>
> However,the thing I like about them is that, you can specify step
> size, which cant be done in int_tabulated.
>
> Is there any procedure/function which can handle 1) repeatable
> elements or same elements in array and also 2) can specify step size.
>
> Any help will be greatly appreciated.
>
> Thanks in advance.
>
> Best,
>
> TA
|
|
|