from __future__ import division
# Given data
N_d = 10**17 # atoms/cm**3
n_i = 1.5 * 10**10 # in /cm**3
n_o = 10**17 # in cm**3
# p_o * n_o = (n_i)**2
p_o = (n_i)**2 / n_o #in holes/cm**3
print "The holes concentration at equilibrium = %0.2e holes/cm**3 " %p_o
from math import log
# Given data
n_i = 1.5 * 10 **10 # in /cm**3 for silicon
N_d = 10**17 # in atoms/cm**3
n_o = 10**17 # electrons/cm**3
KT = 0.0259
# E_r - E_i = KT * log(n_o/n_i)
del_E = KT * log(n_o/n_i) # in eV
print "The energy band for this type material, E_F = Ei +",round(del_E,3)," eV"
# Given data
K = 1.38 * 10**-23 # in J/K
T = 27 # in degree
T = T + 273 # in K
e = 1.6 * 10**-19 # in C
Mu_e = 0.17 # in m**2/v-s
Mu_e1 = 0.025 # in m**2/v-s
D_n = ((K * T)/e) * Mu_e # in m**2/s
print "The diffusion coefficient of electrons = %0.1e m**2/s " %D_n
D_p = ((K * T)/e) * Mu_e1 # in m**2/s
print "The diffusion coefficient of holes = %0.2e m**2/s " %D_p
from math import sqrt
# Given data
Mu_n = 0.15 # in m**2/v-s
K = 1.38 * 10**-23 # in J/K
T = 300 # in K
del_n = 10**20 # in per m**3
Toh_n = 10**-7 # in s
e = 1.6 * 10**-19 # in C
D_n = Mu_n * ((K * T)/e) # in m**2/s
print "The diffusion coefficient = %0.2e m**2/s " %D_n
L_n = sqrt(D_n * Toh_n) # in m
print "The Diffusion length = %0.2e m " %L_n
J_n = (e * D_n * del_n)/L_n # in A/m**2
print "The diffusion current density = %0.2e A/m**2 " %J_n
# Note : The value of diffusion coefficient in the book is wrong.
# Given data
Sigma = 0.1 # in (ohm-m)**-1
Mu_n = 1300
n_i = 1.5 * 10**10
q = 1.6 * 10**-19 # in C
n_n = Sigma/(Mu_n * q) # in electrons/cm**3
print "The concentration of electrons = %0.2e per m**3 " %(n_n*10**6)
p_n = (n_i)**2/n_n # in per cm**3
p_n = p_n * 10**6 # in perm**3
print "The concentration of holes = %0.2e per m**3 " %p_n
# Given data
Mu_e = 0.13 # in m**2/v-s
Mu_h = 0.05 # in m**2/v-s
Toh_h = 10**-6 # in s
L = 100 # in µm
L = L * 10**-6 # in m
V = 2 # in V
t_n =L**2/(Mu_e * V) # in s
print "Electron transit time = %0.1e seconds " %t_n
p_g = (Toh_h/t_n) * (1 + Mu_h/Mu_e) #photo conductor gain
print "Photo conductor gain = %0.2f" %p_g
# Note: There is a calculation error to evaluate the value of t_n. So the answer in the book is wrong
# Given data
n_i = 2.5 * 10**13
Mu_n = 3800
Mu_p = 1800
q = 1.6 * 10**-19 # in C
Sigma = n_i * (Mu_n + Mu_p) * q # in (ohm-cm)**-1
Rho = 1/Sigma # in ohm-cm
Rho= round(Rho)
print "The resistivity of intrinsic germanium = %0.f ohm-cm " %Rho
N_D = 4.4 * 10**22/(1*10**8) # in atoms/cm**3
Sigma_n = N_D * Mu_n * q # in (ohm-cm)**-1
Rho_n = 1/Sigma_n # in ohm-cm
print "If a donor type impurity is added to the extent of 1 atom per 10**8 Ge atoms, then the resistivity drops = %0.2f ohm-cm " %Rho_n
# Given data
n_i = 10**16 # in /m3
N_D = 10**22 # in /m**3
n = N_D # in /m**3
print "Electron concentration = %0.1e per m**3 " %n
p = (n_i)**2/n # in /m**3
print "Hole concentration = %0.1e per m**3 " %p
# Given data
Rho = 9.6 * 10**-2 # in ohm-m
Sigma_n = 1/Rho # in (ohm-m)**-1
q = 1.6 * 10**-19 # in C
Mu_n = 1300 * 10**-4 # in m**2/v-s
N_D = Sigma_n / (Mu_n * q) # in atoms/m**3
A_D = N_D # Atom density in atoms/cm**3
A_D = A_D * 10**6 # atoms/m**3
R_si = N_D/A_D # ratio
print "The ratio of donor atom to silicon atom = %0.1e" %R_si
# Note: In the book the wrong value of N_D (5*10**22) is putted to evaluate the value of
# Atom Density (A_D) whereas the value of N_D is calculated as 5*10**20.So the answer in the book is wrong
# Given data
n_i = 1.5 * 10**10 # in per cm**3
n_n = 2.25 * 10**15 # in per cm**3
p_n = (n_i)**2/n_n # in per cm**3
print "The equilibrium electron = %0.1e per cm**3 " %p_n
h_n = n_n # in cm**3
print "Hole densities = %0.2e per cm**3 " %h_n
# Given data
N_A = 2 * 10**16 # in atoms/cm**3
N_D = 10**16 # in atoms/cm**3
C_c = N_A-N_D # C_c stands for Carrier concentration in /cm**3
print "Carrier concentration = %0.1e holes/cm**3 " %C_c
# Given data
del_n = 10**15 # in cm**3
Torque_p = 10 * 10**-6 # in sec
R_g = del_n/Torque_p # in hole pairs/sec/cm**3
print "The rate of generation of minority carrier = %0.1e electron hole pairs/sec/cm**3 " %R_g
# Given data
v = 1/(20 * 10**-6) # in cm/sec
E = 10 # in V/cm
Mu= v/E # in cm**2/V-sec
print "The mobility of minority charge carrier = %0.f cm**2/V-sec " %Mu
# Given data
q = 1.6 * 10**-19 # in C
N_D = 4.5 * 10**15 # in /cm**3
del_p = 10**21
e=10 # in cm
A = 1 # in mm**2
A = A * 10**-14 # cm**2
l = 10 # in cm
Torque_p = 1 # in microsec
Torque_p = Torque_p * 10**-6 # in sec
Torque_n = 1 # in microsec
Torque_n = Torque_n * 10**-6 # in sec
n_i = 1.5 * 10**10 # in /cm**3
D_n = 30 # in cm**2/sec
D_p = 12 # in cm**2/sec
n_o = N_D # in /cm**3
p_o = (n_i)**2/n_o # in /cm**3
print "Hole concentration at thermal equilibrium = %0.1e per cm**3 " %p_o
l_n = sqrt(D_n * Torque_n) # in cm
print "Diffusion length of electron = %0.2e cm " %l_n
l_p = sqrt(D_p * Torque_p) # in cm
print "Diffusion length of holes = %0.1e cm " %l_p
x=34.6*10**-4 # in cm
dpBYdx = del_p *e # in cm**4
print "Concentration gradient of holes = %0.1e cm**4 " %dpBYdx
e1 = 1.88 * 10**1 # in cm
dnBYdx = del_p * e1 # in cm**4
print "Concentration gradient of electrons = %0.2e per cm**4 " %dnBYdx
J_P = -(q) * D_p * dpBYdx # in A/cm**2
print "Current density of holes due to diffusion = %0.2e A/cm**2 " %J_P
J_n = q * D_n * dnBYdx # in A/cm**2
print "Current density of electrons due to diffusion = %0.1e A/cm**2 " %J_n
# Given data
e= 1.6*10**-19 # electron charge in C
h = 6.626 * 10**-34 # in J-s
h= h/e # in eV
c = 3 * 10**8 # in m/s
lembda = 5490 * 10**-10 # in m
f = c/lembda
E = h * f # in eV
print "The energy band gap of the semiconductor material = %0.2f eV " %E
# Given data
y2 = 6 * 10**16 # in /cm**3
y1 = 10**17 # in /cm**3
x2 = 2 # in µm
x1 = 0 # in µm
D_n = 35 # in cm**2/sec
q = 1.6 *10**-19 # in C
dnBYdx = (y2 - y1)/((x2-x1) * 10**-4)
J_n = q * D_n * dnBYdx # in A/cm**2
print "The current density in silicon = %0.f A/cm**2 " %J_n
# Given data
q = 1.6 * 10**-19 # in C
n_n = 5 * 10**20 # in /m**3
n_n = n_n * 10**-6 # in cm**3
Mu_n = 0.13 # in m**2/V-sec
Mu_n = Mu_n * 10**4 # in cm**2/V-sec
Sigma_n = q * n_n * Mu_n # in (ohm-cm)**-1
Rho = 1/Sigma_n # in Ω-cm
l = 0.1 # in cm
A = 100 # µm**2
A = A * 10**-8 # in cm**2
R = Rho * (l/A) # in Ohm
R=round(R*10**-6) # in MΩ
print "The resistance of the bar = %0.f MΩ " %R
# Given data
t_d = 3 # total depletion in µm
D = t_d/9 # in µm
print "Depletion width = %0.1f µm " %D
# Given data
n_i = 1.5 * 10**16 # in /m**3
n_n = 5 * 10**20 # in /m**3
p_n = (n_i)**2/n_n # in /m**3
print "The majority carrier density = %0.2e per m**3 " %p_n
# Given data
D_n = 25 # in cm**2/sec
q = 1.6 * 10**-19 # in C
y2 = 10**14 # in /cm**3
y1 = 0 # in /cm**3
x2 = 0 #in µm
x1 = 0.5 # in µm
x1 = x1 * 10**-4 # in cm
dnBYdx = abs((y2-y1)/(x2-x1)) # in /cm**4
J_n = q * D_n * (dnBYdx) # in /cm**4
J_n = J_n * 10**-1 # in A/cm**2
print "The collector current density = %0.f A/cm**2 " %J_n
# Note: In the book, the calculated value of dn by dx (2*10**19) is wrong. Correct value is 2*10**18
# so the answer in the book is wrong.
# Given data
h = 6.64 * 10**-34 # in J-s
e= 1.6*10**-19 # electron charge in C
c= 3 * 10**8 # in m/s
lembda = 0.87 # in µm
lembda = lembda * 10**-6 # in m
E_g = (h * c)/lembda # in J-s
E_g= E_g/e # in eV
print "The band gap of the material = %0.3f eV " %E_g
from math import exp
# Given data
I_o = 10 # in mW
e = 1.6 * 10**-19 # in J/eV
hv = 2 # in eV
hv1=1.43 # in eV
alpha = 5 * 10**4 # in cm**-1
l = 46 # in µm
l = l * 10**-6 # in m
I_t = round(I_o * exp(-(alpha) * l)) # in mW
AbsorbedPower= I_o-I_t # in mW
AbsorbedPower=AbsorbedPower*10**-3 # in W or J/s
print "The absorbed power = %0.1e watt or J/s " %AbsorbedPower
F= (hv-hv1)/hv # fraction of each photon energy unit
EnergyConToHeat= AbsorbedPower*F # in J/s
print "The amount of energy converted to heat per second = %0.2e in J/s " %EnergyConToHeat
A= (AbsorbedPower-EnergyConToHeat)/(e*hv1)
print "The number of photon per sec given off from recombination events = %0.2e photons/s " %A
# Given data
Mu_p = 500 # in cm**2/v-s
kT = 0.0259
Toh_p = 10**-10 # in sec
p_o = 10**17 # in cm**-3
q= 1.6*10**-19 # in C
A=0.5 # in square meter
del_p = 5 * 10**16 # in cm**-3
n_i= 1.5*10**10 # in cm**-3
D_p = kT * Mu_p # in cm/s
L_p = sqrt(D_p * Toh_p) # in cm
x = 10**-5 # in cm
p = p_o+del_p* exp(x/L_p) # in cm**-3
# p= n_i*%e**(Eip)/kT where Eip=E_i-F_p
Eip= log(p/n_i)*kT # in eV
Ecp= 1.1/2-Eip # value of E_c-E_p in eV
Ip= q*A*D_p/L_p*del_p*exp(x/L_p) # in A
print "The hole current = %0.2e A " %Ip
Qp= q*A*del_p*L_p # in C
print "The value of Qp = %0.2e C " %Qp
# Note: There is a calculation error or miss print to evalaute the value of hole current but they putted correct
# value of it to evaluate the value of Qp.Hence the value of hole current in the book is wrong
# Given data
KT = 0.0259
A = 0.5 # in cm**2
Toh_p = 10**-10 # in sec
p_o = 10**17 # in per cm**3
del_p = 5 * 10**16 # in per cm**3
x = 10**-5 # in cm
Mu_p = 500 # in cm**2/V-S
q = 1.6 * 10**-19 # in C
D_p = KT * Mu_p # in cm/s
L_p = sqrt(D_p * Toh_p) # in cm
p = p_o * del_p * (exp(x/L_p)) # in per cm**3
I_p =q * A * (D_p/L_p) * del_p * (exp(x/L_p)) # in A
print "The hole current = %0.2e A " %I_p
Q_p = q * A * del_p * L_p # in C
print "The hole charge = %0.2e C " %Q_p
# Note: There is a calculation error to evalaute the value of hole current but they putted correct
# value of it to evaluate the value of Qp.Hence the value of hole current in the book is wrong