# 1: Atomic Spectra¶

## Example number 1, Page number 42¶

In :
#importing modules
import math
from __future__ import division

#Variable declaration
e=1.6*10**-19;      #charge(coulomb)
B=1;    #flux density(Wb/m**2)
lamda=6000*10**-10;      #wavelength(m)
m0=9.1*10**-31;        #mass(kg)
c=3*10**8;      #velocity of light(m/sec)

#Calculations
d_lamda=B*e*(lamda**2)/(4*math.pi*m0*c);     #wavelength separation(m)
d_lamda=d_lamda*10**10;      #wavelength separation(angstrom)

#Result
print "wavelength separation is",round(d_lamda,3),"angstrom"
print "answer in the book is wrong"

wavelength separation is 0.168 angstrom
answer in the book is wrong


## Example number 2, Page number 42¶

In :
#importing modules
import math
from __future__ import division

#Variable declaration
h=6.6*10**-34;        #planck's constant
delta_v=8.3*10**8;     #frequency separation(Hz)
mewB=9.3*10**-24;      #magnetic moment

#Calculations
B=h*delta_v/mewB;       #magnetic field(tesla)

#Result
print "magnetic field is",round(B*10**2,2),"*10**-2 tesla"

magnetic field is 5.89 *10**-2 tesla


## Example number 3, Page number 42¶

In :
#importing modules
import math
from __future__ import division

#Variable declaration
dv=120*10**6;      #frequency(Hz)
B=8.6*10**-3;      #flux density(T)

#Calculations
r=4*math.pi*dv/B;       #ratio of charge to mass of electron(coulomb/kg)

#Result
print "ratio of charge to mass of electron is",round(r/10**11,3),"*10**11 coulomb/kg"
print "answer in the book varies due to rounding off errors"

ratio of charge to mass of electron is 1.753 *10**11 coulomb/kg
answer in the book varies due to rounding off errors


## Example number 4, Page number 42¶

In :
#importing modules
import math
from __future__ import division

#Variable declaration
e=1.6*10**-19;      #charge(coulomb)
B=4;    #flux density(Wb/m**2)
lamda=4226.73*10**-10;      #wavelength(m)
m0=9.1*10**-31;        #mass(kg)
c=3*10**8;      #velocity of light(m/sec)

#Calculations
d_lamda=B*e*(lamda**2)/(4*math.pi*m0*c);     #wavelength separation(m)
d_lamda=round(d_lamda*10**10,2);      #wavelength separation(angstrom)
l1=(lamda*10**10)-d_lamda;
l2=lamda*10**10;
l3=(lamda*10**10)+d_lamda;       #three wavelengths

#Result
print "the three wavelengths are",l1,"angstrom",l2,"angstrom",l3,"angstrom"
print "answers for wavelengths given in the book are wrong"

the three wavelengths are 4226.4 angstrom 4226.73 angstrom 4227.06 angstrom
answers for wavelengths given in the book are wrong


## Example number 5, Page number 43¶

In :
#importing modules
import math
from __future__ import division

#Variable declaration
dlamda=0.0116*10**-9;      #frequency(m)
B=1;      #flux density(T)
lamda=500*10**-9;         #wavelength(m)
c=3*10**8;         #velocity of light(m/sec)

#Calculations
r=4*math.pi*c*dlamda/(B*lamda**2);       #ratio of charge to mass of electron(coulomb/kg)

#Result
print "ratio of charge to mass of electron is",round(r/10**11,2),"*10**11 C/kg"

ratio of charge to mass of electron is 1.75 *10**11 C/kg