#importing modules
import math
from __future__ import division
#Variable declaration
IE_1 = 502 #first ionisation energy(kJ/mol)
EA_B = -335 #electron affinity for B atom(kJ/mol)
e = 1.602*10**-19
r = 0.3 #inter ionic seperation(nm)
epsilon0 = 8.85*10**-12 #permittivity of free space(C/N-m)
#Calculation
r = r*10**-9 #inter ionic seperation(m)
N = 6.022*10**23*10**-3
E = (-e**2*N)/(4*math.pi*epsilon0*r) #electrostatic attraction energy(kJ/mol)
dE = IE_1+EA_B+E; #net change in energy per mole
#Result
print "electrostatic attraction energy is",int(E),"kJ/mol"
print "net change in energy is",int(dE),"kJ/mol"
print "A+B- molecule will be stable"
print "answer for net change,dE given in the book is wrong"
#importing modules
import math
from __future__ import division
#Variable declaration
IP_K = 4.1 #IP of K(eV)
EA_Cl = 3.6 #EA of Cl(eV)
e = 1.602*10**-19
epsilon0 = 8.85*10**-12
#Calculation
delta_E = IP_K - EA_Cl #energy required(eV)
#if their total energy is 0, delta_E = Ec
Ec = delta_E
R = e/(4*math.pi*epsilon0*Ec) #seperation between ion pair(m)
R = R*10**9 #seperation between ion pair(nm)
R = math.ceil(R*10**3)/10**3; #rounding off to 3 decimals
#Result
print "energy required to form K+Cl- ion pair is",delta_E,"eV"
print "seperation between ion pair is",R,"nm"
#importing modules
import math
from __future__ import division
#Variable declaration
e = 1.602*10**-19
EA = 3.65 #electron affinity of Cl(eV)
IP = 5.14 #ionisation energy of Na(eV)
epsilon0 = 8.85*10**-12
r0 = 236 #equilibrium distance(pm)
#Calculation
r0 = r0*10**-12 #equilibrium distance(m)
V = (-e**2)/(4*math.pi*epsilon0*r0) ##potential energy(J)
V = V/e #potential energy(eV)
Ue = V
BE = -Ue - IP + EA #bond energy(eV)
BE = math.ceil(BE*10**3)/10**3; #rounding off to 3 decimals
#Result
print "bond energy for NaCl molecule is",BE,"eV"
#importing modules
import math
from __future__ import division
#Variable declaration
e = 1.602*(10**-19)
epsilon0 = 8.85*(10**-12)
r0 = 0.281 #equilibrium seperation(nm)
A = 1.748 #Madelung constant
n = 9 #born repulsive exponent
#Calculation
r0 = r0*10**-9 #equilibrium seperation(m)
CE = (A*e**2)*(1-(1/n))/(4*math.pi*epsilon0*r0) #cohesive energy(J)
CE = CE/e #cohesive energy(eV)
CE = math.ceil(CE*10**3)/10**3; #rounding off to 3 decimals
#Result
print "cohesive energy of NaCl is",CE,"eV"