Re: replace integration by summation [message #84977 is a reply to message #84965] |
Thu, 20 June 2013 07:11   |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
On 06/20/13 00:06, Craig Markwardt wrote:
> 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.
From an email reply Maria stated: "Yes, B1 is full of zeroes."
Problem solved (on our end at least :o)
cheers,
paulv
|
|
|