Integration in 2D (area) using the Monte Carlo method
이전 댓글 표시
I need to numerically compute the area of the region between an ellipse (say with major axis a and minor axis b) centered at origin and a concentric circle of radius R. Area of the region between the circle and the ellipse is clearly,
\pi R^2 - \pi ab
I realized that using the usual Gauss-Legendre quadrature for this does not give correct results. I divided the region into 4 sectors and tried to compute the area by using the GL quadrature and I end up with more than 2% error. The reason is the integration points are not correctly distributed and this happens because of the different radii of the ellipse and the circle (see picture). The result of this is a small area remaining unaccounted for and causing the error in the final result (one can see the white-space at 45 degrees near the ellipse boundary). For this figure, a 30 x 30 Gauss rule is used in the sector in first quadrant and the red dots are the Gauss integration points (the points that are seen clustering towards the end of the ellipse do not actually cross over into the ellipse). Is it possible to use the Monte Carlo method for computing the integral in this case? If yes, could someone point me to a working example in Matlab for computing a 2D integral. There are probably other elegant methods to correctly evaluate the area of the annular region between ellipse and the circle like conformal mapping but I think they are more challenging to implement. Thanks for the help.

채택된 답변
추가 답변 (1개)
Youssef Khmou
2014년 2월 23일
Ganesh,
In this second answer to the problem, i wrote a Monte Carlo test for this specific geometry , try to compute the surface with and answer me back :
% Monte Carlo method for computing the area between
% an ellipse (a,b) and quart of cirle (r>(a,b)), initiation
clear;
r=5;
a=2;
b=1;
% x/a^2+y/b^2=1
N=10000;
A=0;
for i=1:N
p=r*abs(randn(1,2));
x=p(1);y=p(2);
q1=((x/a).^2)+((y/b).^2);
q2=sqrt((x.^2)+(y.^2));
if (q1>=1.00 && q2<=r)
A=A+1;
plot(x,y,'*');
hold on;
end
end
카테고리
도움말 센터 및 File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

