NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
January 29, 2020, 11:01:37 pm

"It is not the strongest of the species that survive, but the one most responsive to change." ..."Darwin(1809-1882, English naturalist Evolution)"

 Pages: [1] 2   Go Down
 Author Topic: Atomic Spectra of Hydrogen and red shift  (Read 46540 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message on: August 05, 2007, 11:07:40 am »

This applet let you play with atomic spectra of hydrogen.

The wavelengths of hydrogen spectra lines can be described by the following equation:

1/λ=RH*(1/n12-1/n22)
where RH=1.0973732*107 m-1

You can change n1 with the slider bar. The program will plot a series of spectrum lines.
You might want to change the xmax(at the right) to see the full range of the spectra.
One of the line is thicker and with an arrow is the one with n2 equal to slider bar value.

Click within simulation region will toggle "visible spectra range".

You can also find out how the red shift of the spectra calculated from Hubble's law.
v=H0 D where the recessional velocity is proportional to the distance of the star to the earth (D). You can adjust the distance of the star.
And see the red shift of the hydrogen spectra from that star due to the expansion of the universe.
-*-
n1=1 : Lyman series (Ultraviolet)
n1=2 : Balmer series (Near Ultraviolet and Visible)
n1=3 : Paschen series (Infrared)
n1=4 : Brackett series (Infrared)
n1=5 : Pund series (Infrared)

Embed a running copy of this simulation

Embed a running copy link(show simulation in a popuped window)
Full screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
• Please feel free to post your ideas about how to use the simulation for better teaching and learning.
• Post questions to be asked to help students to think, to explore.
• Upload worksheets as attached files to share with more users.
Let's work together. We can help more users understand physics conceptually and enjoy the fun of learning physics!
 Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #1 on: August 26, 2009, 02:32:04 pm » posted from:Budapest,Budapest,Hungary

Dear Prof. Hwang,
The redshift applet is a very good idea, because it shows that the individual spectrum lines are not equally shifted, but the shift depends on the wavelength (or the frequency).
I have a comment though:
If c is the speed of light, then the distance unit should be millions of light years. Then the numerical value 3.3 indicated for the distance on the starting screen (which probably comes from 1 Mpc = 3.26 million light years) gives then approximately the correct value for the Hubble speed in units of c. (If calculated with H0 = 74 (km/s)/Mpc.)
Is it possible to translate the applet to Hungarian?
Best regards,
Sandor Nagy
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #2 on: August 26, 2009, 04:46:49 pm » posted from:Taipei,T\'ai-pei,Taiwan

It is easy to translate string in EJS into different language format:
3. RIght Click in the simulation window: select translation from GUI options
A window will popup with all the strings. Type in your translation into second column (modify original values) and save it when you are done.
4. It should be loaded automatically when you run it next time.
 Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #3 on: August 26, 2009, 07:37:40 pm » posted from:Budapest,Budapest,Hungary

Thank you Prof. Hwang,
The translation worked fine, except that the information window that pops up with the simulation is empty, although I translated that too before I loaded down the program. Is there a way to block the empty window?
I will write the help in html.
Best,
Sandor
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #4 on: August 27, 2009, 12:14:13 am » posted from:Taipei,T\'ai-pei,Taiwan

If you have installed EJS in your computer:
You can Right click open EJS model , and the source code will be open in EJS environment.
You can change those label in EJS and recompile it again (Click green trigangle button).
 Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #5 on: August 28, 2009, 11:36:19 pm » posted from:Budapest,Budapest,Hungary

I will do that. However I have another problem. I have just uploaded the Hungarian version on the server for the students, but if you open the page
http://www.chem.elte.hu/Sandor.Nagy/NewClearGlossy/Java/Hubble_Hwang/index.html
the applet will probably not run. The same package runs nice on my computer both at home and at my office at university. I don't know what the problem can be.
I also show you the screen as it is supposed to look like. (See the attachment.) The reason I am showing is that it contains a formula in English which is a picture not a string. I think, it would be better if instead of the word "Wavelength" there would be a Greek letter "lambda".
What do you think?
Best,
Sandor
 redshitscreen.gif (10.12 KB, 748x380 - viewed 511 times.) Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #6 on: August 29, 2009, 08:50:54 am » posted from:Taipei,T\'ai-pei,Taiwan

If you open the source in EJS, you will find there is a veriable named:eqn withvalue "wavelength \\lambda=R_H(\\frac{1}{n_1^2}-\\frac{1}{n_2^2})";

You can add TeX mathematics formula syntax and it will display it. However \ has to be written as \\
in order for java to process it as \.

The problem seems due to incompatiable type of java. I just re-compiled it again, please try to download it again.
 Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #7 on: August 29, 2009, 08:04:35 pm » posted from:Budapest,Budapest,Hungary

Please check the applet on your page. It shows error on my computer after a long time of waiting. The rest of the applets are OK.
Sandor
 Logged
lookang
Hero Member

Offline

Posts: 1793

http://weelookang.blogspot.com

 « Embed this message Reply #8 on: August 29, 2009, 10:53:59 pm » posted from:Singapore,,Singapore

the error message is

Reading certificates from 11 http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/2/ejs_hydrogen.jar | C:\Users\XXXXXX\Application Data\Sun\Java\Deployment\cache\6.0\11\79faa90b-7ed45fc6.idx
cHotEqn V 4.02 cHotEqn
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
at sun.awt.SunToolkit.getImage(Unknown Source)
at atp.d.a(Unknown Source)
at atp.d.a(Unknown Source)
at atp.cHotEqn.if(Unknown Source)
at atp.cHotEqn.if(Unknown Source)
at atp.cHotEqn.try(Unknown Source)
at atp.cHotEqn.new(Unknown Source)
at atp.cHotEqn.getPreferredSize(Unknown Source)
at java.awt.GridLayout.preferredLayoutSize(Unknown Source)
at java.awt.Container.preferredSize(Unknown Source)
at java.awt.Container.getPreferredSize(Unknown Source)
at javax.swing.JComponent.getPreferredSize(Unknown Source)
at java.awt.BorderLayout.layoutContainer(Unknown Source)
at java.awt.Container.layout(Unknown Source)
at java.awt.Container.doLayout(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validate(Unknown Source)
at sun.plugin.util.GrayBoxPainter2.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
at sun.awt.SunToolkit.getImage(Unknown Source)
at atp.d.a(Unknown Source)
at atp.d.a(Unknown Source)
at atp.cHotEqn.if(Unknown Source)
at atp.cHotEqn.if(Unknown Source)
at atp.cHotEqn.try(Unknown Source)
at atp.cHotEqn.new(Unknown Source)
at atp.cHotEqn.getPreferredSize(Unknown Source)
at java.awt.GridLayout.preferredLayoutSize(Unknown Source)
at java.awt.Container.preferredSize(Unknown Source)
at java.awt.Container.getPreferredSize(Unknown Source)
at javax.swing.JComponent.getPreferredSize(Unknown Source)
at java.awt.BorderLayout.layoutContainer(Unknown Source)
at java.awt.Container.layout(Unknown Source)
at java.awt.Container.doLayout(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validate(Unknown Source)
at org.colos.ejs.library.LauncherApplet.captureWindow(Unknown Source)
at users.ntnu.fkh.hydrogen_pkg.hydrogenSimulation.(hydrogenSimulation.java:21)
at users.ntnu.fkh.hydrogen_pkg.hydrogen.(hydrogen.java:77)
at users.ntnu.fkh.hydrogen_pkg.hydrogenApplet.init(hydrogenApplet.java:22)
at sun.plugin2.applet.Plugin2ManagerAppletExecutionRunnable.run(Unknown Source)
 Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #9 on: August 30, 2009, 12:03:55 am » posted from:Budapest,Budapest,Hungary

Yes, something like that,
Sandor
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #10 on: August 30, 2009, 05:13:07 pm » posted from:Taipei,T\'ai-pei,Taiwan

I remove \\lambda command inside TeX string and it is working fine now.

However, it was not able to read some font due to security reason when running as applet.
 Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #11 on: August 31, 2009, 11:38:54 pm » posted from:Budapest,Budapest,Hungary

Thanks, I have uploaded the new version and it works fine.
You can check it on my page at
http://www.chem.elte.hu/Sandor.Nagy/NewClearGlossy/Java/Hubble_Hwang/index.html
However, I have a suggestion (maybe two):
I think, the "wavelength" formula (and Rydberg's constant) should be removed from the applet area. One reason is the problem with translation. The second is: it should be the reciprocal of the wavelength. The third is: you explain it correctly anyway. The fourth is: the applet would look better.
Best,
Sandor
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #12 on: September 01, 2009, 11:12:56 am » posted from:Taipei,T\'ai-pei,Taiwan

Yes, there is a mistake for the forum in the applet. It has been modified according to your suggestion.
 Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #13 on: September 01, 2009, 08:04:36 pm » posted from:Budapest,Budapest,Hungary

I have uploaded the new version.
It works fine and it looks great.
Sandor
 Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #14 on: September 01, 2009, 08:20:25 pm » posted from:Budapest,Budapest,Hungary

Sorry, I have just realized that the translation only works locally but not on the uploaded files.
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #15 on: September 01, 2009, 10:46:58 pm » posted from:Taipei,T'ai-pei,Taiwan

I will try to help you solve the problem, but I need those translated jar file.
 Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #16 on: September 02, 2009, 03:11:23 am » posted from:Budapest,Budapest,Hungary

Sorry to disturb you with my ignorance.
I am sending you the zipped packake,
Sandor
 *** There are 1 more attached files. You need to login to acces it! Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #17 on: September 02, 2009, 10:29:51 am » posted from:Taipei,T\'ai-pei,Taiwan

I unpack your file and rename hydrogen_en.properties to hydrogen_hu.properties (I hope hu is the correct language code for your language)

If you download the jar again and run it. You will find magyar as one of item under GUI options->language

If the language code is correct, you should find the default in the above simulation.
For example: I also add hydrogen_zh.properties for chinese language. And the applet will load it automatically when I view it.

 Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #18 on: September 02, 2009, 12:43:00 pm » posted from:Budapest,Budapest,Hungary

I am sorry, but I am just not able to set "magyar" as the default language. If I open the jar directly or by the index.html or by the hydrogen.html, it is always the English version that comes out. If opened with the html files I cannot even change the language manually.
Can you please help me. The best would be if you changed the zipped package and sent it back to me because I am just not able to handle this.

Also when I did the translation from GUI, I opened the Help in the left lower corner. It explains the translation with nice pictures which I cannot see when I am doing the translation. I have no idea what I am doing wrong.
Sandor
 *** There are 1 more attached files. You need to login to acces it! Logged
lookang
Hero Member

Offline

Posts: 1793

http://weelookang.blogspot.com

 « Embed this message Reply #19 on: September 02, 2009, 01:37:23 pm » posted from:Singapore,,Singapore

is your computer OS language in Hungarian?

http://www.um.es/fem/EjsWiki/Main/DeploymentLocalization
its user interface will appear in the default language of your operating system. You can switch to a different language by using the drawing panel’s popup menu GUI options → Language option.

According to the http://www.um.es/fem/EjsWiki/Main/DeploymentLocalization the Ejs applet detects the language of the computer default language and display it as default.

Maybe you need to check your computer OS language.

For me, i can see only default english cos my computer is English OS, the other 2 language chinese (由於相對速度=0.00000 c 產生的紅位移) and (hungary) Távolodási sebesség: 0.00000 c available as options to be chosen.

Hope this info helps
 « Last Edit: September 02, 2009, 01:40:39 pm by lookang » Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #20 on: September 02, 2009, 03:16:15 pm » posted from:Budapest,Budapest,Hungary

Hi "lookang",
Thanks for trying to help me.
At home I have English operation system. At the university I have Hungarian. Some of my students may have German. In Hungary people use all kinds of operation systems (except, maybe, Chinese, but I am not sure :-). It does not mean that they command the language of the computer, but they all speak Hungarian. So I needed a solution, which is independent of the language of the OS, and makes sure that the language of the applet is Hungarian no matter what computer is used. Otherwise I have no idea how I am supposed to explain to the reader what they see on the applet surface because I don't know it either.
Sandor
PS: Going global is a hard thing.
 Logged
lookang
Hero Member

Offline

Posts: 1793

http://weelookang.blogspot.com

 « Embed this message Reply #21 on: September 02, 2009, 06:15:33 pm »

Maybe you need to contact ejs creator prof paco to enable setting of any language as default. Currently I only can see English as default.

I am glad more people are tapping on educator community to advance the teaching profession. Going global is the future in my view.
Keep it up man! You are on the right track.

 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #22 on: September 02, 2009, 10:34:59 pm » posted from:Taipei,T\'ai-pei,Taiwan

The translation of string in applet is a feature of java itself.
As far as I understand: The language default is chosen when you install java in your O.S.
Because I have chinese OS so the default language is Chinese. And the language code for us is tw.
If xxxx_tw.properties is found, it will be used to translate all the string. Otherwise, no translation will be done.

The best way to do is you make the translation in the EJS and remove those properties files, since your students might use different OS and different language setting.

Because I was not able to recognize those character in your translated file, you need to do the translation by your self with your computer.
1. You need to install EJS. (download either EJS4.1 or EJS4.2 )
2. Unzip it to your computer. For example: C:\ or D:\
3. Click the EjsConsole.jar in the EJS installed directory for example: c:\ejs_4.1\EjsConsole.jar to setup initial file (This only need to be done once)
4. Double click the jar file to run it. Right Click in the simulation region and select "Open EJS Model".
then The file will be opened in EJS (The tool I used to create the simulation).
5.  Click the View at the top to show the GUI elements as a tree.
6. Find all the slider elements, right click the slider element to show menu and select "properties" (the first one), a popup window will open and you will find string you need to translate (as "format" property)
7. Do all the translation and click green right triangle to compile the program. You will find new generated simulation. Check out if ererything is fine.
8. Right Click the button below previous green button, select package current simulation only.
And new jar file will be generate under export directory.  Double the file to run it.
Upload it to your server and change the name hydrogen to hydrogen2 in the html file.
(If you do not want to change the name in html file, you need to save the ejs source as hydrogen.xml before you recompile it).

If you can not do it. It seems that lookang can view the language code in your file.
May be he can help to do it for you.
 *** There are 1 more attached files. You need to login to acces it! Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #23 on: September 03, 2009, 02:36:17 am » posted from:Budapest,Budapest,Hungary

Thank you,
I will try it tomorrow, upload it on Friday and let you know whether I succeeded.
Best,
Sandor
 Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #24 on: September 03, 2009, 03:37:58 pm » posted from:Budapest,Budapest,Hungary

Sandor
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #25 on: September 03, 2009, 09:52:34 pm » posted from:Taipei,T\'ai-pei,Taiwan

 Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #26 on: September 04, 2009, 03:33:40 am » posted from:Budapest,Budapest,Hungary

Thanks, I have just downloaded it. I will try it out tomorrow.
Sandor
 Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #27 on: September 05, 2009, 01:23:55 am » posted from:Budapest,Budapest,Hungary

Thanks for the detailed instructions. It works locally now the way I wanted. I can only upload it on Monday because our system only allows that from IP addresses belonging to the university. I hope it would work from the server too.
Best,
Sandor
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3085

 « Embed this message Reply #28 on: September 05, 2009, 10:46:16 am » posted from:Taipei,T\'ai-pei,Taiwan

Let me know if you have any problem with the uploaded EJS file on your server.

-*-
 Logged
NagySandorIstvan
Newbie

Offline

Posts: 19

 « Embed this message Reply #29 on: September 09, 2009, 11:47:21 pm » posted from:Budapest,Budapest,Hungary

Dear Prof. Hwang,
I have uploaded the file today. I have checked it both from the university and from home and it works perfectly. You can judge it for yourself:
http://www.chem.elte.hu/Sandor.Nagy/NewClearGlossy/Java/Hubble_Hwang/index.html
Last time I forgot to tell you something that I mentioned you in an earlier message.
I think that the distance values in the English version are to be understood not in "light years" but in "millions of light years" for the given redshift values. Please check it.
Thank you again for the  tremendous energy that you spent on helping me.
Very best regards,
Sandor
 Logged
 Pages: [1] 2   Go Up
"It is not the strongest of the species that survive, but the one most responsive to change." ..."Darwin(1809-1882, English naturalist Evolution)"