Consider an LC circuit connecting a charged capacitor with an inductor. When the circuit is closed, the capacitor discharges through the inductor, transferring energy from the electric field to the magnetic field. The current continues to flow towards the discharged capacitor as the inductor resists a change in current through it. This continued current charges the capacitor with opposite polarity, increasing the capacitor's electric field while decreasing the inductor's magnetic field. The charged capacitor again discharges, converting electrical energy to magnetic energy. On re-charging the capacitor, energy flows back to the capacitor, and the initial state of the circuit is restored. If there is no energy dissipation, the charges on the capacitor continue to change polarity indefinitely, called electrical oscillations. Here, the charge on the capacitor and the current through the inductor varies sinusoidally with time. Initially, when the charge on the capacitor is at maximum, the current in the inductor is zero. As time progresses, the charge becomes zero on the capacitor, and the current becomes maximum in the inductor. With time, the process reverses and repeats itself.