If we apply a voltage difference across a coil, a current will flow, creating a magnetic field.
A magnetic material can be thought of as containing many miniature magnets that align with the field created by the coil, thereby strengthening the magnetic field.
After 100% of the magnets are already aligned, increasing the magnetic field even further involves much greater increases to the current.
If we apply a voltage difference in the reverse direction, the current gradually decreases.
As the current decreases, there is also a decrease in the percentage of magnets aligned in the same direction.
However, when the current reaches zero, many of the magnets are still aligned in the same direction, and a magnetic field is therefore still present.
Therefore, even in the absence of a current, the two halves of this magnetic material will now feel an attractive force towards each other.
We refer to this by saying that this material has been magnetized.
We can demagnetize the material by applying a current in the opposite direction.
Assuming the coil has zero resistance, the voltage difference across the coil is proportional to the rate at which the magnetic field changes.
A constant voltage difference is therefore associated with a magnetic field that changes at a constant rate.
We are now magnetizing the material in the opposite direction.
Eventually, all these magnets will be aligned in the opposite of the previous direction.
If we reverse the direction of the voltage again, we will again reduce the percentage of magnets aligned in the same direction.
The strength of the magnetic field multiplied by the size of the material’s cross section area is what we call "magnetic flux."
There is still a magnetic flux present when the current returns to zero, due to the fact that many of the magnets are still aligned in the same direction.
In this sense, the material retains a memory of the current that recently passed through the coil.
The percentage of magnets that are still aligned in the same direction when the current returns to zero depends on the type of magnetic material we select.
Materials where a high percentage of magnets are still aligned when the current is zero, dissipate more energy as heat as the magnets flip back and forth.
Here, energy is being supplied from the circuit.
Some of this energy is being dissipated as heat in the material, and some of this energy is being stored in the magnetic field.
Here, some of the energy stored in the magnetic field is being returned to the circuit.
The energy returned from the magnetic field to the circuit is equal to the area highlighted here in orange.
We can tell if energy is being returned to the circuit, or if energy is being supplied from the circuit, based on the direction of the current relative to the direction of the voltage difference across the coil.
Here, energy is being supplied from the circuit and the energy supplied by the circuit is equal to the area highlighted in blue.
Magnetic fields do not like to change, and they therefore try to prevent the current from changing.
When we want to increase the current, the magnetic field fights against this increase and we therefore need to supply energy from the circuit.
When the current decreases, the magnetic field tries to keep the current going, and energy is therefore returned from the magnetic field to the circuit.
Here, the energy returned to the circuit is equal to the area highlighted in orange at the bottom.
The energy supplied by the circuit is equal to the area highlighted here in blue.
Notice that the energy supplied by the circuit is greater than the energy returned to the circuit.
This is because some of the energy is lost as heat, as the magnets flip back and forth.
The energy lost as heat during each full cycle is equal to this blue area inside the curve.
We are ignoring the energy lost as heat in the resistance of the coil, because we are assuming that the wires have zero resistance.
We are also ignoring the energy lost as heat in eddy currents induced inside the magnetic material, because we are assuming that the magnetic material can’t conduct any current.
Much more information is available in the video "Electromagnetism -- Maxwell’s Laws"
Special thanks to all the people supporting us on Patreon.
Your support is very much appreciated.