An LC circuit comprises an inductor and a capacitor. Consider an LC circuit where an inductor is connected across a charged capacitor. Here, current flows through the inductor, building up a magnetic field around it. This changes the potential across the capacitor and induces an EMF across the inductor. These EMFs are used to obtain the equation of the LC circuit. This is equivalent to the equation of a simple harmonic oscillator where displacement is replaced by charge. Initially, when the circuit is open, no current flows; therefore, the total energy is stored as electrical energy. When the circuit is closed, current flows through the inductor, transferring all the electrical energy into magnetic energy. At any arbitrary time, the total energy of the LC circuit is the sum of the electrical and magnetic energy. If there is no energy dissipation, the total energy remains conserved and oscillates between the capacitor and inductor. This case is similar to a simple harmonic oscillator where energy oscillates between potential and kinetic energy.