Re: replace integration by summation [message #84941 is a reply to message #84939] |
Wed, 19 June 2013 05:55   |
fd_luni
Messages: 66 Registered: January 2013
|
Member |
|
|
On Wednesday, 19 June 2013 13:08:17 UTC+1, Paul van Delst wrote:
> Hmm... an all-zero result is typically an indication of user error (it's pretty difficult to get a bunch of numbers to add up to zero). What about if, instead of A2= INT_TABULATED(t[0:i], A1[0:i]) you do A2= INT_TABULATED(t, A1) ? What do you get? In your original post you don't use bounds in the TOTAL() example, so may as well do the same in the INT_TABULATED() one.
> I actually have a loop
For i=1,n-1 do begin
A1[i]= INT_TABULATED(t[0:i], A2[0:i])
endfor
When I use A2= INT_TABULATED(t, A1) I got a single value. I need an array that is why I used
A1 = (t[1]-t[0])*total(A2,/cumulative)
I am actually try to avoid the loop and replace it by something else. For this reason I used the A1 = (t[1]-t[0])*total(A2,/cumulative).
|
|
|