Hi everyone,
I have to compute double integral for the expression G over phi and theta in the following code numerically. Does anyone have any idea how it must be done, since it is not easy to use trapz or integral2 because of the definition of the variables!
c = 4.2;d = 10;r3 = linspace(c, d, 100);theta = linspace(-pi/2, pi/2, 100); theta2 = linspace(-pi/2 ,pi/2, 100); Phi = linspace(0, 2*pi, 100);Phi2 = linspace(0, 2*pi, 100);G = r3.*(sin(theta2).*cos(theta).*cos(phi2-phi) - cos(theta2).*sin(theta)) ./(r3.^2 + c.^2 - 2.*r3.*c.*(sin(theta2).*sin(theta).*cos(phi2-phi)+cos(theta2).*cos(theta))).^3/2 ;
Best Answer