Method: Joules.energy_v3

Defined in:
lib/joules/electricity.rb

.energy_v3(voltage, current, time) ⇒ Float

Note:

There are two other methods for calculating energy.

Calculates the energy given voltage, current, and time.

Examples:

Joules.energy_v3(1.8, 0.6, 5) #=> 5.4

Parameters:

  • voltage (Int, Float)

    voltage is in volts

  • current (Int, Float)

    current is in amperes

  • time (Int, Float)

    time >= 0; time is in seconds

Returns:

  • (Float)

    return value is in joules



318
319
320
# File 'lib/joules/electricity.rb', line 318

def energy_v3(voltage, current, time)
  return power_v2(voltage, current) * time
end