electricpy.passive.timedischarge

electricpy.passive.timedischarge(Vinit, Vmin, C, P, dt=0.001, RMS=True, Eremain=False)[source]

Capacitor Discharge Time Formula.

Returns the time to discharge a capacitor to a specified voltage given set of inputs.

Parameters:
Vinit : float

Initial Voltage (in volts)

Vmin : float

Final Voltage (the minimum allowable voltage) (in volts)

C : float

Capacitance (in Farads)

P : float

Load Power being consumed (in Watts)

dt : float, optional

Time step-size (in seconds) (defaults to 1e-3 | 1ms)

RMS : bool, optional

if true converts RMS Vin to peak

Eremain : bool, optional

if true: also returns the energy remaining in cap

Returns:

  • Returns time to discharge from Vinit to Vmin in seconds.

  • May also return remaining energy in capacitor if Eremain=True