#calculate the lattice energy
#Initialization of variables
Hs=89 #kJ/mol
HI=418 #kJ/mol
HD=244 #kJ/mol
HE=-349 #kJ/mol
Hf=-437 #kJ/mol
#calculations
HL=Hs+HD/2. +HI+HE-Hf
#results
print '%s %d %s' %("Lattice energy =",HL,"kJ/mol")
#Calculate the separation between the molecules in both the cases
#Initialization of variables
import math
a=0.82 #nm
b=0.94 #nm
c=0.75 #nm
h=1.
k=2.
l=3.
#calculations
invd=math.sqrt(h*h/(a*a) + k*k/(b*b) + l*l/(c*c))
d=1./invd
invd2=math.sqrt(h*h*4/(a*a) + k*k*4/(b*b) + l*l*4/(c*c))
d2=1./invd2
#results
print '%s %.2f %s' %("In case 1, separation =",d," nm")
print '%s %.2f %s' %("\n In case 2, separation =",d2," nm")
#calculate the length of the side of the unit cell
#Initialization of variables
import math
l=154. #pm
theta=11.2 #degrees
#calculations
d=l/(2*math.sin(theta*math.pi/180.))
a=d*math.sqrt(3)
#results
print '%s %.1f %s' %("Length of the side of the unit cell =",a,"pm")