supercapacitor charging and discharging circuit matlab