I am simulating a sensor that is assumed to sample concentration values C(x,y) in an arbitrary 2D elliptical area given by
( (x-x_s)*cos(alpha) - (y-y_s)*sin(alpha) )^2/a^2 + ( (x-x_s)*sin(alpha) + (y-y_s)*cos(alpha) )^2/b^2
where (x_s, y_s) is the center of the ellipse,
alpha is the rotation of the ellipse, and
a and b are the axes.
I need to estimate the surface integral of C(x,y) over this ellipse.
An old post on Loren on the Art of Matlab gives some hints for setting up numerical integration over an ellipsoid region, but I am unsure how to proceed. I have also looked at the integral2 function, which was introduced after Loren's blog post, but am unsure how to define the x,y bounds to account for the ellipse.
For the sake of testing, I define C(x,y) as a simple function:
conc = @(x,y) exp(-sqrt(x.^2 + y.^2) /2)
The integral2 function behaves as expected when I give it rectangular bounds:
integral2(conc,-1,1,-1,1)ans = 2.7565
Can anyone provide advice on how to modify the domain of interest in integral2? Or provide an alternative method? Thanks!
Best Answer