\(\)

## Magnetic field energy

Let’s start by calculating how much heat is produced as the current goes from a maximum value to zero.

At any moment in time, the current is producing heat in the resistor. If my voltage difference becomes zero at \(t=0\), then the amount of heat is produced as the current dies out $$ Q = \int_0^\infty i^2 R\,dt $$

Substituting \(I\) from \(\eqref{eq:lroff}\) $$ \begin{align*} Q &= R \int_0^\infty \left(i_{max}\,e^{-\frac{R}{L}t}\right)^2 \,dt \\ &= i_{max}^2 R \int_0^\infty e^{-\frac{2R}{L}t}, & \left( \int \rm{e}^{cx}dx=\frac{1}{c}\rm{e}^{cx} \right) \\ &= i_{max}^2 R \Big[ -\frac{L}{2R} e^{-\frac{2R}{L}t} \Big]_0^\infty \\ &= i_{max}^2 \bcancel{R} \frac{L}{2\bcancel{R}} \end{align*} $$

The heat produced is $$ \shaded{ Q =\frac{1}{2}L\, i_{max}^2 } \label{eq:lrheat} $$

### Density

We can now calculate how much energy there was in the magnetic field per cubic meter. This field was exclusively inside that solenoid.

We know

- The energy that is ultimately coming out from equation \(\eqref{eq:lrheat}\) $$ Q = \frac{1}{2}L\, i_{max}^2 \nonumber $$ you can drop the max. this simply tells you then that any moment in time that i am running a current through a solenoid, that the energy that is available in the solenoid in the forms of magnetic energy is one \(\frac{1}{2}LR^2\) $$ Q = \frac{1}{2}L\, I \label{eq:roundup1} $$
- Using Ampère’s law we derived $$ \begin{align} B &= \frac{\mu_0 I N}{l} \nonumber \\ \implies I &= \frac{B\,l}{\mu_0\,N} \label{eq:roundup2} \end{align} $$
- We know \(L\) from equation \(\eqref{eq:l2}\) $$ L = \mu_0\, \pi r^2 \frac{N^2}{l} \label{eq:roundup3} $$

The energy stored in the solenoid follows as $$ \begin{align*} Q &= \frac{1}{2}L\, I \\ &= \frac{1}{2} \left(\mu_0\, \pi r^2 \frac{N^2}{l}\right) \left(\frac{B\,l}{\mu_0\,N}\right)^2 \\ &= \frac{ B^2}{2\mu_0}\underbrace{\pi r^2 l}_\text{volume} \end{align*} $$

The term \(\pi r^2 l\) is the volume where the magnetic field exists, since we assumed that the magnetic field is zero elsewhere.

The magnetic field energy density, how much energy there is per cubic meter, is $$ \shaded{ \frac{Q}{\text{volume}} = \frac{ B^2}{2\mu_0} }\quad \left[\rm{\frac{J}{m^3}}\right] \tag{magnetic field density} $$

In principle, if we know the magnetic field everywhere in space, then you can integrate over all space and calculate how much energy is present in the magnetic field.

### Parallel with electric field density

Earlier, we did something similar for electric fields. We calculated the electric field energy density.

$$ \frac{W}{\rm{volume}} = \frac{1}{2} \varepsilon_0\kappa E^2 \nonumber $$

Note:

- In the case of the electric field, it represents the work that we have to do to arrange the charges in a certain configuration.
- In the case of a magnetic field, it represents the work that I have to do to get a current going inside a pure self-inductor. That means the resistance of the self-inductor is zero, and it takes work because the solenoid opposed the building up of current.