From: spellucci@mathematik.tu-darmstadt.de (Peter Spellucci) Subject: Re: Double integral Date: 20 Jan 1999 10:33:03 GMT Newsgroups: sci.math.num-analysis Keywords: Numerical evaluation of multiple integrals In article <36A5973B.A8FCA8A4@polyu.edu.hk>, Man J <98901192r@polyu.edu.hk> writes: |> If I want to evaluate the double integral Int Int F(x,y)dxdy |> numerically, |> what scheme I should use ???? |> Is there any 2-dimensional Simpson's rule ?? |> Help.... |> depends on the region which you did not specify. on a rectangular region you can use product rule integration (apply standard onedimensional rules in x and y-direction). otherwise you may triangularize the region and use special formulae for triangles (reducing them to the standard triangle) codes for trinagularization and two-dimensionla integrals are in netlib/toms. (httP;//www.netlib.org). formulae are in stroud: "approximate calculation of multiple integrals", prentice hall, hope this helps peter ============================================================================== From: spellucci@mathematik.tu-darmstadt.de (Peter Spellucci) Subject: Re: computing double integral Date: 2 Mar 1999 15:51:24 GMT Newsgroups: sci.math.num-analysis In article , ferrus@insatlse.insa-tlse.fr (Ferrus Thierry) writes: |> Could someone tell me the better way to compute the double integral : |> |> |> |> _ _ |> / pi / pi |> | | |> | | dx dy |> | | --------------------- ??? |> | | ½ |> | | [ a - F(x,y) ] |> | | |> _/ _ / |> -pi -pi |> |> |> F(x,y) is a known function of x and y and : |> |> min of F(x,y) |> |> |> Thank you for advance for your help. something must be wrong here since, as you write it down, the argument of the square root would become negative somewhere. maybe you forget the abs(...)? let us assume that the integral exists in the sense of an improper Riemann integral. that means F is differentiable and gradF not zero if F(x,y)=a and an "abs" is in the sqrt(.). then the best way to deal with the integral would be to compute the curve a=F(x,y). for simplicity i assume that for every x in [-pi,pi] there is exactly one such y0(x) such that F(x,y0(x))=a and that the line (x,y0(x)+t) is not tangential to this curve. then you must split up the inner integral such that the point (x,y0(x)) on the curve becomes a left or right endpoint. then you may use Gaussian quadrature with the weight function 1/sqrt(y) on [0,1] (after transformation of the interval y0(x),pi to [0,1]) for the integrand sqrt(abs(y-y0(x))/sqrt(abs(a-F(x,y))) since this gauss rule does use interior nodes only and the transformed integrand is smooth by assumption, this would give good accuracy with a moderate number of nodes. for the outer integral you then could use a high order gauss-rule. this is of course a complicated task. you could simplify by computing a sufficiently high number of discrete points on that curve , add these to a regular grid on [-pi,pi]^2, make a triangulation of the new net and use a high order 2-d gauss-rule on the triangles. such formulae are e.g. in stroud: approximate calculation of multiple integrals, prentice hall 1971 or in engels : numerical quadrature and cubature, academic press 1980. codes for generating a triangulation are in netlib/toms http://www.netlib.org. you may also resort to some code for automatic adative 2d-integration (cubature). such codes are available, e.g. in cubpack (http://www.netlib.org, in library toms 764). but due to the singularity, you must be prepared for an tremendous effort without using the above trick of regularization. hope this helps peter ============================================================================== From: "Dann Corbit" Subject: Re: question about double integral evaluation Date: Fri, 8 Oct 1999 12:08:23 -0700 Newsgroups: sci.math.num-analysis Michael Godbout wrote in message news:37FE364B.658C26FC@wireless.ece.mcgill.ca... > > Hi, > > I need to numerically evaluate a double integral. The limits are finite > and the integrand is non-singular but complicated. I've been told > rumours that this is difficult. These rumours, which seem reasonable to > me, are to effect that numerical evaluation of a double integral is > riskier to perform than the evaluation of a single integral. That is, > the answer can beill-behaved somehow. > > I've tried finding information to confirm or disconfirm these rumours > but have failed miserably. The textbooks I looked at only discuss > single integration methods. Is there a book or article which discusses > double-integration methods and the conditions under which the methods > perform acceptably.? Naturally, it is riskier, since there are more operations, and over a region instead of a line. Abramowitz and Stegun's mathematical handbook discusses it (in particular ways to choose points in a domain and also for different shaped domains). Here is a URL that shows why it is a good idea to make a change of variables under certain circumstances: http://iq.orst.edu/mathsg/vcalc/change/change.html Here is a book that discusses double integration: http://www.keele.ac.uk/depts/ma/mathtech/ Here is the chapter in Numerical Recipes in C that discusses multidimensional integration: http://www.keele.ac.uk/depts/ma/mathtech/ Warning! The text is great, but the code is icky(tm). However, the integration routines are less icky(tm) on average than some of the other stuff. I suspect that most NA texts will have something on it. Markov modeling is fairly popular to cut down on the calculation time. -- C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html "The C-FAQ Book" ISBN 0-201-84519-9 C.A.P. Newsgroup http://www.dejanews.com/~c_a_p C.A.P. FAQ: ftp://38.168.214.175/pub/Chess%20Analysis%20Project%20FAQ.htm