Experimental principle of capacitor charging and discharging