Alexander Fufaev
My name is Alexander FufaeV and here I will explain the following topic:

Energy of the Magnetic Field

We want to derive a formula for the energy \(W_{\text m} \) stored in a magnetic field. Even if we use a coil for the derivation, the formula is valid in general.

RL Circuit (Resistor, Coil)
Coil with a resistor connected in series (RL circuit).

Given a circuit with an resistance \(R \) (e.g. the internal resistance of a coil) and a coil of inductance \(L\) connected in series with \(R\). In addition, an AC voltage \(U(t)\) is applied to the circuit. It causes a time-dependent current \(I(t)\) to flow through the coil, which generates a magnetic field in the coil due to induction.

If the circuit is interrupted (voltage source switched off), the current \(I(t)\) through the coil does not immediately drop to zero, but decreases exponentially. The time-decaying current is described by the following exponential function:

Here \(I_0\) is the maximum current through the coil before the switch-off process.

The energy is not lost after the circuit is switched off, but is released in the form of thermal energy at the resistor. We can use the dissipated power \(P(t)\) (energy dissipated per time) at the resistor to calculate the total energy dissipated at the resistor. This dissipated energy must be the energy \(W_{\text m} \), which was previously stored in the magnetic field of the coil. So integrate the power over time from the time \(t=0\) of switching off, to the time \(t = \infty\) when the current has dropped to zero. Since the exponential function theoretically never reaches zero, the final time is infinite:

The electric power \( P(t) = U \, I \), in combination with Ohm's law, becomes \( P(t) = R \, I^2 \). Substituting in Eq. 2, we get an integration over the current:

The time-dependent, decaying current 1 is inserted into Eq. 3:

Now we have to calculate the integral:

Here the resistance \(R\) is cancelled. We can pull out the factor \(-\frac{L}{2}\) in front of the bracket and insert the two integration limits. The exponential function is zero at infinity:

The magnetic energy of the coil is thus determined by the inductance \(L\) and by the current \(I_0\) (amount of the current before the switch-off process) which has passed through the coil:

Magnetic energy expressed with B-field

Current-carrying coil with dimensions and magnetic field
A current-carrying coil generates a magnetic field.

The just derived energy of the magnetic field of the coil, expressed in terms of inductance, can also be formulated with the help of the B-field of the coil. By bringing the B-field into play, we can interpret the derived energy formula as an energy stored in the B-field.

Let the circuit described above be uninterrupted in the following. The magnitude of the magnetic field \(B\) inside a long coil is given by:

Here \(N\) is the number of turns, \(l\) is the coil length and \(\mu_0\) is the magnetic field constant. Since the circuit has not been switched off, the current \(I(t)\) continues to oscillate continuously, that is, it is a time-dependent quantity and, because of Eq. 8, so is the B-field.

The magnetic flux \(\Phi_{\text m} = B \, A \) penetrating the cross-sectional area \(A\) of the coil, combined with Eq. 8, is:

The law of induction, once expressed with \(L\) and once expressed with the time variation of the magnetic flux \(\frac{\text{d} \Phi_{\text m}}{\text{d} t}\), is:

The number of turns \(N\) occurs here because the magnetic flux passes through the coil cross-sectional area \(N\)-times. And \( U_{\text{ind}} \) is the induction voltage between the two ends of the coil.

Let's equate the two induction voltages in Eq. 10 and bring \(N\) to the right-hand side:

To connect Eq. 9 with Eq. 11, 9 is differentiated with respect to time \(t\). In this way, the time derivative of the current and the magnetic flux come into play as in Eq. 11:

Coefficients of Eq. 11 and 12 must be equal:

Bring the number of turns \(N\) to the right side of the equation:

Rearrange Eq. 8 for the B field (but this time with current \(I_0\)) with respect to current \(I_0\) and insert in magnetic energy 7. By doing this, you eliminate the current:

Substitute the inductance \(L\) from equation 14 into equation 15 to eliminate \(L\):

Cancel \(\mu_0\), \(N\) and \(l\), then you get:

Here the product \(A \, l \) corresponds to the volume \(V\) of the coil:

You get the energy density \(w_{\text m} = W_{\text m} / V \) of the B-field by dividing Eq. 18 by the volume \(V\):