An LC circuit contains a capacitor and an inductor and can oscillate even with no battery present. If a charged capacitor is connected to an inductor, the capacitor begins to discharge, current grows, and energy is transferred into the magnetic field of the inductor. Once the capacitor is fully discharged, the current is maximum, but the inductor keeps the current going, recharging the capacitor with opposite polarity. This produces oscillation between electric-field energy and magnetic-field energy.
The loop rule for an ideal LC circuit is
with , so
or
This is the differential equation of simple harmonic motion. Therefore,
with
and
So LC circuits are the electrical analogue of mass-spring oscillators.