In the last 3 lectures we have looked at effects of magnetic fields, ie. the forces they exert on moving charges.

In the next 3 we will look at their origins, the magnetic fields produced by various current configurations and the nature of materials that produce and respond to magnetic fields in particular ways.

Ampere's Law is a useful way to determine magnetic field in cases where symmetry makes it practical.

It is valid in cases where the magnetic field is *static*, or in other words when steady currents flow. This is called **magnetostatics**.

It also does not apply when magnetic materials are present.

It can however be modified to deal with both changing currents and magnetic materials, as we will see in later lectures.

Ampere's law relates the magnetic field that runs around the edge of a closed surface to the current that passes through that surface and is

$\oint\vec{B}\cdot\,d\vec{l}=\mu_{0}I_{encl}$

The new constant $\mu_{0}=4\pi\times10^{-7}\mathrm{Tm/A}$ is called the permeability of free space.

$d\vec{l}$ is an infinitesimally small length element which points in the direction of a the path around the edge.

While any path/surface can be chosen, smart use of Ampere's law relies on using symmetry to make the integral easy.

For a current carrying wire the right hand rule tells us to choose a circular loop centered on the wire, in which case

$\oint\vec{B}\cdot d\vec{l}=\oint B\,dl$

because $\vec{B}$ is always parallel to $d\vec{l}$, and as the path is circular

$\oint B\,dl=B\oint \,dl=B(2\pi r)$

So we find that

$B(2\pi r)=\mu_{0}I\to B=\frac{\mu_{0}I}{2\pi r}$

If we consider two wires in parallel carrying $I_{1}$ and $I_{2}$, separated by a distance $d$ the field due to the first wire at the position of the second is

$B_{1}=\frac{\mu_{0}}{2\pi}\frac{I_{1}}{d}$

so the force experienced a segment of the second wire of length $l_{2}$ is

$F_{2}=I_{2}B_{1}l_{2}=\frac{\mu_{0}}{2\pi}\frac{I_{1}I_{2}}{d}l_{2}$

The force exerted on the other wire is of course equal and opposite, which can be deduced either from Newton's third law or by considering the field from wire 2 on wire 1.

The direction of the force depends on the relative directions of the current, wires with currents in the same direction experience and attractive force, those with currents in opposite directions repel each other.

One can visualize how the force between the two wires varies with current and distance with this app.

When we consider the magnetic field due to more than one field source we need to remember to take in to account the magnetic field is a vector. This can be nicely visualized using this applet.

We should reconcile the field distributions we get with Ampere's law.

The magnetic field along the path can come from more than one source, but the integral is equal only to the enclosed current.

This means that in the situations we just looked at where the field is either larger or smaller at the point between the wires, the change in $\vec{B}\cdot\,d\vec{l}$ must be compensate by a change in $\vec{B}\cdot\,d\vec{l}$ somewhere else on the path so that $\oint\vec{B}\cdot\,d\vec{l}$ is no different from when a single wire is isolated.

Here is another visualization of two parallel (opposite) currents.

In a tightly wound solenoid we can deduce that the field strength inside is much greater than outside, and that also components of the magnetic field perpendicular to the solenoid axis cancel out. Falstad's applet is useful for visualizing this.

We can see that the integral $\oint\vec{B}\cdot d\vec{l}$ reduces to $\int_{c}^{d} B dl$ which is simply $Bl$. If the rectangle includes $N$ wires then

$Bl=\mu_{0}NI$

This is more usefully expressed in terms of the number density of wires in a unit length, $n$

$B=\mu_{0}\frac{N}{l}I=\mu_{0}nI$

One important point to realize is that the field inside the solenoid is uniform, we could place the edge of our rectangle in any position within the solenoid and get the same result.

Similar arguments can be made for torodial solenoid.

Here, we must consider that the path along which the field is constant is bent.

As we have a full circle we can take a circular path of radius $r$. Click here for a figure that illustrates the geometry.

Within the interior radius of the torodial solenoid the enclosed current is zero, and thus also the magnetic field is zero, as

$\oint\vec{B}\cdot d\vec{l}=B(2\pi r)=0$

Within the solenoid, which has $N$ turns

$\oint\vec{B}\cdot d\vec{l}=B(2\pi r)=\mu_{0}NI\to B=\frac{\mu_{0}NI}{2\pi r}$

And outside of the solenoid we again find

$\oint\vec{B}\cdot d\vec{l}=B(2\pi r)=0$

Within a uniform wire carrying a current $I$ the magnetic field as a function of $r$ can be found from

$\oint\vec{B}\cdot d\vec{l}=B(2\pi r)=\mu_{0}I_{encl}$

Inside the wire $I_{encl}=I\frac{\pi r^{2}}{\pi R^{2}}$ so

$B(2\pi r)=\mu_{0}I\frac{\pi r^{2}}{\pi R^{2}}\to B=\frac{\mu_{0}Ir}{2\pi R^{2}}$

Outside the wire $I_{encl}=I$ so

$B=\frac{\mu_{0}I}{2\pi r}$

Consider the following two figures (courtesy Michael Folwer, UVa).

In the first case, a current $I$ flowing to the left creates a magnetic field, which will accelerate the moving charge upwards.

In the second case, one can insist that there must be an electric force of equal magnitude.

How does one reconcile the situation?

Special Relativity shows the way!

Due to length contraction, there is net linear positive charge density that will result an the requisite repulsive electrical force.

Moreover, one can show that the length contraction formula leads to $1/c^2 = \mu_0\epsilon_0$!!