Class: PhysicsPlus::Quantums

Inherits:
Object
  • Object
show all
Defined in:
lib/physics_plus/quantums.rb

Overview

This class quantums formulas

Class Method Summary collapse

Class Method Details

.de_Broglie_wavelength(massa, speed) ⇒ Object



26
27
28
# File 'lib/physics_plus/quantums.rb', line 26

def self.de_Broglie_wavelength(massa, speed)
  Constants::Planck_constant/(massa.abs * speed.abs)
end

.einstein_equation_photoelectric_effect(work_function, speed) ⇒ Object



16
17
18
19
20
# File 'lib/physics_plus/quantums.rb', line 16

def self.einstein_equation_photoelectric_effect(work_function, speed)
  raise 'work function must be greater than zero' if work_function <= 0
  
  work_function + (Constants::Electron_mass * speed ** 2)/2.to_f
end

.equivalence_of_mass_and_energy(massa) ⇒ Object



34
35
36
# File 'lib/physics_plus/quantums.rb', line 34

def self.equivalence_of_mass_and_energy(massa)
  massa * (Constants::C ** 2)
end

.law_of_radioactive_decay(n0, t, half_life) ⇒ Object



30
31
32
# File 'lib/physics_plus/quantums.rb', line 30

def self.law_of_radioactive_decay(n0, t, half_life)
  n0.to_f * 2 ** (-1 * ( t / half_life.to_f) )
end

.photon_energy(frequency) ⇒ Object



4
5
6
7
8
# File 'lib/physics_plus/quantums.rb', line 4

def self.photon_energy(frequency)
  raise 'frequency must be greater than zero' if frequency <= 0

  Constants::Planck_constant * frequency.to_f
end

.photon_momentum(frequency) ⇒ Object



10
11
12
13
14
# File 'lib/physics_plus/quantums.rb', line 10

def self.photon_momentum(frequency)
  raise 'frequency must be greater than zero' if frequency <= 0

  Constants::Planck_constant * frequency.to_f / Constants::C
end

.work_function(frequency_min) ⇒ Object



22
23
24
# File 'lib/physics_plus/quantums.rb', line 22

def self.work_function(frequency_min)
  Constants::Planck_constant * frequency_min.abs
end