|
From: | twinclouds |
Subject: | Re: Slow integration with dblquad |
Date: | Sun, 20 Jan 2013 18:04:14 -0800 (PST) |
Rik, Dan and Alec: Thank you all for your reply. I think the situation is clear to me now, even though I still have some questions. The difference between 3.2.4 and 3.6.2/3 is that the default integrator of dbldquad in 3.2.4 is quadgk and it is not (probably it is quadcc) in 3.6.x. What my observation is that quadgk is much faster in my case even for the relatively well behaved cases. However, when the function is not well behaved, quadgk will simply give up and it tied to get a solution in the dblquad in 3.6.x. Sometime, it would take forever to make not very useful. BTW, if I set the default integrator to be quadgk, dblquad in 3.6.x will have the same behavior as in 3.2.4. As for error of integrand over range, I think the reason is the function that I used in integration is f(x,y)*log2(f(x,y)), where f(x,y) takes the form of exp(-((x-x0)^2+(y-y0)^2)/2s). When f(x,y) is close or equal to 0, f(x,y)*log2(f(x,y)) should be approach zero but log2(f(x,y)) goes to infinity. This situation could happen in a number of cases, i.e., x ~=x0, y ~= y0 or x and y become very large at the same time. After put a statement to detect f(x,y) is approximately equal to zero, everything seems works. The question I still have is that why dblquad in 3.6.x does not work as well as the counterpart in 3.2.4, even for relatively well behaved case. This seems contradict to what Rik's observation? I can provide my latest scripts if anybody is interested. Thanks again for everybody's help. I am new to Octave but this forum seems to be a very responsive one. I am certainly would like to use it more. --- On Sun, 1/20/13, Rik <address@hidden> wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |