Method: Joules.capacitor_potential_energy_v1

Defined in:
lib/joules/electricity.rb

.capacitor_potential_energy_v1(charge, voltage) ⇒ Float

Note:

There are two other methods for calculating capacitor potential energy.

Calculates the capacitor potential energy given charge and voltage.

Examples:

Joules.capacitor_potential_energy_v1(1.5, 30) #=> 22.5

Parameters:

  • charge (Int, Float)

    charge is in coulombs

  • voltage (Int, Float)

    voltage is in volts

Returns:

  • (Float)

    return value is in joules



155
156
157
# File 'lib/joules/electricity.rb', line 155

def capacitor_potential_energy_v1(charge, voltage)
  return 0.5 * charge * voltage
end