Error executing triple intergration equation. I am getting 'Not a Number (NaN)' as output for the triple integration equation attached below (Image file). I have mentioned the code used also. Kindly help me in knowing where I am wrong.
1 次查看(过去 30 天)
显示 更早的评论
CODE:
syms x
syms y
syms phi
N=10;
u=4*pi*(10^-7)
a=0.045;
b=0.05;
fun=@(x,y,phi) (cos(phi).*(x.*y))./(sqrt((x.^2)+(y.^2)-(2.*x.*y.*cos(phi))))
q=integral3(fun,a,b,a,b,0,3.14)
L=q.*(u.*(N.^2))/((b-a).^2)
OUTPUT:
q = NaN
L = NaN
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/213455/image.jpeg)
8 个评论
Walter Roberson
2019-4-15
x=y is a singularity only at phi = 0.
x = -y would be a singularity at phi = Pi, but with the range of a and b values were are given, that does not happen.
At all other angles in (0, Pi) exclusive, the division by sqrt(x^2 + y^2 - 2*x*y*cos(theta)) does not lead to a singularity.
David Goodmanson
2019-4-15
编辑:David Goodmanson
2019-4-15
Hi Torsten,
Not totally obvious, but if xvec and yvec are vectors expressed in polar coordinates (x,phix) and (y,phi) about the origin, this starts out as the integral
cos(phi-phix) / |yvec-xvec|
with area elements
xdx dphix and ydy dphi,
integrated over a circular annulus of inner and outer radii a and b. Toss in some constants and it's the self inductance of the annulus.
After doing the y and phi integrations, by symmetry the answer can't depend on phix. So you can assume that phix = 0 and multiply by 2pi later. This gives the integral in the original question, which has a singularity at phi=0, x=y as you mentioned. But cos(phi) = 1 there so the integrand is basically 1/|yvec-xvec|. Take xvec as the new origin and coordinates r and theta to describe yvec-xvec. For a small circle of radius B centered about xvec, this becomes
Integral (1/r) rdr dtheta = 2pi B
so the integral is bounded. But it takes a new set of coordinates to allow the new area element to cancel out the 1/r behavior. That's why I mentioned separate regions of integration before.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!