Re: replace integration by summation [message #84945 is a reply to message #84941] |
Wed, 19 June 2013 09:29   |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Wednesday, June 19, 2013 8:55:37 AM UTC-4, fd_...@mail.com wrote:
> 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).
But when you took Mats's suggestion and computed INT_TABULATED(t,A1), was the single value zero or not?
Craig
|
|
|