# Crystal Imperfections¶

## Example number 7.1, Page number 207¶

In :
#importing modules
import math

#Variable declaration
k=1.38*10**-23;
Ev=0.98;    #energy in eV/atom
T1=900;      #temperature in C
T2=1000;
w=196.9;       #atomic weight in g/mol
d=18.63;         #density in g/cm^3

#Calculation
Ev=Ev*1.6*10**-19;     #converting eV to J
d=d*10**3;    #converting g/cm^3 into kg/m^3
N=(A*d)/w;
n=N*math.exp(-Ev/(k*T1));
#let valency fraction n/N be V
V=math.exp(-Ev/(k*T2));

#Result
print("concentration of atoms per m^3 is",N);
print("number of vacancies per m^3 is",n);
print("valency fraction is",V);

('concentration of atoms per m^3 is', 5.69780904012189e+28)
('number of vacancies per m^3 is', 1.8742498047705634e+23)
('valency fraction is', 1.1625392535344139e-05)


## Example number 7.2, Page number 208¶

In :
#importing modules
import math

#Variable declaration
k=1.38*10**-23;
T=1073;     #temperature in K
n=3.6*10**23;     #number of vacancies
d=9.5;        #density in g/cm^3
w=107.9;       #atomic weight in g/mol

#Calculation
d=d*10**3;     #converting g/cm^3 into kg/m^3
N=(A*d)/w;    #concentration of atoms
E=k*T*math.log((N/n), );     #energy in J
EeV=E/(1.602176565*10**-19);    #energy in eV
EeV=math.ceil(EeV*10**2)/10**2;   #rounding off to 2 decimals

#Result
print("concentration of atoms per m^3 is",N);
print("energy for vacancy formation in J",E);
print("energy for vacancy formation in eV",EeV);

('concentration of atoms per m^3 is', 5.3020389249304915e+28)
('energy for vacancy formation in J', 1.762092900344914e-19)
('energy for vacancy formation in eV', 1.1)


## Example number 7.3, Page number 209¶

In :
#importing modules
import math

#Variable declaration
k=1.38*10**-23;
w1=39.1;       #atomic weight of K
w2=35.45;       #atomic weight of Cl
Es=2.6;       #energy formation in eV
T=500;      #temperature in C
d=1.955;        #density in g/cm^3

#Calculation
Es=Es*1.6*10**-19;        #converting eV to J
T=T+273;      #temperature in K
d=d*10**3;     #converting g/cm^3 into kg/m^3
N=(A*d)/(w1+w2);
n=N*math.exp(-Es/(2*k*T));

#Result
print("number of Schotky defect per m^3 is",n);

#answer given in the book is wrong by 3rd decimal point

('number of Schotky defect per m^3 is', 5.373777171020081e+19)

In [ ]: