Method: Joules.energy_v2

Defined in:
lib/joules/thermodynamics.rb

.energy_v2(mass, specific_latent_heat) ⇒ Float

Note:

There are two other methods for calculating energy.

Calculates the energy given mass and specific latent heat.

Examples:

Joules.energy_v2(84.3, 72.1) #=> 6078.03

Parameters:

  • mass (Int, Float)

    mass >= 0; mass is in kilograms

  • specific_latent_heat (Int, Float)

    specific_latent_heat >= 0; specific_latent_heat is in joules per kilogram

Returns:

  • (Float)

    return value is in joules



42
43
44
# File 'lib/joules/thermodynamics.rb', line 42

def energy_v2(mass, specific_latent_heat)
  return mass * specific_latent_heat.to_f
end