An electric circuit that is made up of an inductor (L) and a capacitor (C) is called LC circuit. Both inductor and capacitor are connected with a single current.
A circuit that consists of both inductor and oscillator can oscillate without being supplied by an EMF. This is achieved by shifting the energy that is stored in the circuit between the electric field and the magnetic field.
When the switch is off, the capacitor starts discharging, which produces current, which creates a magnetic field in the inductor.
The energy stored in it oscillates between electric and magnetic fields at a frequency, which is known as the resonant frequency.
Harmonic oscillator:
A harmonic oscillator is a system in which particles oscillate above and below the mean value at a particular frequency.
The force acting on it is directly proportional to its displacement.
Some examples of this are simple pendulum and mass-spring systems.
LC circuit as a harmonic oscillator:
LC circuit is an example of a harmonic oscillator.
The current and charge in an LC circuit are analogous to the mass and spring of a harmonic oscillator.
This is because the energy stored in the electric field between plates of capacitor changes to being stored in the magnetic field of the inductor.