In [2]:

```
from __future__ import division
#Given data
R2 = 5 # in k ohm
R2 = R2 * 10**3 # in ohm
R1 = R2 # in ohm
R_B = R2 # in ohm
R4 = 0.4 # in k ohm
R4 = R4 * 10**3 # in ohm
R3 = R4 # in ohm
R_C = R4 # in ohm
C2 = 0.02 # in µF
C2 = C2 * 10**-6 # in F
C1 = C2 # in F
C = C2 # in F
T = 1.386*R_B*C # in sec
T= T*10**3 # in ms
print "The time period = %0.2f ms " %T
f = 1/T # in kHz
print "The frequency of circuit oscillation = %0.1f kHz " %f
Beta_min = R_B/R_C #minimum value of transistor ß
print "The minimum value of transistor ß = %0.1f " %Beta_min
```

In [5]:

```
#Given data
V_CC = 20 # in V
V_BB = 20 # in V
R_C2 = 1 # in k ohm
R_C2 = R_C2 * 10**3 # in ohm
R_C1 = R_C2 # in ohm
f = 500 # in Hz
h_fe = 50 # unit less
PW = 0.2 # in ms
PW = PW*10**-3 # in sec
V_CEsat = 0.3 # in V
V_BEsat = 0.7 # in V
I_CEsat= (V_CC-V_CEsat)/R_C1 # in A
I_Bmin= I_CEsat/h_fe # in A
I_B= 1.5*I_Bmin # in A
R= (V_BB-V_BEsat)/I_B # in ohm
R= int(R*10**-3) # in k ohm
R1=R # in k ohm
R2= R1 # in k ohm
T= 1/f # in sec
D_cycle= PW/T
T2= D_cycle*T #sec
T1= T-T2 # in sec
C1= T1/(0.693*R2) # in mF
C1= C1*10**3 # in µF
C2= T2/(0.693*R1) # in mF
C2= C2*10**3 # in µF
print "The value of R1 = %0.f k ohm " %R1
print "The value of R2 = %0.f k ohm " %R2
print "The value of C1 = %0.3f µF " %C1
print "The value of C2 = %0.3f µF " %C2
```

In [12]:

```
from math import log
#Given data
V_CC = 12 # in V
R_B = 20 # in k ohm
R_B = R_B * 10**3 # in ohm
R_C = 2 # in k ohm
R_C = R_C * 10**3 # in ohm'
C = 0.1 # in µF
C = C * 10**-6 # in F
V_CEsat = 0.2 # in V
V_BEsat = 0.8 # in V
Beta = 50 # unit less
T =R_B*C*log( (2*V_CC-V_BEsat)/(V_CC-V_BEsat) ) # in S
print "The input pulse = %0.4f ms " %(T*10**3)
I_Csat = (V_CC-V_CEsat)/R_C # in A
I_Csat = I_Csat * 10**3 # in mA
# Beta = h_fe
I_Bmin = I_Csat/Beta # in mA
I_B = (V_CC-V_BEsat)/R_B # in A
I_B = I_B * 10**3 # in mA
if I_B>I_Bmin :
print "The value of I_B (",round(I_B,2),"mA) is greater than the value of I_Bmin (",round(I_Bmin,3),"mA)."
print "Hence the transistor in saturaion "
```

In [20]:

```
from sympy import symbols, solve, N
#Given data
T= 500*10**-6 # in sec
h_femin = 25 # unit less
I_CEsat = 5 # in mA
I_CEsat = I_CEsat * 10**-3 # in A
V_CC = 10 # in V
V_BB = 4 # in V
V_CEsat = 0.4 # in V
V_BEsat = 0.8 # in V
V_BEoff = -1 # in V
R_C2 = (V_CC-V_CEsat)/I_CEsat # in ohm
R_C1= R_C2 # in ohm
print "The value of R_C1 = %0.2f k ohm " %(R_C1*10**-3)
print "The value of R_C2 = %0.2f k ohm " %(R_C2*10**-3)
I_B2min = I_CEsat/h_femin # in A
I_B2actual = 1.5*I_B2min # in A
R = (V_CC-V_BEsat)/(I_B2actual) # in ohm
print "The value of R = %0.3f k ohm " %(R*10**-3)
C= T/(0.693*R) # in F
print "The value of C = %0.6f µF " %(C*10**6)
R1= symbols('R1')
R2= 2.143*R1 # in ohm
# I_B1actual= (V_CC-V_BE1sat)/(R_C+R1) - (V_BE1sat+V_BB)/R2 and R2= 2.143*R1 so
expr = I_B2actual*R2*(R1+R_C1)-V_CC*R2+V_BEsat*R2+R1*V_BEsat+R1*V_BB+R_C1*V_BEsat+R_C1*V_BB
R1 = solve(expr, R1)
R1= R1[1] # in ohm
R1= R1*10**-3 # in kohm
R2= 2.143*R1 # in k ohm
print "The value of R1 = %0.2f k" %R1
print "The value of R2 = %0.1f kΩ " %R2
R1= R1*10**3 # in ohm
R1C1= 1*10**-6 # in F
C1= R1C1/R1 # in F
C1= C1*10**12 # in pF
print "The value of C1 = %0.1f pF " %C1
```

In [21]:

```
#Given data
V_CC = 10 # in V
V_BB = -10 # in V
R_C2 = 1.2* 10**3 # in ohm
R_C1 = R_C2 # in ohm
R_B1 = 39 * 10**3 # in ohm
R_B2 = R_B1 # in ohm
R2 = 10* 10**3 # in ohm
R1 = R2 # in ohm
h_fe = 30 # unit less
V_CE2sat = 0 # in V
I1 = (V_CC-V_CE2sat)/R_C2 # in A
I2 = (V_CE2sat-V_BB)/(R1+R_B2) # in A
I_C2 = I1-I2 # in A
I_B2min = I_C2/h_fe # in A
V_C2 = 0 # in V
V_B1 = V_C2 - (I2*R1) # in V
V_B2 = 0 # in V
V_C1 = 10 # in V
I3 = (V_CC-V_C1)/R_C1 # in A
V_BE2sat = 0 # in V
I4 = (V_C1-V_BE2sat)/R2 # in A
I_D = I3-I4 # in A
I5 = (V_BE2sat-V_BB)/R_B1 # in A
I_B2actual = I4-I5 # in A
I_B2actual= I_B2actual*10**3 # in mA
I_C1 = 0 # in mA
I_B1 = 0 # in mA
I_C2= I_C2*10**3 # in mA
print "The value of V_C1 = %0.f V " %V_C1
print "The value of V_C2 = %0.f V " %V_C2
print "The value of V_B1 = %0.f V " %V_B1
print "The value of V_B2 = %0.f V " %V_B2
print "The value of I_C1 = %0.f mA " %I_C1
print "The value of I_C2 = %0.2f mA " %I_C2
print "The value of I_B1 = %0.f mA " %I_B1
print "The value of I_B2 = %0.3f mA " %I_B2actual
```