## Shapes of Wires and Magnetic Fields

Thus far, we have primarily been talking about the magnetic field from a current in a long, straight wire. However, there are many shapes of wire in the real world that do not correspond to straight wires. Particularly relevant to this class will be a coil of wire and something we will call a solenoid. These notes go more into detail about what coils and solenoids are, and what the magnetic field looks like from both coils and solenoids.

## Coils

A coil is when a length of wire with current running through it has been wrapped around on itself creating some sort of shape as shown in the figure to the right. (You may also hear a coil referred to as a “current-carrying coil”, “a loop”, or “a ring”.) Typically, we will use circular coils because the mathematical calculations are easier for a circular coil, but you could also have a rectangular coil or some other shape. In these notes, we will focus on how to deal with the circular part of the wire, as we have already talked about how to calculate the magnetic field from current in a straight wire.

In a circular coil, the current through the wire would run either **clockwise or counter-clockwise around the loop**. If we wanted to calculate the magnetic field from that current, we could use the Biot-Savart Law
$$\vec{B}_{tot}= \int \frac{\mu_0}{4 \pi}\frac{I \cdot d\vec{l}\times \hat{r}}{r^2}$$
where the $d\vec{l}$ now would need to represent a small piece of the circular loop, rather than a small piece of the straight wire. This is shown in the figure above, where the circular coil now is drawn in the xy-plane and the z-direction points straight through the center of the coil.

The example below shows the calculation for the magnetic field at the center of a circular coil for a counterclockwise current. Because the circular coil is highly symmetric, we get a fairly simple answer for the magnetic field at the center of the coil (in the plane of the coil):
$$\vec{B}=\frac{\mu_0 I}{2R} \hat{z}$$
Which depends only on the current going through the coil $I$ and the radius of the coil $R$. The direction of the magnetic field comes from the cross product of the $\vec{r}$ with each $d\vec{l}$ in the coil, which we can check with the right hand rule. If you point your fingers in the direction of the current at any point on the coil and curl them toward the center of the circular coil, your thumb will always be pointing up in the $+\hat{z}$ direction. * Note this equation is only true for the magnetic field at the center of a circular coil* - if you have a different observation point or a different shape of coil, this equation will no longer give you an accurate magnetic field.

We could also calculate the magnetic field for an observation point at the center of the coil, but out of the plane of the ring (shown in the figure to the left). In this case, we would follow the same process as in the example; however, now the r-vector would have a z-component:
$$\vec{B}=\frac{\mu_0 I}{2} \frac{R^2}{(z^2+R^2)^{3/2}} \hat{z}$$
Where $R$ is still the radius of the coil, $I$ is the current going around the loop, and $z$ is the distance away from the center of the loop. If you set $z=0$ (in other words you put the observation point back at the center of the coil), you get the same equation as above. * Note this magnetic field is only true for an observation point at the center of the circular coil, but out of the plane of the ring* - if you have a different observation point or a different shape of coil, this equation will no longer give you an accurate magnetic field.

If you look at many observation points around a circular coil, there is a pattern to the magnetic field produced by that current - the field points through the center of the coil and then wraps around on the outside of the coil. This is shown in the figure below. For such a coil, the magnetic field is strongest in the center of the coil and has a smaller magnitude as you move further away from the coil. If you increase the amount of current or decrease the radius of the coil, you can create a stronger magnetic field. You could also increase the magnitude of the magnetic field by increasing the number of loops in the coil (or how many circular loops you have).

You also may have noticed that this pattern to the magnetic field looks similar to the magnetic field from a bar magnet that we talked about previously - this makes the circular coil a powerful tool. Scientists and engineers will often model a bar magnet (or the Earth's magnetic field) using a circular coil because it is easier to handle mathematically when compared to thinking about the individual atoms/domains in a material. We will return to this idea of a coil of wire frequently over the remaining weeks of the semester.

## Solenoids

A solenoid is similar to a coil, but instead of having multiple loops of wire one on top of another, the loops are spread out (kind of like a slinky). An example of a solenoid is shown in the figure on the right. As the solenoid is composed of multiple, connected loops, this creates a strong magnetic field in the center of the solenoid, which becomes weaker and wraps around the outside of the solenoid. Because of the superposition of the magnetic field, the field inside the solenoid is actually *constant* both in magnitude and direction. This makes the solenoid a very important application as it is one of the primary ways that we can create a constant magnetic field on Earth.

We'll talk more about the magnetic field in a solenoid in the next couple weeks when we talk about Ampere's Law, which is a cool mathematical trick for calculating symmetric, constant magnetic fields.