# radius of the lowest state of Ground State
import math
#Variable declaration
n=1
h=6.626*10**-34 # planc's constantJ-sec
eps=10**-9/(36*math.pi)
m=9.1*10**-31 # electron mass in kg
e=1.6*10**-19 #Electron charge
#Calculations
r=n**2*h**2*eps/(math.pi*m*e**2)
#Result
print("\nradius of the lowest state of Ground State, r=%.2f A°"%(r*10**10))
# no of photons emitted per second by lamp
import math
#Variable declaration
l =2537.0 # wavelength in A°
E_diff=12400.0/l
e=1.6*10**-19
energy=50.0/1000 # J/sec
#Calculations
e_j=energy/e # eV/sec
n=e_j/E_diff
#Result
print("The lamp emits %.1f * 10^16 photons/sec of wavelength, lambda=%dA°"%(n/10**16,l))
# Speed of ejected electron
import math
#Variable declaration
e_ar=11.6 # eV
e_Na=5.12 # eV
e=1.6*10**-19 # C
m=9.1*10**-31 # kg
#Calculations
V=e_ar-e_Na
v=math.sqrt(2*e*V/m)
#Result
print("Velocity, v = %.2f * 10^6 m/sec"%(v/10**6))
# speed of electron in sodium vapour lamp
import math
#Variable declaration
l=5893.0 # A°
V=2.11 # Volts
e=1.6*10**-19 #C
m=9.1*10**-31 #kg
#Calcualations
v=math.sqrt(2*e*V/m)
#Result
print("Velocity, v = %.2f * 10^5 m/sec"%(v/10**5))
# radio transmitter
import math
#Variable declaration
f=10*10**6 # Hz
h=6.626*10**-34 # Joules/sec
e=1.6*10**-19 # C
#(a)
E=h*f/e
print("\n(a)Energy of each radiated quantum,\n\tE = %.3f*10^-27 Joules/Quantum\n\tE = %.2f*10^-8 eV/Quantum"%(h*f*10**27,E*10**8))
# (b)
E=1000.0 # Joule/sec
N=E/(h*f)
print("\n\n(b)\nTotal number of quanta per sec, N=%.2f*10^29"%(N/10**29))
#(c)
o=10**-7
print("\n\n(c)\nNumber of quanta emitted per cycle = %.2f*10^22 per cycle"%(o*N/10**22))
# Neon Ionization
import math
#Variable declaration
V=21.5 # Volts
e=1.6*10**-19 # C
m=9.1*10**-31 # kg
l=12400.0/V # A°
c=3*10**8 #m/sec
#calculations and Result
#(a)
v=math.sqrt(2*e*V/m)
print("(a)\nVelocity, v = %.2f*10^6 m/sec\nWavelength of Radiation, Lambda = %.1f"%(v/10**6,math.ceil(l)))
# (b)
f=c/(l*10**-10)
print("\n(b)\nFrequency of Radiation, f = %.1f * 10^15 Hz"%(f/10**15))
# wavelength of photon
import math
#Variable declaration
L=1400.0
del_E=2.15
#Calculations
E_diff=12400.0/L # eV
L2=12400.0/del_E
#Result
print("E2-E1 = %.2f eV\n1850 A° line is from 6.71 eV to 0 eV"%(E_diff))
print("Therefore, second photon must be from %.2f to 6.71 eV.\nLambda=%d A°."%(E_diff,L2))
# High field emission
import math
#Variable declaration
A=60.2*10**4 # A/m^2/°K^2
B=52400.0 # °K
T1=2400.0 # °K
T2=2410.0 # °K
#calcualtions
js1=A*T1**2*(math.e**(-B/T1))
js2=A*T2**2*(math.e**(-B/T2))
js1=math.floor(js1)
js2=math.floor(js2)
p=(js2-js1)*100/js1
#Result
print("JS1 = %d A/m^2\nJS2 = %d A/m^2"%(js1,js2))
print("\nPercentage Increase = %.2f%%"%p)
# Work function and wavelength
import math
#Variable declaration
h=6.63*10**-34 # Plank's Constant, J sec.
e=1.6*10**-19 # Charge of Electron, C
c=3*10**8 # Velocity of Light, m/sec
v=0.55 # volts
l=5500.0*10**-10 # m
#Calculations and Results
#(a)
fi=(h*c)/(l*e)
fi=fi-v
print("(a)\nWork Function(WF), fi = %.2f Volts"%fi)
#(b)
l0=12400.0/fi
print("\n\n(b)\nThreshold Wavelength = %d A°"%l0)
# effect of temperature on emission
import math
#Variable declaration
dT=20.0
T=2310.0 # °K
Ew=4.52
k=8.62*10**-5
#Calculations
x=(Ew/(k*T))
x=(2+x)*dT/T
#Result
print("(a)\ndIth/Ith = %.1f%%\n\n(b)\nThis is solved by Trial and Error Method to get T = 2370°K"%(x*100))
# RF voltage frequency in cyclotron
import math
#Variable declaration
B=1.0 # Tesla
T=35.5*10**-6 # sec
k=2*10**6
g=40000.0
#Calculations
f=1/T
v=49*g
R=(3.37*10**-6)*math.sqrt(v)
#Result
print("(a)\nThe frequency of the R.F voltage, f = %.2f*10^4 Hz"%(f/10**4))
print("\n\n(b)Number of passages required to gain 2*10^6 eV are ,N = %d"%(k/g))
print("\n\n(c)\nDiameter of last semicircle, D = 2R = %.2f *10^-4 m"%(2*R*10000))
# Emission current and cathode efficiency
import math
#Variable declaration
Ew=1.0 # eV
A0=100.0 # A/m2 I °K2
S=1.8*10**-4 # cm2
K =8.62*10**-5 # eV/oK
T=1100.0
pd=5.8*10**4 # W/m^2
#Calculations
ipd=1.1*pd
tip=S*ipd
Ith=S*A0*T**2*math.e**(-Ew/(K*T))
#Result
print("Ith = %.3f A\nCathode Efficiency, eta = %.0f mA/°K"%(Ith,math.ceil(Ith*1000/11.5)))
# resistivity of doped material
import math
#Variable declaration
n=4.4*10**22 # cm^3
mu=3600.0 # cm62/volt-sec
e=1.6*10**-19 # C
#Calculations
sigma=n*mu*e*10**-6
#Result
print("Resistivity, rho = %.3f Ohm-cm"%(1/sigma))
# conductivity and resistivity of pure silicon
import math
#Variable declaration
mup=500.0
mun=1500.0
n=1.6*10**10
e=1.6*10**-19
#Calculations
sigma=(mun+mup)*e*n
#Result
print("Conductivity, sigma = %.2f *10^-6\nResistivity, rho = %d Ohm-cm"%(sigma*10**6,1/sigma))
# concentration of free electrons and holes
import math
#Variable declaration
A = 9.64*10**14
EG = 0.25 # eV
n1 = 6.25*10**26 # cm^3
na=3*10**14
nd=2*10**14
n=-(10**14)+(math.sqrt(10**28+4*6.25*10**26))
n=n/2.0
#Result
print("n = %.1f * 10^12 electrons/cm^3\np = %.2f * 10^14 holes/cm^3"%(n/10**12,(n+10**14)/10**14))
print("As p> n, this is p-type semiconductor.")
# concentration of free electrons and holes
import math
#Variable declaration
sigma=100.0 # Ohm-cm
e=1.6*10**-19 # c
mup=1800.0 # cm^2/V-sec
ni=2.5*10**13 # /cm^3
#Result
pp=sigma/(e*mup)
n=ni**2/pp
#Result
print("In p-type semiconductor, p>>n.")
print("\nPp = %.2f * 10^17 holes/cm^3\nn = %.1f * 10^9 electrons/cm^3"%(pp/10**17,n/10**9))
# concentration of free electrons and holes in p type Ge and n type Si
import math
#Variable declaration
# (a)
sigma=100.0 # Ohm-cm
e=1.6*10**-19 # c
mup=1800.0 # cm^2/V-sec
ni=2.5*10**13 # /cm^3
#(b)
mun=1300.0
sig=0.1
n1=1.5*10**10
#Calculations
pp=sigma/(e*mup)
n=ni**2/pp
n2=sig/(mun*e)
p1=(n1**2)/n2
#Result
print("(a)\nAs it is p-type semiconductor, p>>n.")
print("\nPp = %.2f*10^17 holes/cm^3\nn = %.1f*10^9 electrons/cm^3"%(pp/10**17,n/10**9))
print("\n\n(b)\nn = %.2f*10^14 elecrons/cm^3\np = %.2f*10^5 holes/cm^3"%(n2/10**14,p1/10**5))
# conduction current density
import math
#Variable declaration
sig=1.0/60 # v/cm
mup=1800.0 # cm^2/V-sec
mun=3800.0 # cm^2/V-sec
e=1.6*10**-19 # C
na=7*10**13 # cm^3
nd=10**14 # /cm^3
p=0.88*10**13
n=3.88*10**13
eps=2.0
#Calculations
ni=sig/(e*(mun+mup))
k=na-nd # p-n
J=(n*mun+p*mup)*(e*eps)
#Result
print("J = %.1f mA/cm^3"%(J*1000))
# concentration of free electrons and holes in Ge
import math
#Variable declaration
na=3*10**14 # /cm^3
nd= 2*10**14 # /cm^3
ni= 2.5*10**13# /cm^3
#Calculations
k=na-nd
n=(-k+math.sqrt(k**2+4*ni**2))/2
#Result
print("n = %.1f * 10^18 electrons/m^3\np = %.2f * 10^19 holes/m^3"%(n/10**12,ni**2/n*10**-13))
print("as p > n, it is p-type semiconductor.")
# intrinic concentration and conductivity of Germanium
import math
#Variable declaration
A=9.64*10**21
T=320.0
e=1.6*10**-19
Eg=0.75
k=1.37*10**-23
mup=0.36
mun=0.17
#Calculations
ni=A*T**(3.0/2)*math.e**(-(e*Eg)/(2*k*T))
sig=e*ni*(mup+mun)
#Result
print("ni = %.2f *10^19 electrons(holes)/m^3"%(ni/10**19))
print("\nConductivity, Sigma = %.3f Mho/m"%sig)
# resistivity of intrinsic Germanium at room temperature
import math
#Variable declaration
e=1.6*10**-19 # C
ni=2.5*10**19
mun=0.36 # m^2/V-sec
mup=0.17 # m^2/V-sec
#Calculations
sig=e*ni*(mup+mun)
rho=1/sig
#Result
print("Resistivity, rho = %.2f Ohm-m"%rho)
# Fermi level of p type Ge
import math
#Variable declaration
mup=0.4
T=300.0
Nv=4.82*10**15
#Calculations
Na=Nv*mup**(3.0/2)*T**(3.0/2)
#Result
print("Doping concentration, NA = %.2f*10^18 atoms/cm^3"%(Na/10**18))
# Distance of Fermi level from centre of forbidden bond
import math
#Variable declaration
Vt=0.026
#Calculations
Nv=(3.0/4)*Vt*math.log(2)
#Result
print("For Intrinsic Semiconductor,EF will be at the centre of the forbidden band.")
print("But if mp and mn are unequal,EF will be away")
print("from the centre of the forbidden band by\n\nNv = %.1f * 10^-3 eV"%(Nv*10**3))
# Temperature for which conduction band and fermi level coincides
import math
#Variable declaration
si=5*10**22 # atom/cm^3
d=2*10**8
Nd=si/d
m=9.1*10**-31 # kg
k=1.38*10**-23
h=6.626*10**-34
#Calculations
Nc=2*(2*math.pi*m*k/h**2)**(3.0/2)
T=(Nd/Nc)**(2.0/3)
#Result
print("T = %.2f°K"%(T*10**4))
# distance between valence band and Fermi level
import math
#Variable declaration
m=9.1*10**-31
k=1.38*10**-23
h=6.626*10**-34
T=300.0
mp=0.6
si=5*10**22
at=10**8
Kt=0.026
#Calculations
Nc=si/at
Nv=2*(2*math.pi*m*k*T*mp/h**2)**(3.0/2)
Ediff=Kt*math.log(1.17*10**19/(5*10**14))
#Result
print("Nv = %.2f * 10^19 /cm^3"%(Nv/10**25))
print("Ef-Ev = %.2f eV\nTherefore, EF is above Ev"%Ediff)
# doping concentration for given fermi level
import math
#Variable declaration
mp=0.4
T=300.0
k=4.82*10**15
#Calculations
Nv=k*(mp*T)**(3.0/2)
#Result
print("Doping concentration, NA = ND = %.2f*10^18 atoms/cm^3"%(Nv/10**18))
# Distance of Fermi level from centre of forbidden bond
import math
#Variable declaration
Vt=0.026
#Calculations
Nv=(3.0/4)*Vt*math.log(3)
#Result
print("For Intrinsic Semiconductor,EF will be at the centre of the forbidden band.")
print("But if mp and mn are unequal, EF will be away")
print("from the centre of the forbidden band by\n\nNv = %.1f*10^-3 eV"%(Nv*10**3))
# Einstein relationship
import math
#Variable declaration
mung=3800.0
mupg=1800.0
muns=1300.0
mups=500.0
Vt=0.026
#Result
print("For Germanium at room temperature,\nDp = %d cm^2/sec"%(math.ceil(mupg*Vt)))
print("Dn = %d cm^2/sec"%(math.ceil(mung*Vt)))
print("\nFor Silicon,\nDp = %d cm^2/sec\nDn = %d cm^2/sec"%(math.ceil(mups*Vt),math.ceil(muns*Vt)))
# Hall Effect
import math
#Variable declaration
B=0.1 # Wb/m^2
Vh=50.0 # mV
I=10.0 # mA
rho=2*10**5 # Ohm-cm
w=3*10**-3 # m
#Calculations
x=B*I*10**-3/(Vh*10**-2*w)
y=1/(rho*10**-2)
#Result
print("1/RH = %.3f"%x)
print("\nConductivity = %.4f mhos/meter\nmu = %.0f cm^2/V-sec"%(y,(y/x)*10**6))
# Reverse saturation current in diode
import math
#Variable declaration
#(a)
Vt=300.0/11600
#(b)
v1=0.2
v2=0.3
#Calculations
v=Vt*math.log(1.9)
i1=10*(math.e**(v1/Vt)-1)
i2=10*(math.e**(v2/Vt)-1)
#Result
print("(a)\nV = %.3f V"%v)
print("\n(b)\nFor V = 0.2, I = %.2f mA"%(i1/1000))
print("For V = 0.3, I = %.2f A"%(i2/1000000))
# AC and DC resistance of Ge diode
import math
#Variable declaration
Vt=301.6/11600
i0=20*10**-6
v=0.1
#Calculations
I=i0*(math.e**(v/Vt)-1)
r_DC=v/I
r_AC=i0*(math.e**(v/Vt))/Vt
#Result
print("I = %.3f mA"%(I*1000))
print("r_DC = %.1f Ohm"%r_DC)
print("r_AC = %.1f Ohm"%(1/r_AC))
# width of the depletion layer
import math
#Variable declaration
A = 0.001 # cm2
sig1n= 1.0 # mhos/cm,
sig1p=100.0 # mhos/cm
mun=3800.0 # cm2/sec
mup = 1800.0 # cm2/sec.
e=1.6*10**-19 # C
eps=16*8.85*10**-14
ni=6.25*10**26
T=300.0
#Calculations
Vt=T/11600.0
Nd=sig1n/(e*mun)
Na=sig1p/(e*mup)
V0=Vt*math.log(Na*Nd/ni)
w=math.sqrt(2*eps*(V0+1)/(e*Na))
#Result
print("ND = %.2f * 10^15 /cm^3\nNA = %.1f * 10^17 /cm^3"%(Nd*10**-15,Na*10**-17))
print("V0 = %.3f V\nw = %.3f * 10^-4 cm"%(V0,w*10**4))
# dynamic forward and reverse resistance of a p-n junction diode
import math
#Variable declaration
I0=10**-6 # A
T = 301.6 # K
Vf =0.25 # V
Vr= 0.25 # V
#Dynamic Forward Resistance
Vt=T/11600.0
x=(I0*math.e**(Vf/Vt))/Vt
rf=1/x
print("Dynamic Forward Resistance, rf = %.3f Ohm"%rf)
#Dynamic Reverse Resistance
x1=(I0*math.e**(-Vf/Vt))/Vt
rr=1/x1
print("Dynamic Reverse Resistance, rr = %.1f * 10^6 Ohm"%(rr/10**6))
# zener breakdown voltage
import math
#Variable declaration
eps=16/(36*math.pi*10**9) # F/m
mup=1800.0
E=4.0*10**14
#Calculations
V=(eps*mup*E*10**-6)/2
sige=1.0/45
Vz=math.ceil(V)/sige
#Result
print("V = %d V"%Vz)
# Effect of bias on capacitance of a diode
import math
#Variable declaration
Ct=20.0 # pF
v1=5.0 # v
v2=6.0 # v
#Calculations
Ct2=Ct*math.sqrt(v1/v2)
print("Therefore, decrease in the value of capacitance is\nCt1-Ct2 = %.2f pF"%(Ct-Ct2))
# Zener As voltage regulator
import math
#Variable declaration
V1=200.0 # V
Vd=50.0 # V
I=40*10**-3 # A
#Calculations
#If Il=0,
R=(V1-Vd)/I
I0=5 # mA
#for Vmin
Il=25.0
Vmin=Vd+(Il+I0)*0.001*R
#for Vmax
Vmax=Vd+(Il+I*1000)*0.001*R
#Result
print("(a)\nR = %d Ohm\nImax occurs when I0 = %d mA\nTherefore, Imax = %d mA"%(R,I0,I*1----I0))
print("\n(b)\nFor Vmin\nVmin = %.1fV\n\nFor Vmax\nVmax = %.1fV"%(Vmin,Vmax))
# Zener As voltage regulator
import math
#Variable declaration
x=99.5 *10**3 # Ohm (R1+R2)
rm=0.56 *10**3 # Ohm
v1=20.0 # V
#Calculations
i=v1/x
i=0.0002 # aproxximated to
k=16.0/i
R1=k-rm
R2=x-R1
#Result
print("R1 = %.1f K-ohm\nR2 = %.1f K-ohm"%(R1/1000,R2/1000))
# forward snd reverse current ratios
import math
#Variable declaration
T=301.6
vt=T*1000.0/11600
vf=50.0 # mV
vr=-50.0 # mV
#Calculations
k=(math.e**(vf/vt)-1)/(math.e**(vr/vt)-1)
#Result
print("ratio = %.2f"%k)
print("Negative sign is because, the direction of current is opposite when the diode is reverse biased")
# PN junction diode as Resistance
import math
#Variable declaration
V=10.0 # v
I0=0.07/0.11 #(0.07/0.11)*I
i1=5.0 # mA
#Calculations
Ir=1-I0
i=Ir/I0
Ir=i*i1
R=V/Ir
#Result
print("R = %.1f K-Ohm"%R)
# Zener As voltage regulator
import math
#Variable declaration
V=30.0 # V
R=2000.0 # Ohm
Iz=0.025 # A
Rs=200.0
#Calculations
I=V/R
It=Iz+I
Vmax=V+Rs*It
#Result
print("Vrmax = %d V"%Vmax)