-1

Do you have any idea how to define multidimensional integral? I have to use my own method (Monte-Carlo) to figure out the result.

Integral

Ω - disc where r=0.5 and its center at x=0.5, y=0.5

Stéphane Mottelet
  • 2,853
  • 1
  • 9
  • 26
  • You have to first convert your integral over the disc to an integral over a rectangle in the (r,theta) plane. Then you have to use `int2d`. – Stéphane Mottelet Jun 06 '21 at 20:49

1 Answers1

0

Here is how to do this with Scilab (using polar coordinates change) for f(x,y)=x+y. The int2d function of Scilab can do adaptive integration over triangles, here we divide the rectangle [0,0.5]x[0,2*pi] in two triangles whose edges coordinates are given in the two r and theta matrices:

function out=f(x,y)
    out = x+y;
endfunction

function out=g(r,theta)
    out = r*f(0.5+r*cos(theta),0.5+r*sin(theta));
endfunction

r=[0 0.5 0
   0.5 0.5 0]';
theta=[0 0 2*%pi
       0 2*%pi 2*%pi]';
       
I=int2d(r,theta,g);
Stéphane Mottelet
  • 2,853
  • 1
  • 9
  • 26