from __future__ import division
from math import sqrt, pi
R=1000#
sigma=5.8*10**7#
d=0.001#
#l is length of the cu wire
l=R*sigma*pi*(d*d/4)##R=l/(sigma*pi*(d*d/4))
print "l = %0.1f km"%(l*10**-3)
E=10*10**-3#
J=sigma*E##current density
print 'J = %0.2e A/m**2'%J
from math import sqrt, pi
d=2*10**-3#
sigma=5.8*10**7#
mu=0.0032#
E=20*10**-3#
q=1.6*10**-19#
n=sigma/(q*mu)##sigma=q*n*mu
print 'n = %0.3e /m**3'%(n)
J=sigma*E##current density
print 'J = %0.2e A/m**2'%J
A=pi*d*d/4##area of cross-section of wire
print 'A = %0.2e m**2'%A
I=J*A##current flowing in the wire
print 'I = %0.2f A'%I
V=mu*E##electron drift velocity
print 'V = %0.2e m/s'%V
#answer printed in the book is wrong
p=1.54*10**-8#
n=5.8*10**28#
q=1.6*10**-19#
sigma=1/p##p=1/sigma..conductivity
print 'sigma = %0.2e S/m'%sigma
mu=sigma/(q*n*10**-2)##mobility
print 'mu = %0.3f m**2/vs'%mu
m=9.1*10**-31#
t=(m*mu)/q##relaxation time
print 't = %0.3f ps'%(t*1e12)
mun=0.38#
mup=0.18#
n=2.5*10**19#
a=0.13#
b=0.05#
n2=1.5*10**16#
q=1.6*10**-19#
sigma=q*n*(mun+mup)## intrinsic coductivity for germanium
print 'sigma = %0.2f ohm-mu**-1'%sigma
sigma1=q*n2*(a+b)##intrinsic coductivity for silicon
print 'sigma1 = %0.2e ohm-m**-1'%sigma1
n=1.41*10**16#
mun=0.145#
mup=0.05#
q=1.6*10**-19#
#sigma=q*n*(mun+mup)#
e=q*n*mun##contribution by electrons
h=q*n*mup##contribution by holes
print 'e = %0.2e ohm-m**-1'%e
print 'h = %0.2e ohm-m**-1'%h
q=1.60*10**-19#
l=0.2*10**-3#
a=0.04*10**-6#
v=1#
i=8*10**-3#
mun=0.13#
#concentration of free electrons
R=v/i##resistance
print 'R = %0.2f ohm'%R
rho=(R*a)/l#
print 'rho = %0.3f ohm-m'%rho
sigma=1/rho##conductivity
n=sigma/(q*mun)##concentration of free electrons
print 'n = %0.2e /m**3'%n
#Drift velocity
j=i/a#
print 'J = %0.2e amp/m**2'%j
v=j/(n*q)#
print 'v = %0.2f m/sec'%v
rho=0.47#
q=1.6*10**-19#
mun=0.39#
mup=0.19#
sigma=1/rho##conductivity of intrinsic semiconductor
print 'sigma = %0.2f ohm-m**-1'%sigma
n=sigma/(q*(mun+mup))##intrinsic carrier concentration of germanium
print 'n = %0.1e /m**3'%n
ND=10**21#
NA=5*10**20#
q=1.6*10**-19#
mun=0.18#
ND1=ND-NA##number of free electrons
print 'n = %0.2e /m**3'%ND1
SIGMA=ND1*q*mun##conductivity of silicon
print 'SIGMA = %0.2f ohm-m**-1'%SIGMA
rho=100.0#
q=1.6*10**-19#
mun=0.36#
sigma=1.0/rho#
print 'sigma = %0.2f (ohm-m)**-1'%sigma
ND= sigma/(q*mun)##donar concentration
print 'ND = %0.2e atoms/m**3'%ND
ND=2*10**14#
NA=3*10**14#
ni=2.3*10**19#
n=(ni**2)/NA#
print 'n = %0.2e electrons/cm**3'%n
p=(ni**2)/ND#
print 'p = %0.2e holes/cm**3'%p
ND=5*10**8#
NA=6*10**16#
ni=1.5*10**10#
n=(ni**2)/NA##number of electons
p=(ni**2)/ND##number of holes
print "n = %0.f"%n
print "p = %0.2e"%p
from math import pi
d=0.001#
q=1.6*10**-19#
ND=10**20#
R=1000#
mun=0.1#
n=ND##number of free electrons
sigma=q*n*mun##conductivity
print 'sigma = %0.2f S/m'%sigma
a=(1/sigma)*(1/(pi*(0.001**2)/4))
l=R/a#
print 'l = %0.2f mm'%(l*10**3)
sigma=100#
rho=0.1#
ni=1.5*10**10#
mun=1300#
mup=500#
ni1=2.5*10**13#
mun1=3800#
mup1=1800#
q=1.602*10**-19#
#concentration of p type germanium
p=sigma/(q*mup1)#
print 'p = %0.2e /cm**3'%p
n=(ni1**2)/p#
print 'n = %0.2e /cm**3'%n
#concentration of n type silicon
n=rho/(mun*q)#
print 'n = %0.2e /cm**3'%n
p=(ni**2)/n#
print 'p = %0.2e /cm**3'%p
# ans in the textbook are wrong
mun=3800#
mup=1800#
ni=2.5*10**13#
Nge=4.41*10**22#
q=1.602*10**-19#
ND=Nge/10**8#
print 'ND = %0.2e /cm**3'%ND
p=(ni**2)/ND#
print 'p = %0.2e /cm**3'%p
n=ND#
sigma=q*n*mun#
print 'sigma = %0.2f (ohm-cm**)-1'%sigma
rho=1/sigma#
print 'rho = %0.2f ohm-cm'%rho
Nsi=4.96*10**22#
ni=1.52*10**10#
q=1.6*10**-19#
mun=1350#
mup=480#
#resistivity of intrinsic silicon
sigma=q*ni*(mun+mup)
print 'sigma = %0.2e (ohm-cm)**-1'%sigma
rho=1/sigma#
print 'rho = %0.2f ohm-cm'%rho
#resistivity of doped silicon
ND=Nsi/(50*10**6)#
print 'ND = %0.2e /cm**3'%ND
n=ND#
p=(ni**2)/n#
print 'p = %0.2e /cm**3'%p
sigma=q*n*mun#
print 'sigma = %0.2f (ohm-cm)**-1'%sigma
rho=1/sigma#
print 'rho = %0.2f ohm-cm'%rho
mup=0.048#
mun=0.135#
q=1.602*10**-19#
Nsi=5*10**28#
ni=1.5*10**16#
sigma=q*ni*(mun+mup)#
print 'sigma = %0.2e ohm-m**-1'%sigma
NA=Nsi/10**7#
P=NA#
n=ni**2/P#
sigma=q*P*mup#
print 'sigma = %0.2f ohm-m**-1'%sigma
alpha=0.05#
T=34-20#
sigma20=0.44*10**-3#
sigma34=sigma20*(1+alpha*T)#
print 'sigma34 = %0.2e ohm-m**-1'%sigma34
from __future__ import division
mun=3600#
mup=1700#
k=1.38*10**23#
T=300#
DP=mup*(T/11600)##answer given in the book is wrong
print 'DP = %0.2e m**2/s'%DP
Dn=mun*(T/11600)##answer given in the book is wrong
print 'Dn = %0.2e m**2/s'%Dn
from __future__ import division
RH=160#
rho=0.16#
mun=(1/rho)*RH#
print 'mu = %0.2f cm**2/volt-sec'%mun
from __future__ import division
I=50#
B=1.2#
t=0.5*10**-3#
Vh=100#
q=1.6*10**-19#
n=(B*I)/(Vh*q*t)#
print 'n = %0.2e /m**3'%n
from __future__ import division
rho=20*10**-2#
mu=100*10**-4#
q=1.6*10**-19#
n=1/(rho*q*mu)#
print 'n = %0.2e /m**3'%n
from __future__ import division
Rh=3.66*10**-4#
rho=8.93*10**-3#
mu=Rh/rho#
print 'mu = %0.2f m**2/V-s'%mu
q=1.6*10**-19#
n=1/(q*Rh)#
print 'n = %0.2e /m**3'%n
from __future__ import division
rho=9*10**-3#
mup=0.003#
sigma=1/rho#
print 'sigma = %0.2f S/m'%sigma
RH= mup/sigma#
print 'RH = %0.2e m**3*C'%RH