Path: news.mathworks.com!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: Re: Double Numerical Integration Date: Fri, 23 Jan 2009 16:37:01 +0000 (UTC) Organization: QinetiQ Ltd Lines: 9 Message-ID: <glcrnd$o28$1@fred.mathworks.com> References: <gkl6sh$97r$1@fred.mathworks.com> <gkl7gl$lu0$1@fred.mathworks.com> <gkl8av$ho5$1@fred.mathworks.com> <gkm4s1$sd3$1@fred.mathworks.com> Reply-To: <HIDDEN> NNTP-Posting-Host: webapp-05-blr.mathworks.com Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1232728621 24648 172.30.248.35 (23 Jan 2009 16:37:01 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Fri, 23 Jan 2009 16:37:01 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 438476 Xref: news.mathworks.com comp.soft-sys.matlab:513447 Roger, Yes you are right, i am integrating over a square for each iteration along the xy axes. In the original volume, the value of z is constanlty evolving. In the case of the cuboid, the value of z remains constant. So it is practical to integrate only the 'L' portion for each subsequent iteration. The equation of z = (1-theta)^-0.5 * exp(-0.5*(1-theta^2)^-1 * (x^2 + y^2)) * exp(0.5*(x^2 + y^2)), theta = constant. This function to imagine it simply looks like a nice peak from Ben Nevis ;) My problem is further compounded by the fact that i am forced to calculate the volume each time over the rectangular region but i need to assign any z value obtained equal to zero when the value of x has crossed a certain threshold value, which again changes for each limit decrease/increase. I have also played around with tolerances, and so far the tol of 1e-6 is proving to be the minimum necessary for good results. I have tried to overcome the above problem by normalizing the value of z, so that the largest value of z does not exceed 1. But again, i gain a penalty by increasing the tolerance target to 1e-10. Slight improvement in speed only ;(( Any bright ideas... Regards, V