Re: replace integration by summation [message #84965 is a reply to message #84953] |
Wed, 19 June 2013 21:06   |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Wednesday, June 19, 2013 4:05:20 PM UTC-4, fd_...@mail.com wrote:
>> But when you took Mats's suggestion and computed INT_TABULATED(t,A1), was the single value zero or not?
>
>
>
> No it was not a single value zero.
>
> I had two function like this:
> For i=1,n-1 do begin
> A2= INT_TABULATED(t[0:i], A1[0:i])
> B2= INT_TABULATED(t[0:i], B1[0:i])
> endfor
Problem 1: A2 and B2 should be arrays.
>
> When I replaced the INT_TABULATED by this:
> A2 = (t[1]-t[0])*total(A1,/cumulative)
> B2 = (t[1]-t[0])*total(B1,/cumulative)
>
>
> The function A2 = (t[1]-t[0])*total(A1,/cumulative)
>
> gives me completely different values from A2= INT_TABULATED(t[0:i], A1[0:i]). But the function B2 = (t[1]-t[0])*total(B1,/cumulative gives me zeros.
I asked this before: Is your T array regularly sampled or irregularly sampled? You are assuming that it is regularly sampled. If that assumption is wrong, you will get very different answers!
As Paul said, the only way for B2 to be all zeroes if t[1]-t[0] is zero or B1 is all zeroes to be begin with.
Craig
|
|
|