MATLAB: Calculating a surface integral over a regular shape

double integralMATLABnumerical integrationregular shapesurface integral

let's suppose a function given in polar coordinate F(r,phi) and our purpose is to calculate the surface integral, say F(r,phi)dA over the region S defined by
S={ |Z|<b , |z-z0|>a } where Z=r*exp(1j*phi). it means the regions between the circles |Z|=b , |z-z0|=a . However, F(r,phi) has singularities inside the circle |z-z0|=a . therefore, we are not able to use integral(over circle |Z|<b )-integral(over circle |z-z0|<a) .
your help and consideration are much appreciated.

Best Answer

i have solved by using the following, where F(x,y)=F(r,phi). i have used x-y coordinate and quad2d.
the result was so accurate.
y1= @(x) -sqrt(b^2-x.^2) ; y2=@(x) sqrt(b^2-x.^2) ;
y3= @(x) -sqrt(a^2-(x-z0).^2) ; y4= @(x) sqrt(a^2-(x-z0).^2) ;
intg1 = quad2d(F,-b,z0-a,y1,y2) ;
intg2 = quad2d(F,z0-a,z0+a,y1,y3) ;
intg3 = quad2d(F,z0-a,z0+a,y4,y2) ;
intg4 = quad2d(F,z0+a,b,y1,y2) ;
integ_total=intg1+intg2+intg3+intg4 ;