Planck's Equation Solver
Background
This tool, in the modality of an equation solver, is a proof of concept for the notion of recursive forms (RFs). Planck's Equation is solved for a missing term (Brune, 2021; Cramer, 2021; Fernflores, 2019; Odenwald, 2021).
RFs automatically submit themselves when a user completes the following steps (see Theory section).
- Select an initial option or accept the default one.
- Input a value compatible with said option.
- Select a new option.
Examples
The following examples illustrate how this RF works. Data in scientific notation must be entered in "e" notation, with the + sign being optional, but not the − one.
A user selects the "wavelength (nm)" option, enters "400", and switches to the "wavenumber (cm-1)" option. RF returns "25000".
Now switching to the "Energy (Joule)" option, said output becomes the new input and the RF returns "4.96606206677E-19".
Again, switching to the "frequency (s-1)" option, the previous output becomes the new input and the RF returns "7.49481145E+14".
Therefore,
400 nm = 25000 cm-1
25000 cm-1 = 4.96606206677E-19 J
4.96606206677E-19 J = 7.49481145E+14 s-1
7.49481145E+14 s-1 = 400 nm
Discussion
We define a recursive form (RF) as an HTML form where the name/value pairs of successful controls are recursively generated through the decision-making process of users.
Algorithm
The algorithm implemented by this RF represents all possible missing terms of Planck's Equation as a two-dimensional associative array of the form
$index = [ [ "missing_term_1" =>"new_option_1", "solution_1_1" => "value_1_1", "solution_1_2" => "value_1_2", ⋮ ], [ "missing_term_2" =>"new_option_2", "solution_2_1" => "value_2_1", "solution_2_2" => "value_2_2", ⋮ ], ⋮ [ ⋮ ... ] ];
This is faster than using nested switch statements, particularly as the size or dimensionality of the array increases.
The index is searched in two steps. First, the subarray that matches the missing term (i.e., the new option) is located. Subarray solutions are then located. If there is a match (i.e., in function of the initial option and input value), the solution is retrieved and displayed in the input field as the new value.
Users can repeat this process as many times as they wish to by simply switching to a new option.
Planck's Equation
Planck's Equation relates the energy of a single photon to its wavelength
(1)\[E = h\nu\]
(2)\[E = h{c\over \lambda}\]
(3)\[E = hc\tilde\nu\]
where E is the energy of a photon, and
Planck's constant, h = 6.62607004e-34 J∙s
speed of light in vacuum, c = 2.99792458e-8 m/s
frequency, ν s-1
wavelength, λ nm
wavenumber, ν̃ = 1/λ cm-1
Multiplying E by Avogadro's Number gives the energy of a mole of photons.
Exercises
- Build an equation solver for Van der Waals Equation.
- Build an equation solver for Debye-Hückel Extended Limiting Law.
- Build an equation solver for Henderson-Hasselbalch Equation.
- Consider the reaction O3 + E → O2 + O*. The bond strength between O2 and O* is 386 kJ mol-1. What is the shortest wavenumber and frequency that a photon can have to break the bond between O2 and O*?
References
- Brune, W. H. (2021). How is energy related to the wavelength of radiation? Retrieved on October 31, 2021.
- Cramer, C. J. (2021). Molecular Thermodynamics. Week 1 Lecture Assessments. Energy Unit Conversions. Retrieved on October 28, 2021.
- Fernflores, F. (2019). The Equivalence of Mass and Energy. The Stanford Encyclopedia of Philosophy (Fall 2019 Edition), Edward N. Zalta (ed.).
- Odenwald, S. (2021). Special & General Relativity Questions and Answers. NASA Astronomy Cafe, part of the NASA Education and Public Outreach program. Retrieved on October 29, 2021.