##Ex4_1
import math
Irs = 0.2*10**-6
Vf = 0.1
VT = 26.*10**-3
eta = 1.##for germanium
I = Irs*(math.exp(Vf/eta/VT)-1.)
print'%s %.2e %s'%("Irs = ",(Irs),"A")##reverse saturation current
print'%s %.2f %s'%("Vf = ",(Vf),"V")##applied voltage
print'%s %.2f %s'%("VT = ",(VT),"V")##voltage at room temperature
print'%s %.2f %s'%("eta = ",(eta),"")
print("I = Irs*(math.exp(Vf/eta/VT)-1)")##current at room temperature
print'%s %.2e %s'%("I = ",(I),"A")
##current in silicon:
eta = 2.##for silicon
print'%s %.2f %s'%("eta = ",(eta),"")
I = Irs*(math.exp(Vf/eta/VT)-1.)
print'%s %.2e %s'%("I = ",(I),"A")
## note: incomplete solution in textbook for above question.
##Ex4_2
import math
Irs = 2.0*10**-6
I = 10.*10**-3
VT = 26.*10**-3
eta = 2##for silicon
print'%s %.2e %s'%("Irs = ",(Irs),"A")##reverse saturation current
print'%s %.2f %s'%("I = ",(I),"A")##forward current
print'%s %.2f %s'%("VT = ",(VT),"V")##voltage at room temperature
print'%s %.2f %s'%("eta = ",(eta),"")
Vf = eta*VT*math.log((I/Irs)+1)##voltage produced
print'%s %.2f %s'%("Vf = eta*VT*log((I/Irs)+1) = ",(Vf),"V")
##Ex4_3
import math
If = 3.*10**-3##forward current
eta = 1.##for germanium
T = 300.##room temperature
VT = T/11600.##voltage at room temperature
print'%s %.2e %s'%("If = ",(If),"A")
print'%s %.2f %s'%("eta = ",(eta),"")
print'%s %.2f %s'%("T = ",(T),"degreeK")
print'%s %.2f %s'%("VT = ",(VT),"V")
Rdf = (eta*VT/If)##dynamic resistance at room temprature
print'%s %.2f %s'%("Rdf = (eta*VT/If) = ",(Rdf),"ohm")
##Ex4_4
import math
A = 4*10**-6
W = 1.5*10**-6
apsilent_r = 16.##for germanium
apsilent_not = 8.85*10**-12##permitivity in vaccum
print'%s %.2e %s'%("A = ",(A),"m_sq")##cross sectional are
print'%s %.2e %s'%("W = ",(W),"m")##width of depletion layer
print'%s %.2e %s'%("apsient_r = ",(apsilent_r),"")##relative permittivity
print("CT = apsilent*A/W")##transition capacitance
print'%s %.2e %s'%(" = ",(apsilent_r*apsilent_not*A/W),"F")
## note: units given in textbook in the solution for cross sectional area and width are misprinted.
##Ex4_5
import math
I = 10.*10**-3
eta = 1##for germanium
VT = 26.*10**-3
tawo = 6.*10**-3
CD = I*tawo/eta/VT
print'%s %.2f %s'%("I = ",(I),"A")##forward current
print'%s %.2f %s'%("eta = ",(eta),"")
print'%s %.2f %s'%("VT = ",(VT),"V")##voltagr at room temperature
print'%s %.2f %s'%("tawo = ",(tawo),"sec")##mean lifetime
print'%s %.2e %s'%("CD = I*tao/eta/VT = ",(CD),"F")##