#initiation of variable
from math import exp
Na=6.023*10**23 #Avogadro No.
rho=8.4e6 #Density of Copper in g/m^3
A=63.5 #Atomic weight of Copper
Qv=0.9 #Activation energy in eV
k=8.62*10**-5 #Boltzmann Constant in eV/K
T=1000.0+273#Temperature in K
#calculation
N=Na*rho/A #No. of atomic site per cubic meter
Nv=N*exp(-Qv/(k*T))
#result
print" Equilibrium number of vacancies/m^3 is %.1e for 1273K" %Nv
#initiation of variable
#proving equation to be correct for sample values
C1=5.0;
C2=3.0;
A1=9.0;
A2=15.0;
C1_dash=50.0;
#calculation
C11=C1*A1/(C1*A1+C2*A2)*100;
if C11==C1_dash :
print "The equation derived i.e C1_dash=C1*A1/(C1*A1+C2*A2)*100 is correct"
#initiation of variable
C_Al=97.0 #Aluminium wt%
C_Cu=3.0 #Copper wt%
A_Al=26.98 #Atomic wt of Aluminium
A_Cu=63.55 #Atomic wt of Copper
#calculation
CAl=C_Al*A_Cu*100/((C_Al*A_Cu)+(C_Cu*A_Al))
CCu=C_Cu*A_Al*100/((C_Cu*A_Al)+(C_Al*A_Cu))
#result
print " Atomic percent of Al is %.1f percent" %CAl
print " Atomic percent of Cu is %.1f percent" %CCu
#initiation of variable
from math import exp
Na=6.023*10**23 #Avogadro No.
rho=1.955 #Density of KCl in g/cm^3
A_k= 39.10 #Atomic weight of potassium in g/mol
A_cl= 35.45 #Atomic weight of Chlorine in g/mol
Qs=2.6 #Activation energy in eV
k=8.62*10**-5 #Boltzmann Constant in eV/K
T=500+273.0 #Temperature in K
#result
A = A_k+A_cl # Molar mass of KCl in gram
N=Na*rho*1.0e6/A #No. of atomic site per cubic meter
Ns=N*exp(-Qs/(2*k*T))
#result
print" Number of Schottky defects are %.2e defects/m^3." %Ns
#initiation of variable
print "the are two possible scenarios"
print "scenario 1, removal of Na+ ion will intoduce vacancy in the NaCl crystal"
print "scenario 2, addition of Cl- ion wil fill up any additional void left"
print "since there is no way to predict which will happen at large thus can be assumed 50% each so, there is very less chances of creating a void"
#initiation of variable
from math import log
N=45.0 #Number of grains per square inch
M=85.0 # magnification
#part A
#calculation
n=(log(N)/log(2.0))+1 #calculation for grain size no. N=2^(n-1)
#result
print" Grain size number is %.1f" %n
#part B
Nm=(100/M)**2*2**(n-1)
#result
print" At magnification of 85x"
print" Number of grains per inch square are %.2f" %Nm
print "answer in book is 62.6. It is because of rounding off at intermediate stages"