<![CDATA[Emission Absorption and Continuous Atomic Spectrum and Energy Levels of Hydrogen Gas simulation]]> false false true true false ]]> ./hydrogen_pkg/Screenshot 2024-01-22 at 7.58.38 AM.png ./01authorfu-kwun.hwang.png;./01authorlookang50x50.png; DESCRIPTION_EDITOR Intro Page true false _default_ Intro Page false

Designed by Fu-Kwun Hwang http://www.phy.ntnu.edu.tw/ntnujava/

]]>
20 1 false VARIABLE_EDITOR coordinate true false VARIABLE_EDITOR basic true false VARIABLE_EDITOR language true false VARIABLE_EDITOR Displays true false rearrangement needed when window size changes --> FIXED by coordinating spectrum to origin]]> rearrangement needed when window size changes --> FIXED by coordinating spectrum to origin]]> VARIABLE_EDITOR lookang true false VARIABLE_EDITOR photonsAnimation true false VARIABLE_EDITOR photonRandom true false CODE_EDITOR undefined true false CODE_EDITOR Init Page true false CODE_EDITOR lookang true false CODE_EDITOR photons true false CODE_EDITOR ph0tonRandom true false ODE_EDITOR Evol Page 2 true false EVENT_EDITOR reachGasred 2 false false CROSSING_EVENT BISECTION 100 true EVENT_EDITOR reachGasblue false false CROSSING_EVENT BISECTION 100 true EVENT_EDITOR reachGasteal false false CROSSING_EVENT BISECTION 100 true EVENT_EDITOR reachGasgreen false false CROSSING_EVENT BISECTION 100 true EVENT_EDITOR Diffractiongreen false false CROSSING_EVENT BISECTION 100 true EVENT_EDITOR greenSpectrum false false CROSSING_EVENT BISECTION 100 true EVENT_EDITOR reachGasyellow false false CROSSING_EVENT BISECTION 100 true EVENT_EDITOR yellowSlit false false CROSSING_EVENT BISECTION 100 true EVENT_EDITOR reachGasorange false false CROSSING_EVENT BISECTION 100 true EVENT_EDITOR orangeSlit false false CROSSING_EVENT BISECTION 100 true EVENT_EDITOR orangeSpectrum false false CROSSING_EVENT BISECTION 100 true EVENT_EDITOR reachGasred false false CROSSING_EVENT BISECTION 100 true t dt photonsVX[i] photonsVY[i] photonsRandomVX[i] photonsRandomVY[i] cPhotonsVX[i] cPhotonsVY[i] RungeKutta 10000 0.00001 false false false false CODE_EDITOR FixRel Page true false CODE_EDITOR gas false false CODE_EDITOR lightText true false CODE_EDITOR photonsASpectrum true false 0) { // magenta, blue, teal, green, yellow, orange, red // 0, 1, 2, 3, 4, 5, 6 if ( i == 0 ||i == 1||i == 2||i==6) { // magenta, blue, teal, red photonsVX[i] = 0 photonsVisible[i] = false // inside the gas loop var tStartAllDirection = 0.5 if (t > tStartAllDirection){ photonsVisible[i] = true photonsAngle[i] = -pi/10 photonsVX[i] = 1 photonsVY[i] = -0.9 } //hit eDiffX if ((photonsX[i] > (eDiffX+0.2)*Math.cos(eAngle))&&(photonsX[i] < (eDiffX+0.3)*Math.cos(eAngle))){ //photonsVX[i] = 1 photonsVY[0] = 1.2 photonsVY[1] = 0.9 photonsVY[2] = 0.4 photonsVY[6] = -2.0 } //inside eSpectrum if (photonsX[i] > (eDiffX+0.3)*Math.cos(eAngle)){ photonsVX[0] = 0 photonsVX[1] = 0 photonsVX[2] = 0 photonsVX[6] = 0 photonsVY[0] = 0 photonsVY[1] = 0 photonsVY[2] = 0 photonsVY[6] = 0 } }// magenta, blue, teal, red } //continue travelling straight if (photonsX[i] - (diffractionPosX+0.5) >0) { photonsVY[3] = 0 // green(3) photonsVY[4] = -0.5 // yellow(4) photonsVY[5] = -0.6 // orange(5) } //hit sprectrum wall if (photonsX[i] - (spectrumAX) >0) { //alert() photonsVX[3] = 0 photonsVX[4] = 0 photonsVX[5] = 0 photonsVY[3] = 0 photonsVY[4] = 0 photonsVY[5] = 0 } } //////////////////////////////////// // PHOTONS to CONTINUOUS SPECTRUM // (copied & modified from above) //////////////////////////////////// for (var i=0; i<8 ; i++) { // travels straight, Y changes after hitting diffraction grating: if ( (cPhotonsX[i]-(cDiffX) >0) && (cPhotonsX[i]-(cDiffX+0.07) < 0) ){ let spread = -0.8; // spread == distance btwn each photons cPhotonsVY[i] = i*spread + 2.2;} // "+2.2" to push upwards from the origin // ... till they hit spectrum wall & stop: if (cPhotonsX[i] - (cDiffX+0.07) > 0){ cPhotonsVX[i] = 0; cPhotonsVY[i] = 0;} } ]]> CODE_EDITOR photonRandomAfterGas true false tStartAllDirection){ photonsRandomVisible[i] = true photonsRandomAngle[i] = i*2*pi/nRandom photonsRandomVX[i] = 1*Math.cos(photonsRandomAngle[i]) photonsRandomVY[i] = 1*Math.sin(photonsRandomAngle[i]) } var tEndAllDirection = 1 if (t > tEndAllDirection){ photonsRandomVisible[i] = false // photonsRandomAngle[i] = i*2*pi/nRandom photonsRandomVX[i] = 0 photonsRandomVY[i] = 0 } } ]]> CODE_EDITOR pause true false =2){ _pause() for (var i=0; i<8 ; i++) { photonsVisible[i] =false; cphotonsVisible[i] =false; } } ]]> CODE_EDITOR absorptionvsEmission true false CODE_EDITOR EnergyLineArrow false false LIBRARY_EDITOR color true false x[i] l=l*100; if(l<380)return "rgba(128,128,128,1.0)"; // grey else if(l<450)return "rgba(255,0,255,1.0)"; // purple else if(l<495)return "rgba(0,0,255,1)"; // blue else if(l<570)return "rgba(0,255,0,1)"; // green else if(l<590)return "rgba(255,255,0,1)"; // yellow else if(l<620)return "rgba(255,128,0,1)"; // orange else if(l<750)return "rgba(255,0,0,1)"; // red return "rgba(32,32,32,1)"; } */ function color(wavelength) { wavelength =wavelength*100 // to sync code by *100 as fukwun used that way let gamma = 1; let intensity_max = 255; let factor = 0; let R, G, B; if ((wavelength >= 380) && (wavelength < 440)) { R = -(wavelength - 440) / (440 - 380); G = 0.0; B = 1.0; } else if ((wavelength >= 440) && (wavelength < 490)) { R = 0.0; G = (wavelength - 440) / (490 - 440); B = 1.0; } else if ((wavelength >= 490) && (wavelength < 510)) { R = 0.0; G = 1.0; B = -(wavelength - 510) / (510 - 490); } else if ((wavelength >= 510) && (wavelength < 580)) { R = (wavelength - 510) / (580 - 510); G = 1.0; B = 0.0; } else if ((wavelength >= 580) && (wavelength < 645)) { R = 1.0; G = -(wavelength - 645) / (645 - 580); B = 0.0; } else if ((wavelength >= 645) && (wavelength <= 750)) { R = 1.0; G = 0.0; B = 0.0; } else { R = 0.0; G = 0.0; B = 0.0; } // Adjust intensity if ((wavelength >= 380) && (wavelength < 420)) { factor = 0.3 + 0.7 * (wavelength - 380) / (420 - 380); } else if ((wavelength >= 645) && (wavelength <= 750)) { factor = 0.3 + 0.7 * (750 - wavelength) / (750 - 645); } else { factor = 1.0; } R = Math.round(intensity_max * Math.pow(R * factor, gamma)); G = Math.round(intensity_max * Math.pow(G * factor, gamma)); B = Math.round(intensity_max * Math.pow(B * factor, gamma)); return "rgba(" + R + "," + G + "," + B + ",1.0)"; } ]]> LIBRARY_EDITOR fullscreen true false LIBRARY_EDITOR lineSpace true false =0;i--) { ret[i] = (i*b+(n-i)*a)/n; } return ret; } ]]> org.colos.ejss.model_elements.numerics.NumericJavascriptElement numericJS HTML_VIEW_EDITOR HtmlView true false 0 0 0 800 600 true true Elements.Panel true Elements.Panel true Elements.Panel Elements.Label Elements.CheckBox Elements.CheckBox Elements.CheckBox Elements.CheckBox Elements.TwoStateButton Elements.Button Elements.Button false Elements.Panel Elements.Label Elements.RadioButton Elements.RadioButton Elements.Slider false Elements.Panel false Elements.Panel Elements.Label Elements.Slider Elements.Label Elements.Slider false Elements.Panel Elements.Label Elements.Slider false Elements.Panel Elements.TextField true Elements.Panel false Elements.PlottingPanel Elements.ShapeSet2D Elements.Arrow2D Elements.Shape2D Elements.ArrowSet2D Elements.ArrowSet2D Elements.Arrow2D false Elements.PlottingPanel Elements.ShapeSet2D Elements.ArrowSet2D Elements.Arrow2D false Elements.PlottingPanel Elements.ShapeSet2D Elements.ShapeSet2D true Elements.PlottingPanel Elements.Image2D Elements.Text2D true Elements.Group2D Elements.Shape2D Elements.Text2D Elements.Text2D Elements.Text2D Elements.Arrow2D Elements.Arrow2D Elements.Arrow2D Elements.Shape2D Elements.Shape2D false Elements.Group2D Elements.ShapeSet2D Elements.ShapeSet2D false Elements.Group2D Elements.Text2D Elements.Text2D Elements.Text2D Elements.Arrow2D Elements.Arrow2D Elements.Arrow2D Elements.Shape2D Elements.Shape2D Elements.Shape2D false Elements.Group2D Elements.ShapeSet2D Elements.ArrowSet2D Elements.SegmentSet2D Elements.Arrow2D false Elements.Group2D Elements.Text2D Elements.Text2D Elements.Text2D Elements.Arrow2D Elements.Arrow2D Elements.Arrow2D Elements.Shape2D Elements.Shape2D Elements.Shape2D false Elements.Group2D Elements.Shape2D Elements.ArrowSet2D Elements.ArrowSet2D Elements.SegmentSet2D Elements.Arrow2D Elements.ShapeSet2D Elements.Shape2D false Elements.Group2D Elements.Text2D Elements.Shape2D Elements.Segment2D false Elements.Group2D Elements.ShapeSet2D Elements.ShapeSet2D true Elements.PlottingPanel Elements.ArrowSet2D Elements.Arrow2D Elements.Arrow2D true Elements.Group2D Elements.Text2D Elements.Panel Understanding Emission and Absorption Spectra

Emission and absorption spectra, pivotal in unraveling atomic intricacies, manifest as consequences of electronic transitions within hydrogen atoms. Emission transpires when electrons cascade from higher to lower energy states, emitting photons. Conversely, absorption involves electrons ascending to higher energy levels through photon absorption.

Our simulation offers an interactive interface, affording users the capability to manipulate energy levels and observe the resultant emission and absorption spectra of hydrogen gas. This immersive experience facilitates a discerning comprehension of spectral lines and the quantum mechanical underpinnings governing energy transitions.

Continuous Spectra Photon Emission: Top Right

At the heart of this narrative is the emission of photons from a hot source. As temperatures rise, atoms within the source gain thermal energy, promoting electrons to higher energy levels. Subsequently, these excited electrons undergo spontaneous transitions to lower energy states, releasing photons in the process. The emitted photons carry information about the energy differences between these electronic states, forming the foundation for the ensuing spectral characteristics.

Photon Propagation: A Journey Through the Gas Medium

Once liberated from the hot source, photons embark on a journey through a gas medium. This medium, comprising atoms with discrete energy levels, serves as a dynamic canvas upon which the photonic dance unfolds. Photons traverse the gas, encountering atoms and influencing their energy states through interactions that culminate in two distinct phenomena: emission and absorption.

Emission Spectra: Bottom Right

As photons interact with gas atoms, certain atoms become excited and subsequently release photons during their transitions to lower energy levels. This emitted light manifests as distinct lines in the emission spectrum, each line corresponding to a specific energy transition within the gas atoms. The emitted photons collectively contribute to the spectral signature of the gas, unveiling a unique fingerprint that reveals the elemental composition and energy structure of the medium.

Absorption Spectra: Center Straight Through

Simultaneously, photons may encounter gas atoms already in excited states. In such instances, these atoms can absorb the incoming photons, elevating electrons to higher energy levels. This absorption process results in dark lines in the absorption spectrum, representing the energies absorbed by the gas medium. The absorption spectrum complements the emission spectrum, providing a comprehensive portrayal of the intricate energy landscape within the gas.

]]>