In [1]:

```
from math import log,exp
# Initialisation of Variables
Lp=0.3615#The lattice parameter of FCC copper in nm
T1=298;#Temperature of copper in K
Qv=20000;#Heat required to produce a mole of vacancies in copper in cal
R=1.987;#The gas constant in cal/mol-K
#CALCULATIONS
n=4/(Lp*10**-8)**3;#The number of copper atoms or lattice points per cm**3 in atoms/cm**3
nv1=n*exp(-Qv/(T1*R));#concentration of vacancies in copper at 25 degree celsius in vacancies /cm**3
nv2=nv1*1000;#concentration of vacancies in copper atoms at T2 temperature
T2=-Qv/(R*log(nv2/n));#temperature at which this number of vacancies forms in copper in K
print "Temperature at which this number of vacancies forms in copper in Degree celsius:",round(T2-273)
```

In [2]:

```
# Initialisation of Variables
n1=2;#No. of Atoms in BCC iron Crystal
m=55.847;#Atomic mass of BCC iron crystal
a0=2.866*10**-8;#The lattice parameter of BCC iron in cm
Na=6.02*10**23;#Avogadro's number in atoms/mol
rho1=7.87;#Required density of iron BCC in g/cm**3
#CALCULATIONS
rho2=(n1*m)/(a0**3*Na);#The expected theoretical density of iron BCC
X=(rho1*a0**3*Na)/m;#Number of iron atoms and vacancies that would be present in each unit cell for the required density
n2=n1-X;# no. of vacacies per unit cell
V=0.00122/a0**3;#The number of vacancies per cm**3
print "The expected theoretical density of iron BCC ",rho2
print "Number of iron atoms that would be present in each unit cell for the required density:",X
print "The number of vacancies per cm**3 :",V
```

In [3]:

```
from math import sqrt
# Initialisation of Variables
a01=0.2866;#The Lattice parameter of BCC in nm
a02=0.3571;#The Lattice parameter of FCC in nm
r=0.071;#Radius of carbon atom in nm
ni1=12.;#No. of interstitial sites per unit cell for BCC
ni2=4.;#No. of interstitial sites per unit cell for FCC
#CALCULATIONS
Rb=(sqrt(3)*a01)/4.;#Radius of iron atom in nm
Ri1=sqrt(0.3125*a01**2)-Rb;# Interstitial Radius of iron atom in nm
Rf=(sqrt(2)*a02)/4.;#the radius of the iron atom in nm
Ri2=(a02-(2*Rf))/2.;#the radius of the interstitial site in nm
C1=(ni1/(ni1+2))*100;#The atomic percentage of carbon contained in the BCC iron in percent
C2=(ni2/(ni2+4))*100;#The atomic percentage of carbon contained in the FCC iron in percent
print "Radius of iron atom in nm",round(Rb,5)
print "Interstitial Radius of iron atom in nm:",round(Ri1,5)
print "the radius of the iron atom in nm:",round(Rf,5)
print "the radius of the interstitial site in nm:",round(Ri2,5)
print "The atomic percentage of carbon contained in BCC iron in percent:",round(C1)
print "The atomic percentage of carbon contained in FCC iron in percent:",C2
```

In [4]:

```
from math import sqrt
# Initialisation of Variable
a0=0.396;#Lattice parameter of magnesium oxide
h=1;#Because b is a [110] direction
k=1;#Because b is a [110] direction
l=0;#Because b is a [110] direction
#CALCULATIONS
b=a0/sqrt(2);#The length of Burgers vector in nm
print "The length of Burgers vector in nm:",round(b,3)
```

In [5]:

```
from math import sqrt
# Initialisation of Variables
a01=0.36151;#The lattice parameter of copper in nm
#CALCULATIONS
F=sqrt(2)*a01;#Face Diagonal of copperin nm
b=(1./2.)*(F);#The length of the Burgers vector, or the repeat distance in nm
print "Face Diagonal of copperin nm:",round(F,5)
print "The length of the Burgers vector in nm:",round(b,5)
```

In [6]:

```
from math import sqrt
# Initialisation of Variables
n=2;#No. of Atoms present per cell in BCC
a0=2.866*10**-8;#The lattice parameter of BCC iron in cm
rho1=0.994*10**15;#Planar density of (112)BCC in atoms/cm**2
#CALCULATIONS
a=sqrt(2)*a0**2;#Area of BCC iron in cm**2
rho2=n/a;#Planar density of (110)BCC in atoms/cm**2
d1=a0*10**-9/(sqrt(1**2+1**2+0));#The interplanar spacings for (110)BCC in cm
d2=a0*10**-9/(sqrt(1**2+1**2+2**2));#The interplanar spacings for (112)BCC in cm
print "Planar density of (110)BCC in atoms/cm**2:",round(rho2,2)
print "The interplanar spacings for (110)BCC in cm:",d1,3
print "The interplanar spacings for (112)BCC in cm:",d2,2
```

In [7]:

```
from math import log10
# Initialisation of Variables
g=16# No. of grains per square inch in a photomicrograph
M=250;#Magnification in a photomicrograph
N=(M/g)*100;#The number of grains per square inch
n=(log10(100)/log10(2))+1;#the ASTM grain size number
print "the ASTM grain size number:",round(n,2)
```