from __future__ import division
from math import exp
#Given data
E_G = 0.72 # in eV
E_F = (1/2)*E_G # in eV
k = 8.61*10**-5 # in eV/K
T = 300 # in K
# The fraction of the total number of electrons
n_C_by_n = 1/( 1 + (exp((E_G-E_F)/(k*T))) )
print "The fraction of the total number of electrons = %0.2e" %n_C_by_n
#Given data
n_i = 1.4*10**18 # in /m**3
N_D = 1.4*10**24 # in /m**3
n = N_D # in /m**3
p = (n_i**2)/n # in /m**3
# Ratio of electron to hole concentation,
ratio = n/p
print "Ratio of electron to hole concentration = %0.1e" %ratio
#Given data
e = 1.6*10**-19 # in C
m = 9.1*10**-31 # in kg
miu_e = 7.04 * 10**-3 # in m**2/V-s
n = 5.8*10**28 # in /m**3
torque = (miu_e/e)*m # in sec
print "The relaxation time = %0.3e second " %torque
sigma = n*e*miu_e
rho = 1/sigma # in ohm-m
print "The resistivity of conductor = %0.3e ohm-m " %rho
#Given data
e = 1.601*10**-19 # in C
m = 9.107 * 10**-31 # in kg
E = 100 # in V/m
n = 6*10**28 # in /m**3
rho = 1.5*10**-8 # in ohm-m
sigma = 1/rho
torque = (sigma*m)/(n*(e**2)) # in second
print "The relaxation time = %0.3e second " %torque
v = ((e*E)/m)*torque # in m/s
print "The drift velocity = %0.3f m/s " %v
from numpy import pi
#Given data
d = 2 # in mm
d = d * 10**-3 # in m
sigma = 5.8*10**7 # in S/m
miu_e = 0.0032 # in m**2/V-s
E = 20 # in mV/m
E = E * 10**-3 # in V/m
e = 1.6*10**-19 # in C
n = sigma/(e*miu_e) # in /m**3
print "The charge density of free electrons = %0.3e /m**3 " %n
J = sigma*E # in A/m**2
print "The current density = %0.2e A/m**2 " %J
I = J * ( (pi*(d**2))/4 ) # in A
print "The current flowing in the wire = %0.3f A " %I
v = miu_e*E # in m/s
print "The electron drift velocity = %0.1e m/s " %v
#Given data
l = 1 # in cm
l = l * 10**-2 # in m
A = 1 # in mm**2
A = A * 10**-6 # in m**2
R = 100 # in ohm
rho = (R*A)/l # in ohm-m
sigma = 1/rho
e = 1.6*10**-19 # in C
miu_e = 1350 # in cm**2/V-s
miu_e = miu_e * 10**-4 # in m**2/V-s
n = sigma/(e*miu_e) # in /m**3
print "The dopant density = %0.2e /m**3" %n
# Note: The unit of the answer is wrong because 0.0463*10**23/m**3 = 4.63*10**21/m**3, not in /cm**3
#Given data
R = 1 # in k ohm
R = R * 10**3 # in ohm
L = 400 # in µm
L = L * 10**-6 # in m
W = 20 # in µm
W = W * 10**-6 # in m
a = L*W # in m**2
l = 4 # in mm
l = l * 10**-3 # in m
rho_i = (R*a)/l # in ohm-m
sigma_i = 1/rho_i # in S/m
e = 1.6*10**-19 # in C
miu_h = 480 # in cm**2/V-s
miu_h = miu_h * 10**-4 # in m**2/V-s
# sigma_i = p*e*miu_h
p = sigma_i/(e*miu_h) # in /m**3
print "The concentration of acceptor atom = %0.2e /m**3 " %p
#Given data
rho = 0.5 # in ohm-m
J = 100 # in A/m**2
miu_e = 0.4 # in m**2/V-s
e = 1.6*10**-19 # in C
sigma = 1/rho
E = J/sigma
v = miu_e*E # in m/s
print "The drift velocity = %0.f m/s " %v
D = 10 # distance of travel in µm
D = D * 10**-6 # in m
# Time taken by electron
t= D/v # time taken in second
print "The time taken = %0.1e second " %t
#Given data
rho = 0.039 # in ohm-cm
sigma_n = 1/rho # in mho/cm
miu_e = 3600 # in cm**2/V-s
e = 1.602*10**-19 # in C
# sigma_n = n*e*miu_e = N_D*e*miu_e
N_D = sigma_n/(e*miu_e) # in /cm**3
n = N_D # in /cm**3
print "The electrons density = %0.2e per cm**3 " %n
n_i = 2.5*10**13 # in /cm**3
p = (n_i**2)/n # in /cm**3
print "The hole density = %0.1e per cm**3 " %p
#Given data
rho_i = 0.47 # in ohm-m
sigma_i = 1/rho_i # in S/m
miu_e = 0.39 # in m**2/V-s
miu_h = 0.19 # in m**2/V-s
e = 1.6*10**-19 # in C
#sigma_i = n_i*e*(miu_e+miu_h)
n_i = sigma_i/( e*(miu_e+miu_h) ) # in /m**3
print "The density of electrons = %0.3e per m**3 " %n_i
E = 10**4
v_n = miu_e*E # in m/s
print "The drift velocity for electrons = %0.f m/s " %v_n
v_h = miu_h*E # in m/s
print "The drift velocity for holes = %0.f m/s " %v_h
#Given data
rho = 3000 # in ohm-m
n = 1.1*10**6 # in /m**3
e = 1.6*10**-19 # in C
#miu_e = 3*miu_h (i)
# miu_e+miu_h = 1/(rho*e*n) (ii)
# From eq (i) and (ii)
miu_h = (1/(rho*e*n))/4 # in m**2/V-s
print "The holes mobility = %0.3e m**2/V-s " %miu_h
miu_e = 3*miu_h # in m**2/V-s
print "The electron mobility = %0.2e m**2/V-s " %miu_e
# Note: The calculated value of hole mobility is wrong .
#Given data
n_i = 2.5*10**13 # in /cm**3
miu_e = 3800 #in cm**2/V-s
miu_h = 1800 # in m**2/V-s
e = 1.6*10**-19 # in C
sigma_i = n_i*e*(miu_e+miu_h) # in (ohm-cm)**-1
print "The intrinsic conductivity = %0.4f (ohm-cm)**-1 " %sigma_i
n = 4.4*10**22
impurity = 10**-7
N_D = n*impurity # in /cm**3
n = N_D # in /cm**3
p = (n_i**2)/N_D # in holes/cm**3
sigma_n = e*N_D*miu_e # in (ohm-cm)**-1
print "The conductivity in N-type Ge semiconductor = %0.2f (ohm-cm)**-1 " %sigma_n
#Given data
e = 1.6*10**-19 # in C
miu_e = 0.38 # in m**2/V-s
miu_h = 0.18 # in m**2/V-s
V = 10 # in V
l = 25 # in mm
l = l * 10**-3 # in m
w = 4 # in mm
w = w * 10**-3 # in m
t= 1.5*10**-3 # in m
E = V/l # in V/m
v_e = miu_e*E # in m/s
print "The electron drift velocity = %0.f m/s " %v_e
v_h = miu_h*E # in m/s
print "The hole drift velocity = %0.f m/s " %v_h
n_i = 2.5*10**19 # in /m**2
sigma_i = n_i*e*(miu_e+miu_h) # in (ohm-cm)**-1
print "The interinsic conductivity of Ge = %0.2f (ohm-cm)**-1 " %sigma_i
A = w*t # in m**2
I = sigma_i*E*A # in A
I = I * 10**3 # in mA
print "The total current = %0.3f mA " %I
#Given data
I_electrons = 3/4
I_holes= 1/4
v_h = 1
v_e = 3
ratio = (I_electrons/I_holes)*(v_h/v_e)
print "Ratio of electrons to holes = %0.f" %ratio
#Given data
miu_e = 0.17 # in m**2/V-s
miu_h = 0.025 # in m**2/V-s
e = 1.602*10**-19 # in C
T = 27 # in degree C
T = T + 273 # in K
kdas = 1.38*10**-23 # in J/K
De = miu_e*( (kdas*T)/e ) # in m**-2/s
De = De * 10**4 # in cm**2/s
print "The diffusion coefficients of electrons = %0.2f cm**2/s" %De
Dh = miu_h*( (kdas*T)/e ) # in m**2/s
Dh = Dh * 10**4 # in cm**2/s
print "The diffusion coefficients of holes = %0.2f cm**2/s" %Dh
#Given data
N = 3*10**25 # in /m**3
e = 1.602*10**-19 # in C
E_G = 1.1 # in eV
E_G = E_G*e # in J
kdas = 1.38*10**-23 # in J/K
T = 300 # in K
miu_e = 0.14 # in m**2/V-s
miu_h = 0.05 # in m**2/V-s
n_i = N*(exp((-E_G)/(2*kdas*T))) # in /m**3
print "The interinsic carrier concentration = %0.3e /m**3 " %n_i
sigma = n_i*e*(miu_e+miu_h) # in S/m
print "The conductivity of silicon = %0.3e S/m " %sigma
#Given data
Je = 360 # in A/cm**2
T = 300 # in K
d = 1.5 # in mm
d = d * 10**-1 # in cm
e = 1.6*10**-19 # in C
delta = 2*10**18-5*10**17 # assumed
dnBYdx = delta/d
De = Je/(e*dnBYdx) # in cm**2/s
V_T = T/11600
miu_e = De/V_T # in cm**2/V-s
print "The mobility of electrons = %0.f cm**2/V-s " %miu_e
#Given data
E_CminusE_F = 0.24 # in eV
T = 300 # in K
T1 = 350 # in K
# E_CminusE_F = K*T*log(n_c/N_D) (i)
# E_CminusE_F1 =K*T1*log(n_C/N_D) (ii)
# From eq(i) and (ii)
E_CminusE_F1 = E_CminusE_F*(T1/T) # in eV
print "The new position of the Fermi level lies ",round(E_CminusE_F1,2)," eV below the conduction band"
from math import log
#Given data
E_FminusE_V = 0.39 # in eV
kT = 0.026 # in ev
#N_A1 = n_V * (%e**(-E_FminusE_V)/kT) (i)
# N_A2=3*N_A1=n_V * (%e**(-E_F2minusE_V)/kT) (ii)
#From eq(i) and (ii)
E_F2minusE_V = kT*(15-log(3)) # in eV
print "The new position of fermi level = %0.2f eV " %E_F2minusE_V