Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math.num-analysis.independent

Topic: compute a double integral over a pacth defined by discrete points(not
a function) using matlab

Replies: 2   Last Post: Dec 3, 2013 7:06 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Peter Spellucci

Posts: 221
Registered: 11/9/09
Re: compute a double integral over a pacth defined by discrete points(not a function) using matlab
Posted: Dec 3, 2013 5:42 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

sun <bianaib@gmail.com> writes:
>Hello,=20
>I would like to compute a double integral of a function z=3Dx*y^2 over a no=
>n rectangle regio which is defined by points(x,y).I tried to use meshgrid a=
>nd than trapz but when the region is not defined by a rectangle, but for ex=
>ample of a circle, or a kind of a leaf... the meshgrid places nodes out of =
>the patch.=20
>Thank you,=20
>Sun

for your situation there are several solutions:
simplest one: cubpack from netlib/toms is a package for this (in C++), but
this requires some preparation from your side of course.
there are more and simpler codes for this, also in netlib/toms:
toms868
toms706 (dcutri)

there is also a code twodqd (in f90) which however requires to transform
your region in a collection of triangels beforehand.
for this there is netlib/toms/624

If the region under consideration is simple (for example convex), you could
try a handcrafted approach: cut it in normal areas of the kind

{(x,y): a<=x<=b , psi1(x)<=y<=psi2(x) }
or similar with the roles of x and y interchanged
where the functions psi* are obtained by interpolation of your given boundary
points and then use repeated ordinary quadrature.

hth
peter




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.