In [3]:

```
import math
#Variables
Io = 0.15 * 10**-6 #Peak reverse biased current (in Ampere)
V = 0.12 #Voltage (in volts)
VT = 26.0 * 10**-3 #Volt-equivalent of temperature (in volts)
#Calculation
I = Io * (math.exp(V/VT)-1) #Current flowing (in Ampere)
#Result
print "Current flowing through Germanium diode is ",round(I * 10**6)," micro-A."
```

In [9]:

```
import math
#Variables
I = 10 * 10**-3 #Forward biased current (in Ampere)
Io = 2.5 * 10**-6 #Peak reverse biased current (in Ampere)
nVT = 2*26.0 * 10**-3 #Volt-equivalent of temperature (in volts)
n = 2 #For Silicon
#Calculation
V = nVT*math.log(I/Io + 1) #Forward Voltage (in volts)
#Result
print "Forward Voltage = ",round(V,2),"V."
```

In [4]:

```
#Variables
ND = 10**21 #Donor concentration (in per cubic meter)
NA = 10**22 #Acceptor concentration (in per cubic meter)
De = 3.4 * 10**-3 #Diffusion constant for electron (in meter square per second)
Dh = 1.2 * 10**-3 #Diffusion constant for holes (in meter square per second)
Le = 7.1 * 10**-4 #Diffusion length for electrons (in meter)
Lh = 3.5 * 10**-4 #Diffusion length for holes (in meter)
ni = 1.6 * 10**16 #intrinsic concentration (in per cubic-meter)
e = 1.6 * 10**-19 #Charge on electron (in Coulomb)
#Calculation
Io_by_A = (Dh/(Lh*ND) + De/(Le*NA))*e*ni**2 #Reverse saturation current density (in Ampere per meter-square)
#Result
print "Reverse saturation current density is ",round(Io_by_A * 10**6,2),"micro Ampere."
```

In [5]:

```
#Variables
I = 2 * 10**-3 #Forward current (in Ampere)
VT = 25 * 10**-3 #Volt equivalent of temperature (in Volts)
n = 1 #eeta for the given semiconductor
#Calculation
r = n*VT/I #Dynamic resistance (in ohm)
#Result
print "Dynamic resistance = ",r," ohm."
```

In [11]:

```
import math
#Variables
VT = 26.0 * 10**-3 #Volt equivalent of temperature (in Volts)
V = 200 * 10**-3 #Voltage (in volts)
Io = 1.0 * 10**-6 #Reverse saturation current (in Ampere)
n = 1 #For Germanium
#Calculation
r = n*VT/(Io*math.exp(V/(n*VT)))
#Result
print "A.C. resistance = ",round(r,2),"ohm."
```

In [8]:

```
#Variables
Vo = 0.7 #Barrier potential (in volts)
V = 5 #Voltage (in volts)
R = 100 #Resistance (in ohm)
#Calculation
I = (V-Vo)/R #Current flowing through circuit (in Ampere)
#Result
print "Current flowing through the circuit is ",I,"A."
```

In [15]:

```
#Variables
Vo = 0.7 #Barrier potential (in volts)
V = 15 #Voltage (in volts)
R = 7.0 * 10**3 #Resistance (in ohm)
#Calculation
I = (V-2*Vo)/R #Current (in Ampere)
VA = I * R #Voltage drop (in volts)
#Result
print "Voltage drop across 7 ohm resistance is ",VA," V."
```

In [18]:

```
#Variables
V = 15 #Voltage (in volts)
Vo = 0.3 #Voltage across parallel connection (in volts)
#Calculation
VA = V - Vo #Voltage drop (in volts)
#Result
print "Voltage drop = ",VA," V."
```

In [36]:

```
import math
import numpy
%matplotlib inline
from matplotlib.pyplot import plot,title,xlabel,ylabel,annotate
#Variables
VS = 10.0 #Supply voltage (in volts)
RL = 160 #Resistance (in ohm)
#Calculation
I = VS / RL #Current (in Ampere)
#Result
print "Current flowing is ",I * 10**3," mA."
#Graph
x = numpy.linspace(0,10)
plot(x,62.5 -62.5/10*x,'b')
title("VI Characteristics")
xlabel("Diode Voltage , v in volts")
ylabel("Diode Forward Current , I in A")
annotate("Load Line",xy=(5,35))
```

Out[36]:

In [24]:

```
#Variables
V25 = 5 #Initial voltage at 25 degree celsius (in volts)
V100 = 4.8 #Voltage at 100 degree celsius (in volts)
t1 = 25 #Temperature (in celsius)
t2 = 100 #Temperature (in celsius)
#Calculation
dVZ = V100 - V25 #Change in zener voltage (in volts)
dt = t2 - t1 #Change in temperature (in celsius)
tc = dVZ/(V25*dt) #Temperature coefficient
#Result
print "Temperature coefficient is ",round(tc*100,4),"%."
```

In [39]:

```
#Variables
Vs = 12 #Source voltage (in volts)
Vout = VZ = 8 #Output voltage (in volts)
VRs = VS - Vout #Voltage across resistance in series (in volts)
RL = 10 * 10**3 #Load resistance (in ohm)
Rs = 5 * 10**3 #Resistance in series (in ohm)
#Calculation
IL = Vout/RL #Load current (in Ampere)
Is = (Vs-Vout)/Rs #Current through series resistance (in Ampere)
IZ = Is - IL #Current through zener diode (in Ampere)
#Result
print "Output Voltage = ",Vout," V."
print "Voltage across Rs = ",Vs," V."
print "Current through series resistance = ",IZ," A."
```

In [43]:

```
#Variables
Vout = VZ = 50 #Output voltage (in volts)
RL = 10.0 * 10**3 #Load resistance (in ohm)
VSmax = 120 #Maximum voltage (in volts)
RS = 5.0 * 10**3 #Resistance in series (in ohm)
VSmin = 80 #Minimum voltage (in volts)
#Calculation
IL = Vout / RL #Load current (in Ampere)
ISmax = (VSmax - Vout)/RS #Maximum series current (in Ampere)
IZmax = ISmax - IL #Maximum zener current (in Ampere)
ISmin = (VSmin - Vout)/RS #Minumum series current (in Ampere)
IZmin = ISmin - IL #Minimum zener current (in Ampere)
#Result
print "Maximum value of zener diode current is ",IZmax * 10**3," mA.\nMinimum value of zener diode current is ",IZmin * 10**3," mA."
```

In [46]:

```
#Variables
IZK = 6 * 10**-3 #Minimum zener current (in Ampere)
ILmax = 20.0 * 10**-3 #Maximum load current (in Ampere)
VS = 20 #Source voltage (in volts)
Vout = 15 #Output voltage (in volts)
#Calculation
RS = (VS - Vout)/(IZK + ILmax) #Series resistance (in ohm)
#Result
print "Series resistance is ",round(RS,1)," ohm."
print "When the load current will decrease and become 10 mA, the zener current will increase and become 6 + 10 i.e. 16 mA. Thus the current through the series resistance RS will remain unchanged as 6 + 20 i.e. 26 mA. Thus voltage drop in series resistance RS will remain constant. Consequently the output voltage (Vout = VS - IS*RS) will also remain constant."
```

In [50]:

```
#Variables
VL = VZ = 50.0 #Output voltage (in volts)
VS = 120.0 #Source voltage (in volts)
RL = 10.0 * 10**3 #Load resistance (in ohm)
RS = 5.0 * 10**3 #Resistance in series (in ohm)
#Calculation
VRS = VS - VZ #Voltage across resistance in series (in volts)
IL = VL/RL #Load current (in Ampere)
IS = VRS / RS #Current through resistance in series (in Ampere)
IZ = IS - IL #Current through zener diode (in Ampere)
#Result
print "The output voltage is ",VL," V."
print "Voltage drop across RS is ",VRS," V."
print "Current through zener is ",IZ * 10**3," mA."
```

In [54]:

```
#Variables
VS = 16.0 #Source voltage (in volts)
RL = 1.2 * 10**3 #Load resistance (in ohm)
RS = 1.0 * 10**3 #Resistance in series (in ohm)
#Calculation
VL = VS * RL/(RS + RL) #Voltage across load (in volts)
IZ = 0 #Current through zener diode (in Ampere)
PZ = VZ*IZ #Power across zener diode (in Ampere)
#Result
print "VL = ",round(VL,2)," V."
print "IZ = ",IZ," A."
print "PZ = ",PZ," W."
```

In [60]:

```
#Variables
Vin = 20 #input voltage (in volts)
RS = 220.0 #Series resistance (in ohm)
VZ = 10 #Zener voltage (in volts)
RL1 = 200 #Load resistance1 (in ohm)
RL2 = 50 #Load resistance2 (in ohm)
PZmax = 400 * 10**-3 #Power (in watt)
#Calculation
VL1 = Vin*RL1/(RS + RL1) #Voltage across load1 (in volts)
IL1 =IR=Vin/(RS + RL1) #Load1 current (in Ampere)
IZ1 = 0 #Zener current 1 (in Ampere)
VL2 = Vin*RL2/(RS + RL2) #Voltage across load2 (in volts)
IL2 =IR=Vin/(RS + RL2) #Load2 current (in Ampere)
IZ2 = 0 #Zener current 2 (in Ampere)
#Result
print "VL1 = ",round(V,2)," V."
print "IL1 = ",round(IL1*10**3,2),""
print "IZ1 = ",IZ1," A."
print "IR1 = ",round(IL1*10**3,2)," A."
print "VL2 = ",round(VL2,1)," V."
print "IL2 = ",round(IL2*10**3,2)," A."
print "IZ2 = ",IZ2," A."
print "IR2 = ",round(IL2*10**3,2)," A."
```

In [61]:

```
#Variables
VS = 100 #Source voltage (in volts)
VL = VZ = 50 #Voltage across load (in volts)
V = 10.0/(10 + 5) #Voltage (in volts)
#Calculation
VR = VS - VL #Voltage across resistance using KVL (in volts)
#Result
print "Voltage drop across 5 kilo-ohm resistor is ",VR," V."
```

In [68]:

```
#Variables
V = 12 #Voltage (in volts)
R = 120 #Resistance (in ohm)
VDCmin = 15 #Minimum dc voltage (in volts)
VZ = 12 #Zener voltage (in volts)
VDCmax = 19.5 #Maximum dc voltage (in volts)
IZmin = 20 * 10**-3 #Minimum current through zener (in Ampere)
IL = 100 * 10**-3 #Current through load (in Ampere)
IZmax = 200 * 10**-3 #Maximum current through zener (in Ampere)
#Calculation
VSmin = VDCmin - VZ #Minimum voltage across Ri (in volts)
VSmax = VDCmax - VZ #Maximum voltage across Ri (in volts)
ISmin = IZmin + IL #Minimum current through Ri (in Ampere)
Rimin = VSmin/ISmin #Resistance Ri1 (in ohm)
ISmax = IZmax + IL #Minimum current through Ri (in Ampere)
Rimax =VSmax/ISmax #Resistance Ri2 (in ohm)
#Result
print "Ri for minimum voltage is ",Rimin," ohm."
print "Ri for maximum voltage is ",Rimax," ohm."
```

In [78]:

```
#Variables
Vi = 50.0 #Voltage (in volts)
R = 1.0 * 10**3 #Resistance (in ohm)
VZ = 10.0 #Voltage across zener (in volts)
IZmax = 32.0 * 10**-3 #Maximum current across zener (in Ampere)
IZmin = 0.0 #Minimum current across zener (in Ampere)
#Calculation
IR = (Vi - VZ)/R #Supply current (in Ampere)
ILmax = IR - IZmin #Maximum load current (in Ampere)
RLmin = VZ/ILmax #Minimum corresponding load resistance (in ohm)
ILmin = IR - IZmax #Minimum load current (in Ampere)
RLmax = VZ/ILmin #Maximum corresponding load resistance (in ohm)
#Result
print "Range of RL : From ",RLmin,"ohm to ",RLmax*10**-3," kilo-ohm."
print "Range of IL : From ",ILmin* 10**3," mA to ",ILmax*10**3," mA."
```