Capacitor energy from capacitance and voltage online calculator & Python code

[to-calculator-info][/to-calculator-info]

[calculator]

[calculator-input name=“c” label=“capacitance” unit=“C”][/calculator-input]

[calculator-input name=“v” label=“voltage” unit=“V”][/calculator-input]

[calculator-expression name=“e” formula=“0.5*c*v*v” unit=“J”]

[calculator-output name=“energy” unit=“J”] A <%= format(c, “F”) %> capacitor charged to <%= format(c, “V”) %> stores an energy of <%= format(e, “J”) %> [/calculator-output]

[/calculator]

Formula

$$E = \frac{1}{2}\cdot{}C\cdot{}U_p^2$$

Python code

You can use the UliEngineering library like this:

from UliEngineering.Electronics.Capacitors import capacitor_energy
from UliEngineering.EngineerIO import auto_format, auto_print

# These are equivalent:
energy = capacitor_energy("100 uF", "24 V") # energy = 0.0288 (J)
energy = capacitor_energy(100e-6, 24.0) # energy = 0.0288 (J)

# ... or get out a human-readable value:
energy_str = auto_format(capacitor_energy, "100 uF", "24 V") # "28.8 mJ"
# ... or print directly
auto_print(capacitor_energy, "100 uF", "24 V") # prints "28.8 mJ"

In case you can’t use UliEngineering, use this Python function:

def capacitor_energy(capacitance, voltage):
    return 0.5*capacitance*voltage*voltage

# Usage example:
print(capacitor_energy(100e-6, 24.0)) # prints 0.0288 (J)