# 2: Crystal Structures¶

## Example number 2.1, Page number 2.16¶

In [2]:
#importing modules
import math
from __future__ import division

#Variable declaration
n=2;     #number of atoms

#Calculation
a=4*r/math.sqrt(3);     #edge length(m)
V=a**3;              #volume(nm**3)
v=4*math.pi*r**3*n/3;    #volume of atoms(nm**3)
Fv=V-v;     #free volume/unit cell(nm**3)

#Result
print "free volume/unit cell is",round(Fv,6),"nm**3"

free volume/unit cell is 0.007675 nm**3


## Example number 2.2, Page number 2.16¶

In [7]:
#importing modules
import math
from __future__ import division

#Variable declaration
n=2;     #number of atoms
M=6.94;   #atomic weight(kg)
rho=530;   #density(kg/m**3)

#Calculation
a3=n*M/(rho*Na);
a=a3**(1/3);     #lattice constant(m)

#Result
print "lattice constant is",round(a*10**10,3),"angstrom"

lattice constant is 3.517 angstrom


## Example number 2.3, Page number 2.17¶

In [12]:
#importing modules
import math
from __future__ import division

#Variable declaration
n=2;     #number of atoms
M=55.85;   #atomic weight(kg)
rho=7860;   #density(kg/m**3)

#Calculation
a3=n*M/(rho*Na);
a=a3**(1/3);     #lattice constant(m)

#Result
print "lattice constant is",round(a*10**10,2),"angstrom"

lattice constant is 2.87 angstrom


## Example number 2.4, Page number 2.17¶

In [16]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=0.356*10**-9;     #lattice constant(m)
n=8;     #number of atoms

#Calculation
N=n/a**3;     #number of atoms per m**3

#Result
print "#number of atoms per m**3 is",round(N/10**27,1),"*10**27"

#number of atoms per m**3 is 177.3 *10**27


## Example number 2.5, Page number 2.17¶

In [18]:
#importing modules
import math
from __future__ import division

#Variable declaration
a=3.5;     #lattice constant(angstrom)

#Calculation
A=a**2;
N=10**7*10**7/A;    #number of atoms per sq. mm

#Result
print "number of atoms per sq. mm is",round(N/10**12,2),"*10**12"

number of atoms per sq. mm is 8.16 *10**12


## Example number 2.6, Page number 2.18¶

In [21]:
#importing modules
import math
from __future__ import division

#Variable declaration
n=8;     #number of atoms
a=5.62*10**-10;     #lattice constant(m)
M=72.59;   #atomic weight(kg)

density is 5434.5 kg/m**3