Last active
December 9, 2025 06:54
-
-
Save faisalnjs/1b2ecb034c7fa1f087c3ed2e8955966f to your computer and use it in GitHub Desktop.
Expected emission lines from H atom for given series.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Inputs | |
| var presets = { | |
| lyman: { | |
| initial: 2, | |
| final: 1 | |
| }, | |
| balmer: { | |
| initial: 3, | |
| final: 2 | |
| }, | |
| paschen: { | |
| initial: 4, | |
| final: 3 | |
| }, | |
| brackett: { | |
| initial: 5, | |
| final: 4 | |
| }, | |
| }; | |
| const preset = 'brackett'; | |
| var initial = presets[preset].initial; | |
| var final = presets[preset].final; | |
| // Constants | |
| const h = 6.6256e-34; | |
| const c = 3e8; | |
| const R = 1.097e7; | |
| // Formulas | |
| var lambda = 1 / (R * ((1 / (final ** 2)) - (1 / (initial ** 2)))); | |
| var E = (h * c) / lambda; | |
| // Outputs | |
| var output = { | |
| series: preset, | |
| initial, | |
| final, | |
| wavelength: { | |
| 'm': (lambda * 1e7).toPrecision(4) + '*10^-7m', | |
| 'nm': (lambda * 1e7 * 1e2).toPrecision(4) + 'nm', | |
| }, | |
| energy: { | |
| 'J': (E * 1e18).toPrecision(4) + '*10^-18J', | |
| }, | |
| }; | |
| console.log(output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment