#Variable declaration
r= 0.113 #bond length, nm
Mc= 1.99*(10**(-26)) #mass of C12, kg
Mo= 2.66*(10**(-26)) #mass of O16, kg
#Calculation
#Part (a)
import math
Mco= (Mc*Mo)/(Mc+Mo) #mass of CO, kg
I= Mco*((r*(10.0**(-9.0)))**2.0) #moment of inertia, kg.m**2
J=1.0 #lowest rotational state
h= 6.63*(10**(-34)) #Planck's constant, J.s
hbar= h/(2.0*(math.pi)) #reduced Planck's constant, J.s
E1= (J*(J+1)*(hbar**2))/(2.0*I) #energy corresponding to state J=1, J
e= 1.6*(10**(-19)) #charge of an electron, C
E1= E1/e #converting to eV
#Part(b)
w= math.sqrt((2.0*7.61*10**-23)/(1.46*10**-46)) #angular velocity, rad/s
#Result
print"(a).The energy of CO molecule is:%.2e"%E1,"eV(approx)"
print"(b).The angular velocity is:%.3g"%w,"rad/sec\n"
print"NOTE:(Calculation mistake):Incorrect answer in book for (b) part"
#Variable declaration
Ji=0 #initial state
Jf=1 #final state
f= 1.15*(10**11) #frequency for the absorption, Hz
h= 6.63*(10**(-34)) #Planck's constant, J.s
#Calculation
hbar= h/(2*(math.pi)) #reduced Planck's constant, J.s
Ico= hbar*Jf/(2*(math.pi)*f) #moment of inertia, kg.m**2
Mco= 1.14*(10**(-26)) #Mass of CO, refer Exa 8.1
r= math.sqrt(Ico/Mco) #bond length, m
r= r*(10**9) #converting to nm
#Result
print"The bond length of CO molecule is: ",round(r,3),"nm"
#Variable declaration
f= 6.42*(10**13) #frequency of absorbed radiation, Hz
Mco= 1.14*(10**(-26)) #mass of CO, kg
h= 6.63*(10**(-34)) #Planck's constant, J.s
#Calculation
#Part (a)
k= 4*((math.pi)**2)*(f**2)*Mco #using Eqn 8.15, Page 287
#Part (b)
dE= h*f #separation, J
etoJ=dE*6.24*10**18
#Result
print"(a).The force constant for the bond in CO molecule is: %.3g"%k,"N/m"
print"\nNOTE:Slight error in calculation of book,'k' is written as 1.86*10**3\n\n"
print"(b).The separation in its vibrational eergy levels is:%.3g"%dE,"J=",round(etoJ,3),"eV"