Write out the charging and discharging principle of capacitors