# Is $\vec{B}=0$ in an infinite cylinder with localized magnetization? [duplicate]

Say we have an infinite cylinder, with constant magnetization $$M(z)\hat{z}$$ along its axis. This vanishes for large $$|z|$$, say like $$e^{-z^2}$$.

It seems to me that the solution to the equations $$\vec{\nabla}\times\vec{H}=0=\vec{\nabla}\times\vec{M}$$ and $$\vec{\nabla}\cdot\vec{H}=-\vec{\nabla}\cdot\vec{M}$$ is simply $$\vec{H}=-\vec{M},$$ which would lead to $$\vec{B}=0$$ from the equation $$\vec{B}=\mu_0(\vec{H}+\vec{M})$$. Is this correct?

On the other hand, since the cylinder is infinite and there is no free current, I would be tempted to conclude that $$\vec{H}=0$$.

Perhaps $$\vec{H}$$ is neither $$-\vec{M}$$ nor $$0$$, but how do I compute it?

I am confused about magnetostatics...

• @ProfRob please have a look at my answer to see if it makes sense Jun 1 at 22:37

Since $$\overrightarrow{M}\neq\overrightarrow{0}$$ inside the cylinder and $$\overrightarrow{M}=\overrightarrow{0}$$ outside, $$\overrightarrow{\nabla}\times\overrightarrow{M}\neq\overrightarrow{0}$$ at the cylinder sides. Therefore, $$\overrightarrow{H}+\overrightarrow{M}\neq \overrightarrow{0}$$ holds at almost all points.

[Edit #1] Work in the cylindrical coordinate $$(\rho,\phi,z)$$ and assuming that the radius is $$\rho_0$$. If the magnetization is given of the form $$M_z=M_z^0-M_z^0H(\rho-\rho_0)$$, where $$H(\rho)$$ is the Heaviside step function. $$\vec{\nabla}\times\vec{M}|_{\hat{\phi}}=\frac{\partial M_\rho}{\partial z} -\frac{\partial M_z}{\partial \rho} =-\frac{\partial M_z}{\partial \rho} =\frac{\partial M_z^0H(\rho-\rho_0)}{\partial \rho} =+M_z^0\frac{\partial H(\rho-\rho_0)}{\partial \rho} =+M_z^0\delta(\rho-\rho_0)$$ Here, $$\delta(\rho)$$ is the Dirac's delta function. Thus, $$\vec{\nabla}\times\vec{M}$$ is not zero at the side position of cylinder.

• I believe $\vec{\nabla}\times\vec{M}=0$ everywhere in this case May 28 at 11:57
• If infinite length and constant magnetized magnet, $\bf{H}=0$ and $\bf{M}=$constant and $\bf{B}=\mu_0\bf{M}$ inside magnet. We have to solve Maxwell equation together with the constitutive relation $\bf{B}=\mu_0(\bf{H}+\bf{M})$. (Sorry I made 2 sign mistakes in the edited portion. The last 2 terms are + instead of -) May 28 at 22:46
• please have a look at my answer to see if it makes sense Jun 1 at 22:37

Let me try to answer my own question to see if what I am thinking makes sense.

Step 1) There are no free currents, so $$\vec{\nabla}\times\vec{H}=0$$ and we can define a scalar magnetic potential $$U$$ so that $$\vec{H}=\vec{\nabla}U$$. Then it must satisfy $$\nabla^2 U=-\vec{\nabla}\cdot \vec{M}=2ze^{z^2}.$$ Also, $$U$$ is continuous at the cylinder boundary, and its partial derivatives $$\frac{\partial U}{\partial r}$$ and $$\frac{\partial U}{\partial z}$$ are also continuous.

Step 2) Writing the laplacian in cylindrical coordinates and assuming azimuthal symmetry, we have inside the cylinder $$\frac{1}{r}\frac{\partial}{\partial r}\left(r\frac{\partial U}{\partial r}\right)+\frac{\partial^2 U}{\partial z^2}=2ze^{z^2}.$$ With $$U=R_{in}(r)Z_{in}(z)$$ we can separate variables to get $$\frac{1}{r}\frac{d}{d r}\left(r\frac{dR_{in}}{d r}\right)=-k^2R_{in}$$ and $$\frac{d^2 Z_{in}}{d z^2}=k^2Z_{in}+2ze^{z^2}Z_{in}$$ for some separation constant $$k$$.

So the function $$R_{in}(r)=J_0(kr)$$ is a Bessel function and function $$Z_{in}(z)$$ is something complicated.

Step 3) Again writing the laplacian in cylindrical coordinates and assuming azimuthal symmetry, we have outside the cylinder $$\frac{1}{r}\frac{\partial}{\partial r}\left(r\frac{\partial U}{\partial r}\right)+\frac{\partial^2 U}{\partial z^2}=0.$$ With $$U=R_{out}(r)Z_{out}(z)$$ we can separate variables to get $$R_{out}(r)=J_0(qr)$$ and now $$\frac{d^2 Z_{out}}{d z^2}=q^2Z_{out},$$ for some separation constant $$q$$.

Step 4) Continuity of $$U$$ and its radial derivative imply $$q=k$$. Continuity of derivative with respect to $$z$$ for every $$z$$ is not possible since $$Z_{out}$$ is very different from $$Z_{in}$$. I think the only way out is if $$U(R,z)=0$$ for all $$z$$, which implies $$k$$ must be $$\gamma_n/R$$ where $$\gamma_n$$ is a zero of $$J_0$$.

So $$U(r,z)=\sum_n J_0(\gamma_nr/R)Z_{in}(n;z)$$ for $$r and $$U(r,z)=\sum_n J_0(\gamma_nr/R)Z_{out}(n;z)$$ for $$r>R$$.

Assuming I could find $$Z_{in}(n;z)$$, I could compute the gradient of this function and it would give me the field $$\vec{H}$$.

Is this calculation correct?

• I think this is a kind of "check my work" question. I have no motivation to investigate your question. One comment. I think the magnetic scalar potential is a useful mathematical tool for solving electric current-free type problems. If it were not a static magnetic field problem with electric current, I would think that solving a restricted problem using magnetic scalar potentials would be helpful. Jun 4 at 0:02