# 2: Crystal Structures¶

## Example number 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);    #unit cell edge length(nm)
V=a**3;                #volume of unit cell(nm**3)
v=4*n*math.pi*r**3/3;  #volume of atoms in unit cell(nm**3)
fv=V-v;                #free volume per unit cell(nm**3)

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

free volume per unit cell is 0.007675 nm**3


## Example number 2, Page number 2-16¶

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

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

#Calculation
a=(n*M/(rho*N))**(1/3)*10**10;    #lattice constant(angstrom)

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

lattice constant is 3.517 angstrom


## Example number 3, Page number 2-17¶

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

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

#Calculation
a=(n*M/(rho*N))**(1/3)*10**9;    #lattice constant(angstrom)

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

lattice constant is 2.87 angstrom


## Example number 4, Page number 2-17¶

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

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

#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 atoms/m**3"

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


## Example number 5, Page number 2-17¶

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

#Variable declaration
a=3.5;        #lattice constant(angstrom)
n=10**7;      #1mm in angstrom

#Calculation
N=n**2/a**2;  #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 6, Page number 2-18¶

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

#Variable declaration

density is 5434.5 kg/m**3