0
$\begingroup$

Consider this arrangement

\begin{axis}[axis lines=middle,xmin=-4,xmax=4,ymin=-4,ymax=4,
xtick={-1.5,1.5},ytick={0},xticklabels={},axis equal,xlabel=$x$,ylabel=$z$]
    \addplot[black,very thick,domain=-1.5:1.5,samples=120] 
    {-sqrt( 1.5^2 - x^2 )};
    

    \addplot[black,very thick] coordinates {(-1.5,0)(-1.5,3.5)} node[pos=1,above]{$\infty$};
    \addplot[black,very thick] coordinates {(1.5,0)(1.5,3.5)}
    node[pos=1,above]{$\infty$};
    
    \addplot[mark=*,domain=0:0] {0} node[pos=1,above,right]{$P$};
\end{axis}

Current flows from the left wires downward in negative $z$-direction and continues like that through the U-turn and then upwards the second straight wire.

I want to determine the magnetic field due to this contraption in the origin, i.e. at position $\vec{p} = (0,0,0)^T$. According to Biot-Savart, it can be calculated using

$$ \vec{B}(\vec{p}) = \vec{B}(0) = \frac{\mu_0 I}{4 \pi} \int \frac{d\vec{l} \times (\vec{p} - \vec{r}^\prime)}{(r^\prime)^3} = -\frac{\mu_0 I}{4 \pi} \int \frac{d\vec{l} \times \hat{r}^\prime}{(r^\prime)^2} $$

For the left wire, introduce the angle $\alpha$ as

\begin{axis}[axis lines=middle,xmin=-4,xmax=4,ymin=-4,ymax=4,
xtick={-1.5,1.5},ytick={0},xticklabels={},axis equal,xlabel=$x$,ylabel=$z$]
    \addplot[black,very thick,domain=-1.5:1.5,samples=120] 
    {-sqrt( 1.5^2 - x^2 )};
    
    \addplot[black,very thick] coordinates {(-1.5,0)(-1.5,3.5)}node[pos=1,above]{$\infty$};
    \addplot[black,very thick] coordinates {(1.5,0)(1.5,3.5)}
    node[pos=1,above]{$\infty$};
    
    \addplot[black] coordinates {(0,0)(-1.5,1.5)};
    
    \addplot[black,domain=-0.5:-0.35] {(0.5^2 - x^2)^(1/2)} node[pos=0.5,left]          
    {$\alpha$};
    
    \node[below] at (-0.75,0) {$R$};
    \node[left] at (-1.5,0.75) {$z$};
    \node[above] at (-0.75,0.75) {$r$};
\end{axis}

We find that $d\vec{l} = -dz \hat{z}$, as well as $r^\prime = \sqrt{R^2 + z^2}$ and

$$ \hat{r}^\prime = \begin{pmatrix} -\cos(\alpha) \\ 0 \\ \sin(\alpha) \\ \end{pmatrix} $$

which leads to

$$ d\vec{l} \times \hat{r}^\prime = dz \begin{pmatrix} 0 \\ \cos(\alpha) \\ 0 \\ \end{pmatrix}. $$

Making use of the definition of the cosine, we additionally find that $\cos(\alpha) = \frac{R}{\sqrt{R^2 + z^2}}$. Then, the magnetic field due to the left wire is

$$ \vec{B}_1(0) = -\frac{\mu_0 I R}{4 \pi} \hat{y} \int_{\infty}^{0} \frac{dz}{(R^2 + z^2)^{3/2}}. $$

Carrying out the integration, however, tells us that the magnetic field points in the positive $y$-direction. By the right hand rule though, it should point in the negative $y$-direction. That would mean that there is a minus sign missing somewhere. I could imagine that the integration bounds are chosen wrongly, i.e. one would have to integrate from $0$ to $\infty$, not the other way around. However, I think the integration should follow the current direction, which is exactly as in the integral above.

Have I missed anything here? Thank you in advance.

$\endgroup$
4
  • 1
    $\begingroup$ Hello TeamPhysics and welcome to Physics SE. The code you have provided doesn't make any sense to many of us. You should at minimum provide something that would at least signpost us to the right direction to replicate your problem or provide some viable solution. For us that have absolutely no idea what this is about it is extremely difficult to do so. $\endgroup$
    – ZaellixA
    May 27 at 17:53
  • $\begingroup$ @ZaellixA I was hoping it would be possible to copy-paste it into a tikz-enviornment. My apologies, but I haven't yet figured out how to make tikz-code actually compile within this forum. Perhaps you know how it works and can share your wisdom with me. $\endgroup$ May 28 at 10:15
  • $\begingroup$ To be honest, I have no idea how to do that. In fact, I didn't even know what Tikz is until 2 minutes ago (which changed just because I checked it to answer your comment :D). Maybe someone else knows though if it is possible at all. $\endgroup$
    – ZaellixA
    May 28 at 17:57
  • $\begingroup$ It must be, I've seen it before. $\endgroup$ May 29 at 14:35

1 Answer 1

0
$\begingroup$

It has to do with the way you have it written. If you want to write it with the vector $\vec{p}$, then it should be written as

$$\vec{B}\left(\vec{p}\right)=\frac{\mu_0}{4\pi}\int \frac{Id\vec{l}\times (\vec{p}-\vec{r})}{\left|\vec{p}-\vec{r}\right|^3}=\frac{\mu_0}{4\pi}\int \frac{Id\vec{l}\times \vec{r}'}{\left|\vec{r}'\right|^3}$$

where $\vec{p}$ is the point where you are trying to determine the field at and $\vec{r}$ is the position of the current element.

$$\vec{p}-\vec{r}=\vec{r}'$$ where $\vec{r}'$ is the vector pointing from the element current to the point that we with to know the field at. If you are using $\vec{p}-\vec{r}$ and letting $\vec{p}=\vec{0}$, the that leaves you with

$$\vec{B}\left(\vec{0}\right)=-\frac{\mu_0}{4\pi}\int \frac{Id\vec{l}\times \vec{r}}{\left|\vec{r}\right|^3}=-\frac{\mu_0}{4\pi}\int \frac{Id\vec{l}\times \hat{r}}{\left|\vec{r}\right|^2}$$

Here, $\hat{r}$ points toward the current element, not toward the location of the field. This is where you sign issue is.

If you were to write the formula in

$$\frac{\mu_0}{4\pi}\int \frac{Id\vec{l}\times \vec{r}'}{\left|\vec{r}'\right|^3}=\frac{\mu_0}{4\pi}\int \frac{Id\vec{l}\times \hat{r}'}{\left|\vec{r}'\right|^2}$$

Then $\hat{r}'$ points in the direction you provided.

[EDIT] Sorry. I miss interpreted your $\hat{r}'$ because of the first formula you provided. Your $\hat{r}'$ is correct, but your bounds are not. They need to be flipped. This is where the sign issue is. When you integrate, you go from the least value to the greater value, even if your $d\vec{l}$ is pointed in the opposite direction. Sorry for any confusion earlier. That being said, the formulas should not be written in the form you have it, which was

$$\vec{B}\left(\vec{p}\right)=\frac{\mu_0}{4\pi}\int \frac{Id\vec{l}\times (\vec{p}-\vec{r}')}{(r')^3}$$

It should be

$$\vec{B}\left(\vec{p}\right)=\frac{\mu_0}{4\pi}\int \frac{Id\vec{l}\times (\vec{p}-\vec{r})}{\left|\vec{p}-\vec{r}\right|^3}$$

Hope this helps.

$\endgroup$
1
  • $\begingroup$ It helps a lot. Thank you. I always thought that $\vec{r}$ was the position vector from which the field is observed and $\vec{r}^\prime$ is the one integrated over. Thus I chose $\vec{r}^\prime$ to be within the integral. Theoretically, it should not matter what I name the variables, as long as the integration is carried out correctly and confusions are avoided by not naming two separate variables identically. $\endgroup$ May 28 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.