Thread Subject: calculating the different Hydrogen wavelengths using the Rydberg

Subject: calculating the different Hydrogen wavelengths using the Rydberg

From: Rick T

Date: 26 Oct, 2009 21:22:52

Message: 1 of 2

Greetings All

I'm calculating the different Hydrogen wavelengths using the Rydberg
formula and matlab code below

nOuterShell=10;
wavelengthLin=[];
nLin=linspace(1,nOuterShell,nOuterShell);
R=1.097373E+7;
 for n1=1:nOuterShell, %amount of groups created

     for n2=1:nOuterShell-1,

         wavelengthLin(n1,n2)=abs(-((nLin(n1)^2*nLin(n2)^2)/(R*(-nLin
(n1)^2+nLin(n2)^2)))); % Rydberg formula
     end;
 end;

It looks like it's working but I'm getting inf errors and incorrect
values in cells. I think I've narrowed downed the error happening
when n2 is equal to or greater than n1.

It's suppose to show the different wavelengths series on each row for
10 values
Example:
Lyman series in one row (n1=1)
122nm,103nm,97nm,95nm,,....

Balmer Series on the next row (n1=2)
656nm,486nm,434nm,410nm.....



Does anyone know how I can code this so I can fix it.

tia sal22

Subject: calculating the different Hydrogen wavelengths using the Rydberg

From: Matt Fetterman

Date: 26 Oct, 2009 23:28:04

Message: 2 of 2

Rick T <ratulloch@gmail.com> wrote in message <aa420750-a1db-40e0-9770-faadd75a101f@x6g2000prc.googlegroups.com>...
> Greetings All
>
> I'm calculating the different Hydrogen wavelengths using the Rydberg
> formula and matlab code below
>
> nOuterShell=10;
> wavelengthLin=[];
> nLin=linspace(1,nOuterShell,nOuterShell);
> R=1.097373E+7;
> for n1=1:nOuterShell, %amount of groups created
>
> for n2=1:nOuterShell-1,
>
> wavelengthLin(n1,n2)=abs(-((nLin(n1)^2*nLin(n2)^2)/(R*(-nLin
> (n1)^2+nLin(n2)^2)))); % Rydberg formula
> end;
> end;
>
> It looks like it's working but I'm getting inf errors and incorrect
> values in cells. I think I've narrowed downed the error happening
> when n2 is equal to or greater than n1.
>
> It's suppose to show the different wavelengths series on each row for
> 10 values
> Example:
> Lyman series in one row (n1=1)
> 122nm,103nm,97nm,95nm,,....
>
> Balmer Series on the next row (n1=2)
> 656nm,486nm,434nm,410nm.....
>
>
>
> Does anyone know how I can code this so I can fix it.
>
> tia sal22

Hey I tried your program. I think it is basically A-OK. The Inf are on the diagonal and they represent switching from an orbital to itself, which is invalid.
But on the first line you have items starting at 2, which are the Lyman. On the second line, items start at 3, which is the Balmer...
Have to display it in floating point to see the whole numbers.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com