# Magnetic Field Calculation for Spherically Shaped Coil

1. Jul 1, 2014

### joshchab

Hello, I'm attempting to calculate the magnetic field $\mathbf{B}$ outside of a coil with current density, $\mathbf{J}$, and whose volume is a section of a sphere. Here is a diagram of the cross-section of the coil:

(The wire ridges are aesthetic and aren't considered in the calculations - I'm assuming a solid volume. Also, the origin of my coordinate frame is coincident with the spherical center of the coil - where the z and y axes cross in this diagram. ...Also, I've just realized that the diagram doesn't exactly show the volume produced by my integration bound, but that doesn't affect my question.)

I'm trying to apply the Biot-Savart law:

$$\mathbf{B}(\mathbf{r}) = \frac{\mu_0}{4\pi}\int_{r_a}^{r_b}\int_{\theta_a}^{\theta_b}\int_{-\pi}^\pi\ \frac{\mathbf{J} \times (\mathbf{r}-\mathbf{r}')}{|\mathbf{r}-\mathbf{r}'|^3} \, r'^2\,\sin \theta \,d\phi\,d\theta\,dr'$$

As can be seen from this triple integral, I'm using spherical components to simplify things.

Because of the spherical nature of this problem, I figure it's best to use a spherical coordinate frame to describe $\mathbf{r}'$ and $\mathbf{J}$. However, I confuse myself when trying to do this. Am I correct in thinking:

$$\mathbf{r}' = \begin{pmatrix} r' \\ 0 \\ 0 \end{pmatrix} \quad \mathrm{and} \quad \mathbf{r} = \begin{pmatrix} r \\ 0 \\ 0 \end{pmatrix}$$?

Additionally, I want my current vector to be tangential to the axis of symmetry of the coil and perpendicular to the cross-sectional plane in the diagram and am unsure if this would be a correct description:

$$\mathbf{J} = J\begin{pmatrix} 1 \\ \pi/2 \\ \phi \end{pmatrix}$$

Also for reference, I'm confident that these vector quantities are as follows in the Cartesian frame:

$$\mathbf{r}' = \begin{pmatrix} r \sin\theta\cos\phi \\ r \sin\theta\sin\phi \\ r\cos\theta \end{pmatrix}$$

$$\mathbf{J} = J \begin{pmatrix} -\sin\phi \\ \cos \phi \\ 0 \end{pmatrix}$$

Just to recap, can someone please advise me about my vectors and their description in a spherical frame? Also, do you think a spherical frame is advantageous? Thanks!

Last edited: Jul 2, 2014
2. Jul 2, 2014

### jambaugh

The difficulty is that your $\mathbf{r}$ is an arbitrary vector... not as you have written it.
For vectors I suggest you stick to the Cartesian frame when writing components. ( since you have an $r'^2$ factor in your integration I'm presuming $\mathbf{r}'$ points to your volume element and $\mathbf{r}$ points to the point at which you want the B field calculated.)

Your problem may be intractable for the B field at other than the origin or along the z axis. Maybe not... but may be.

Given the spherical symmetry you can wolog find the B field at a point in say the x,z plane, setting y=0.

$$\mathbf{r} = \langle a, 0 , b\rangle$$
(in cartesian frame)

Use this with your cartesian frame $\mathbf{r}' = \langle r \cos\phi \sin\theta, \cdots\rangle$.

I suspect you'll end up with elliptic integrals.

3. Jul 3, 2014

### joshchab

Thanks for the response jambaugh. The position vector in spherical coordinates has always confused me. In my spacecraft mechanics class, the spherical position vector was always $\mathbf{r} = r\,\hat{r}$. Can you expound on why this position vector is invalid in my situation? Here's an updated diagram, by the way:

Also, I think you're correct about this problem being insoluble - I attempted to compute the triple integral using Cartesian vectors and my symbolic solver didn't come to an answer. Additionally, I did some snooping around for the magnetic field of a cylindrical coil and that solution has elliptic integrals in it so this one likely will if it's even possible to solve. I'll try again with the 2D version as you recommended and see if that helps at all.

Thanks!

4. Jul 16, 2014

### jambaugh

$r\cdot \hat{r}$ is the vector $\mathbf{r}$ provide $|\mathbf{r}|=r$ and provided that $\hat{r}=1/r \mathbf{r}$. That's true of any vector $\mathbf{r}$ and I'm just stating here a tautology (r/r=1).

Your initial problem as I see it is in trying to use coordinate bases at a point away from the initial set of coordinates, or at least in dealing with a difference in two position vectors only one of which is at the position indicated by the coordinates.

What your wrote would be correct if you indicated the distinct bases of the two component expositions:

$$\mathbf{r}' = \begin{pmatrix} r' \\ 0 \\ 0 \end{pmatrix}_{[\hat{r}',\hat{\theta}',\hat{\phi}']}$$
$$\mathbf{r} = \begin{pmatrix} r \\ 0 \\ 0 \end{pmatrix}_{[\hat{r},\hat{\theta},\hat{\phi}]}$$

Since you are simultaneously talking about two distinct points, the source point from a differential element of current and the point at which your are measuring a magnetic field, you have two distinct sets of coordinates (polar or other) and if you define coordinate bases for vectors you'll have two distinct bases, requiring some transformation to map one to the other...
or you can use a common basis which will no longer be "coordinate" with at least one of your two points. You might as well make it coordinate with neither and use constant basis, i.e. the cartesian one.

Final remark: Remember vectors really represent actions (e.g. displacements) not objects, we define position vectors only relative to an original position we all agree to be "the origin". So your problem has 3 distinct points, the origin, the source point, and the point at which you calculate B field.

So in particular, we have both vectors and position points overlaid but they are really in distinct spaces and in fact distinct types of spaces. But due to flatness they end up isomorphic and we can "identify" them. This is the source of your confusion imnsho as you need to see their distinctness explicitly before you take their identification for granted. In doing that you can appreciate that the vector basis needn't at all correspond with the coordinate system you use. But your confusion is also the beginnings of the higher level abstraction where the question of how we map vectors over there to vectors over here becomes non-trivial when the manifold has curvature and is no longer a vector space. Things get interesting and set the stage for Einstein's GR.

5. Jul 17, 2014

### joshchab

Thanks for the clarification! You explained it very well, and it all makes sense now. Thanks for all your help!