from math import pi
#Variable declartion
E_a = 502 #first ionization energy of A(kJ/mol)
E_b = -335 #electron affinity for B atom(kJ/mol)
d = 3*10**-10 #inter-ionic seperation(m)
E = 8.85*10**-12 #permittivity of free space(C/N -m)
e = 1.602*10**-19#charge of an electron(C)
#Calculations
C_e = (-e**2)/(4*pi*E*d) #Coulumbic attraction energy(J/ion pair)
C_e_kj = C_e *6.022*10**23*10**-3 #Converting C_e to KJ/mol
n_e = E_a + E_b + C_e_kj #Net change in energy per mole
#Results
print "Net change in energy is =",round(n_e,3),"kJ/mol"
print "As the net change in energy is negative, the molecule will be stable"
print "\nThe solution differs because of rounding-off of the digits in the textbook"
from math import pi
#Variable declaration
IP_K = 4.1 #ionization energy of K(eV)
EA_Cl = 3.6 #electron affinity of Cl(eV)
e = 1.602*10**-19 #charge of an electron(C)
Eo = 8.85*10**-12 #permittivity of free space(C/N -m)
#Calcuations
del_E = IP_K - EA_Cl
#Ec = 0.5 = -e/4*pi*Eo*R
R = e/(4*pi*Eo*del_E)
#Results
print "(a) If their total energy is to be zero, then del_E = Ec"
print "(b) The seperation between the ion pair is", round((R/1E-9),2), "nm"
from math import pi
#Variable declaration
ro = 2.36*10**-10 #inter ionic equilibrium distance(m)
IP = 5.14 #ionization energy of Na(eV)
EA = 3.65 #electron affinity of Cl(eV)
e = 1.602*10**-19 #charge of an electron(C)
Eo = 8.85*10**-12 #permittivity of free space(C/N -m)
#Calculations
Ue = (-e**2)/(4*pi*Eo*ro*e) #Potential energy in eV
Be = -Ue - IP + EA
#Result
print "Bond energy for NaCl molecule is",round(Be,2),"eV"
from math import pi
#Variable declaration
ro = 0.281*10**-9 #equilibrium seperation between the ion pair(m)
IP = 5.14 #ionization energy of Na(eV)
EA = 3.61 #electron affinity of Cl(eV)
A = 1.748 #Madelung constant
n = 9. #born replusive exponent
e = 1.602*10**-19 #charge of an electron(C)
Eo = 8.85*10**-12 #permittivity of free space(C/N -m)
#Calculations
Ce = (A*(e**2)*(1-(1/n)))/(4*pi*Eo*ro) #joules
Ce_ev = Ce/e #Converting joules to eV
#Result
print "The cohesive energy of NaCl molecule is",round(Ce_ev,2),"eV"