#importing modules
import math
from __future__ import division
#Variable declaration
rho_s = 10.5*10**3 #density of silver(kg/m^3)
NA = 6.02*10**26 #avagadro number(per k-mol)
MA = 107.9 #atomic weight of silver
sigma = 6.8*10**7; #conductivity of silver(ohm-1 m-1)
e = 1.6*10**-19
#Calculation
n = rho_s*NA/MA #molar volume of silver
mew = sigma/(n*e) #mobility of electrons(m^2/Vs)
mew = mew*10**2
mew = math.ceil(mew*10**4)/10**4; #rounding off to 4 decimals
#Result
print "density of electrons in silver is",round(n/1e28,2),"*10^28"
print "mobility of electrons is",mew,"*10**-2 m**2/Vs"
#importing modules
import math
from __future__ import division
#Variable declaration
d = 8.92*10**3 #density(kg/m^3)
e = 1.6*10**-19
m = 9.1*10**-31 #mass of electron(kg)
N = 6.02*10**26 #avagadro's number(per k-mol)
AW = 63.5 #atomic weight
rho = 1.73*10**-8 #resistivity of copper, ohm-m
#Calculation
n = d*N/AW #number of cu atoms(per m^3)
mew = 1/(rho*n*e) #mobility of electrons(m/Vs)
mew = mew*10**2
mew = math.ceil(mew*10**4)/10**4; #rounding off to 4 decimals
tow = m/(n*e**2*rho) #relaxation time(s)
#Result
print "mobility of electrons is",round(mew,3),"*10**-2 m/Vs"
print "relaxation time is",round(tow/1e-14,3),"*10^-14 sec"
#importing modules
import math
from __future__ import division
#Variable declaration
rho = 1.54*10**-8 #resistivity(ohm-m)
n = 5.8*10**28 #conduction electrons(per m^3)
m = 9.108*10**-31 #mass of electron(kg)
e = 1.602*10**-19
#Calculation
tow = m/(n*(e**2)*rho) #relaxation time(sec)
#Result
print "relaxation time of conduction electrons is",round(tow/1e-14,2),"*10^-14 sec"
#importing modules
import math
from __future__ import division
#Variable declaration
R = 0.06 #resistance(ohm)
D = 5 #length of Al wire(m)
e = 1.602*10**-19
rho = 2.7*10**-8 #resistivity of Al(ohm-m)
MA = 26.98 #atomic weight
NA = 6.025*10**26 #avagadro number(k/mol)
rho_s = 2.7*10**3 #density(kg/m^3)
I = 15 #current(A)
#Calculation
n = 3*rho_s*NA/MA #free electron concentration(electrons/m^3)
mew = 1/(n*e*rho) #mobility(m/Vs)
E = I*R/D #electric field(V/m)
vd = mew*E #drift velocity(m/s)
vd = vd*10**3
mew = mew*10**3
mew = math.ceil(mew*10**4)/10**4; #rounding off to 4 decimals
vd = math.ceil(vd*10**4)/10**4; #rounding off to 4 decimals
#Result
print "free electron concentration is",round(n/1e29,4),"*10^29 electrons/m^2"
print "mobility is",round(mew,3),"*10^-3 m/Vs"
print "drift velocity is",round(vd,2),"*10^-3 m/s"
#importing modules
import math
from __future__ import division
#Variable declaration
n1 = 1
n2 = 1
n3 = 1 #for lowest energy
h = 6.62*10**-34 #planck's constant(Js)
e = 1.6*10**-19
m = 9.1*10**-31 #mass of electron(kg)
L = 0.1 #side of box(nm)
#Calculation
L = L*10**-9 #side of box(m)
E1 = (h**2)*(n1**2+n2**2+n3**2)/(8*m*L**2) #lowest energy(J)
E1 = E1/e #lowest energy(eV)
E1 = math.ceil(E1*10)/10 #rounding off to 1 decimal
#Result
print "lowest energy of electron is",E1,"eV"
#importing modules
import math
#Calculation
#Fermi function F(E) = 1/(1+exp((E-Ef)/(kT)))
#given E-Ef = kT. therefore F(E) = 1/(1+exp(1))
F_E = 1/(1+math.exp(1))
F_E = math.ceil(F_E*10**3)/10**3; #rounding off to 3 decimals
#Result
print "fermi function is",F_E
#importing modules
import math
from __future__ import division
#Variable declaration
F_E = 10 #probability in percent
k = 1.38*10**-23
EF = 5.5 #fermi energy(eV)
#Calculation
E = EF+(EF/100) #energy(eV)
X = E-EF #E-EF(eV)
X = X*e #E-EF(J)
T = X/(k*math.log(F_E-1)) #temperature(K)
T = math.ceil(T*10**2)/10**2 #rounding off to 2 decimals
#Result
print "temperature is",round(T,1),"K"
#importing modules
import math
from __future__ import division
#Variable declaration
F_E = 0.01 #probability in percent
k = 1.38*10**-23
e = 1.6*10**-19
#let E-EF be X
X = 0.5 #E-EF(eV)
#Calculation
kT = X/(2.303*math.log10((1-F_E)*100)) #value of kT(eV)
T = kT*e/k #temperature(K)
T = math.ceil(T*10)/10 #rounding off to 1 decimal
#Result
print "temperature is",T,"K"
print "answer given in the book is wrong by a decimal point"