## Wednesday, January 11, 2017

### A calculation in magnetostatics

I wanted to calculate the magnetic field generated by a current which flows down the positive $z$-axis, hits the origin and then spreads out radially over the $xy$ plane, see figure 1.
 Figure 1
I started the calculation as follows. First I obtained the magnetic field generated by a semi-infinite wire. If the current comes out of the point $0$ (see figure 2), then the magnetic field in point $P$ is [1] $$\label{eq:21070108a} B_1(P) = \frac{\mu_0}{4 \pi\ s^2}\left( 1 + \frac{\vec I \cdot \vec P}{||\vec I||\ ||\vec P||} \right) \vec I \times \vec P$$ with $s$ the distance between $P$ and the wire.
 Figure 2
The magnetic field $B_2$ coming from all the currents in the $xy$ plane can be calculated by integrating \eqref{eq:21070108a}. The result is $$\label{eq:21070108b} B_2(P) = \frac{\mu_0 I}{4 \pi}\left( \frac{z}{||\vec P||} \pm 1\right)\frac{1}{x^2 + y^2} \hat z \times \vec P$$ The plus sign holds if $z < 0$, the minus sign if $z >0$. The vector $\hat z$ is the unit vector pointing in the direction of the $z$-axis. If I add $B_2$ to the field coming from the current flowing down the z-axis, some terms cancel and I get the final simple result. \begin{align*} B(P) & = \frac{\mu_0 I}{2 \pi s^2} \hat z \times \vec P\quad\text{if}\quad z>0\\ &=0 \quad\text{if}\quad z <0 \end{align*} with $s$ the distance between $P$ and the $z$ axis. For $z>0$, $B$ is exactly equal to the magnetic field of an infinite wire! When I saw the final result, I realized it was easy to see that it was correct. Indeed, for $z<0$ Maxwell's equations are trivially satisfied because the field is zero. For $z>0$ they are also satisfied because the field is equal to magnetic field of an infinite wire. Finally, the currents in the $xy$ plane are also taken into account correctly. For example, take an Amperian loop as in figure 3.
 Figure 3, $\gamma_1$ is above the $xy$ plane, $\gamma_3$ is below.
Only the integral over $\gamma_1$ contributes. Also I know already that AmpĂ¨re's law is satisfied for $z > 0$ and the magnetic field is rotationally symmetric. Therefore $$\int_{\gamma} B \cdot dl = \mu_0 I \frac{\alpha}{2 \pi}$$ with $\alpha$ the angle spanned by the curve $\gamma_1$

[1] This is easily obtained from standard formulas, see for example Example 5.5 in Griffiths, Introduction to Electrodynamics.
[2] It is also easy to generalize the above result to semi-infinite wires that make an angle with the $xy$ plane.