Do you have any idea how to define multidimensional integral? I have to use my own method (Monte-Carlo) to figure out the result.
Ω - disc where r=0.5 and its center at x=0.5, y=0.5
Do you have any idea how to define multidimensional integral? I have to use my own method (Monte-Carlo) to figure out the result.
Ω - disc where r=0.5 and its center at x=0.5, y=0.5
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);