from math import pi
omega = 2.0*10**3 # rad/sec
f=(omega)/(2.0*pi) # in Hz)
print "Therefore, f = omega / 2pi = %0.2f Hz"%f
from math import sqrt,pi
from __future__ import division
print "Refering to equation(1),"
ri=(25*57*1.8)/((57*1.8)+(25*1.8)+(25*57)) # in k-ohm
print " R''_i = R1 || R2 || h_ie =%0.2f kohm"%ri
print "Now R''_i + R3 = R"
r3=7.1-1.631 # in k-ohm
print "Therefore, R3 = R - R''_i =%0.2f kohm"%r3
k=20/7.1
print " K = R_C / R =%0.2f"%k
print "Now f = 1 / 2*pi*R*C*sqrt(6+4K)"
c=(1/(sqrt(6+(4*2.816))*2*pi*7.1*10*10**6))*10**12 # in pF
print "Therefore, C = %0.2f pF"%c
print " h_fe >= 4K + 23 + 29/K"
hfe=(4*2.816)+23+(29/2.816)
print " h_fe >=%0.2f"%hfe
from __future__ import division
from math import sqrt,pi
print "The given values are, R = 4.7 k-ohm and C = 0.47 uF"
f=1/(2*pi*sqrt(6)*(4.7*10**3)*(0.47*10**-6)) # in Hz
print " f = 1 / 2*pi*sqrt(6)*R*C =%0.2f Hz"%f
from math import sqrt,pi
from __future__ import division
print "f = 1 kHz"
print "Now f = 1 / 2*pi*sqrt(6)*R*C"
print "Choose C = 0.1 uF"
r=1/(sqrt(6)*2*pi*0.1*1*10**-3) # in ohm
print "Therefore, R = %0.2f ohm"%r
print "Choose R = 680 ohm standard value"
from math import sqrt,pi
from __future__ import division
print "Using the expression for the frequency"
print "Now, f = 1 / 2*pi*R*C*sqrt(6)"
f=(1/(sqrt(6)*2*pi*9.7*5*10**6))*10**9 # in nF
print "Therefore, C = %0.2f nF"%f
print "Now using the equation(27)"
print " |A| = g_m * R_L"
print "Therefore, |A| >= 29"
print "Therefore, g_m * R_L >= 29"
rl=(29/(5000*10**-6))*10**-3 # in k-ohm
print "Therefore, R_L >= 29 / g_m = %0.2f kohm"%rl
print " R_L = R_D*r_d / R_D+r_d"
rd=(40)/4.8823
print " Therefore, R_D = %0.2f k-ohm"%rd
print "While for minimum value of R_L = 5.8 k-ohm"
print " R_D = 6.78 k-ohm"
from __future__ import division
from math import sqrt,pi
print "The circuit is Wien bridge oscillator using op-amp. The gain of the op-amp is"
a=1+3
print "A = 1 + R3/R4 =%0.2f"%a
print "So A > 3"
print "This satisfies the required oscillating condition. The feedback is given to non-inverting terminal ensuring the zero phase shift. Hence the circuit will work as the oscillator."
f=1/(2*pi*5.1*0.001)
print "f = 1 / 2*pi*R*C = %0.2f kHz"%f
print "This will be the frequency of oscillations"
from __future__ import division
from math import sqrt,pi
print "The frequency of the oscillator is given by,"
print " f = 1 / 2*pi*sqrt(R1*R2*C1*C2)"
print "For f = 10 kHz,"
r2=(1/(4*(pi**2)*(100*10**6)*(10*10**3)*(0.001*10**-12))) # in k-ohm
print "Therefore, R2 = %0.2f kohm"%r2
print "For f = 50 kHz,"
r2=(1/(4*(pi**2)*(2500*10**6)*(10*10**3)*(0.001*10**-12))) # in k-ohm
print "Therefore, R2 = %0.2f k-ohm"%r2
print "So minimum value of R2 is 1.013 k-ohm while the maximum value of R2 is 25.33 k-ohm"
from math import sqrt,pi
from __future__ import division
print "The frequency is given by,"
print " f = 1 / 2*pi*sqrt(C*L_eq)"
leq=(2*10**-3)+(20*10**-6)
print "where L_eq = L1 + L2 =%0.2f kHz"%leq
print "For f = f_max = 2050 kHz"
c=(1/(4*(pi**2)*((2050*10**3)**2)*0.00202))*10**12 # in pF
print "Therefore, C = %0.2f pF"%c
print "For f = f_min = 950 kHz"
c=(1/(4*(pi**2)*((950*10**3)**2)*0.00202))*10**12 # in pF
print "Therefore, C = %0.2f pF"%c
print "Hence C must be varied from 2.98 pF to 13.89 pF, to get the required frequency variation."
from math import sqrt,pi
from __future__ import division
print "The given values are,"
print "L1 = 0.5 mH, L2 = 1 mH, C = 0.2 uF"
print "Now f = 1 / 2*pi*sqrt(C*L_eq)"
leq=0.5+1 # in mH
print "and L_eq = L1 + L2 =%0.2f mH"%leq
f=(1/(2*pi*sqrt(1.5*0.2*10**-9)))*10**-3 # in kHz
format(5)
print "Therefore, f =%0.2f kHz"%f
from math import sqrt,pi
from __future__ import division
print "L1 = 20 uH, L2 = 2 mH"
leq=(20*10**-6)+(2*10**-3)
print "Therefore, L_eq = L1 + L2 =%0.2f H"%leq
print "For f = f_max = 2.5 MHz"
print "f = 1 / 2*pi*sqrt(C*L_eq)"
c=(1/(((2*pi*2.5*10**6)**2)*(2.002*10**-3)))*10**12
print "Therefore, C = %0.2f pF"%c
print "For f = f_min = 1 MHz"
c=(1/(((2*pi*1*10**6)**2)*(2.002*10**-3)))*10**12
print "Therefore, C = %0.2f pF"%c
print "This C must be varied from 2.0244 pF to 12.6525 pF"
from math import sqrt,pi
from __future__ import division
print "The equivalent capacitance is given by,"
ceq=(150*1.5*10**-21)/((150*10**-12)+(1.5*10**-9)) # in F
print "C_eq = C1*C2 / C1+C2 =%0.2f F"%ceq
print "Now, f = 1 / 2*pi*sqrt(L*C_eq)"
f=(1/(2*pi*sqrt(50*136.363*10**-18)))*10**-6 # in MHz
print "f = %0.2f MHz"%f
from math import sqrt,pi
from __future__ import division
print "The given values are,"
print " L = 100 uH, C1 = C2 = C and f = 500 kHz"
print "Now, f = 1 / 2*pi*sqrt(L*C_eq)"
ceq=1/(4*(pi**2)*(100*10**-6)*((500*10**3)**2)) # in F
print "Therefore, C_eq = %0.2f F"%ceq
print "but C_eq = C1*C2 / C1+C2 and C1 = C2 = C"
print "Therefore, C_eq = C / 2"
c=1.0132*2
print "Therefore, C = %0.2f nF"%c
from math import sqrt,pi
from __future__ import division
print "Given, C1 = 100 pF, C2 = 50 pF, f = 10 MHz, L = ?"
ceq=(5000*10**-24)/(150*10**-12)
print "C_eq = C1*C2 / C1+C2 = %0.2f F "%ceq
print "f = 1 / 2*pi*sqrt(L*C_eq)"
l=(1/(4*(pi**2)*(33.33*10**-12)*((10*10**6)**2)))*10**6 # in F
print "Therefore, L = %0.2f uH"%l
from math import sqrt,pi
from __future__ import division
print "For a tuned collector oscillator,"
print "f_r = 1 / 2*pi*sqrt(L*C)"
print "where L = 30 uH and f_r to be varied 300 kHz to 1.5 MHz"
print "For f_r = 300 kHz"
c1=(1/(4*(pi**2)*(30*10**-6)*((300*10**3)**2)))*10**9 # in nF
print "Therefore, C1 =%0.2f nF"%c1
print "For f_r = 1.5 MHz"
c2=(1/(4*(pi**2)*(30*10**-6)*((1.5*10**6)**2)))*10**12 # in pF
print "Therefore, C2 = %0.2f pF"%c2
print "Hence C must be varied over 375.264 pF to 9.3816 nF, to achieve frequency variations"
from math import sqrt,pi
from __future__ import division
fs=(1/(2*pi*sqrt(0.4*0.085*10**-12)))*10**-6 # in MHz
print "(i) f_s(in MHz) = 1 / 2*pi*sqrt(L*C) =%0.2f MHz"%fs
ceq=0.085/1.085 # in pF
print "(ii) C_eq = C*C_M / C+C_M =%0.2f pF"%ceq
fp=(1/(2*pi*sqrt(0.4*0.078*10**-12)))*10**-6 # in MHz (the answer in textbook is wrong)
print "Therefore, f_p = 1 / 2*pi*sqrt(L*C_eq) =%0.2f MHz"%fp
inc=((0.899-0.856)/0.856)*100 # in percentage
print "(iii) %% increase =%0.2f"%inc
q=(2*pi*0.4*0.856*10**6)/(5*10**3)
print "(iv) Q = omega_s*L / R = 2*pi*f_s*L / R =%0.2f"%q
from math import sqrt,pi
from __future__ import division
print " C_M = 2 pF"
fs=(1/(2*pi*sqrt(2*0.01*10**-12)))*10**-6 # in MHz
print "Now f_s = 1 / 2*pi*sqrt(L*C) =%0.2f MHz"%fs
ceq=(2*0.01*10**-24)/(2.01*10**-12) # in F
print " C_eq = C_M*C / C_M+C =%0.2f F"%ceq
fp=(1/(2*pi*sqrt(2*9.95*10**-15)))*10**-6 # in MHz
print " f_p = 1 / 2*pi*sqrt(L*C_eq) =%0.2f"%fp
print "So f_s and f_p values are almost same."
from math import sqrt,pi
from __future__ import division
print "R = 6 k-ohm, C = 1500 pF, R_C = 18 k-ohm"
k=18/6
print "Now K = R_C / R =%0.2f"%k
print "Therefore, f = 1 / 2*pi*R*C*sqrt(6+4K)"
f=(1/(2*pi*(6*10**3)*(1500*10**-12)*sqrt(6+12)))*10**-3 # in kHZ
print " f = %0.2f kHz"%f
hfe=(4*3)+23+(29/3)
print " (h_fe)min = 4K + 23 + 29/K =%0.2f"%hfe
from sympy import symbols,solve
from math import sqrt,pi
from __future__ import division
print "Refering to equation(1) of section 4.5.3, the input impedance is given by,"
print "R''_i = R1 || R2 || h_ie"
print "Now R1 = 25 k-ohm, R2 = 47 k-ohm, and h_ie = 2 k-ohm"
ri=(25*47*2)/((47*2)+(25*2)+(25*47)) # in k-ohm
print "Therefore, R''_i = %0.2f kohm"%ri
print " K = R_C / R"
print "Now R_C = 10 k-ohm ...given"
print "Now f = 1 / 2*pi*R*C*sqrt(6+4K)"
print "Therefore, R*sqrt(6+4K) = 31830.989"
print "Now K = R_C / R = 10*10**3 / R"
print "Therefore, R*sqrt(6+(40*10*10**3/R)) = 31830.989"
print "Therefore, R**2*(6+(40*10*10**3/R)) = (31830.989)**2"
R=symbols('R')
p1=6*R**2+(40*10**3)*R-(31830.989)**2
t1=solve(p1,R)[1]
ans1=t1
print "Therefore, R = %0.2f kohm Neglecting negative value"%((-ans1)*10**-3)
k=10/16.74
print "Therefore, K = R_C / R =%0.2f"%k
print "Therefore, h_fe >= 4K + 23 + 29/K"
hfe=(4*0.5973)+23+(29/0.5973)
print " h_fe >=%0.2f"%hfe
from math import sqrt,pi
from __future__ import division
ceq=((0.02*12*10**-24)/(12.02*10**-12))*10**12 # in pF
print " C_eq = C1*C2 / C1+C2 =%0.2f pF"%ceq
fs=(1/(2*pi*sqrt(50*0.02*10**-15)))*10**-6 # in MHz
print "Therefore, f_s(in MHz) = 1 / 2*pi*sqrt(L*C1) =%0.2f MHz"%fs
fp=(1/(2*pi*sqrt(50*0.01996*10**-15)))*10**-6 # in MHz
print "Therefore, f_p = 1 / 2*pi*sqrt(L*C_eq) =%0.2f MHz"%fp
print "Let C_s = 5 pF connected across the crystal"
c2=12+5
print "Therefore, C''2 = C2 + C_x =%0.2f pF"%c2
ceq1=0.019976
print "Therefore, C''_eq = C1*C''2 / C1+C''2 =%0.2f pF"%ceq1
fp1=5.03588
print "Therefore, f''_p = 1 / 2*pi*sqrt(L*C_eq) =%0.2f MHz"%fp1
print "New C_x = 6 pF is connected then,"
c21=12+6
print " C''''2 = C2 + C_x =%0.2f pF"%c21
ceq2=0.0199778
print "Therefore, C''''_eq = C1*C''''2 / C1+C''''2 = %0.2f pF"%ceq2
fp2=5.035716
print "Therefore, f''''_p = 1 / 2*pi*sqrt(L*C''''_eq) =%0.2f MHz"%fp2
c=(5.03588-5.035716)*10**6
print "Therefore, Change = f''_p - f''''_p =%0.2f Hz"%c
from math import sqrt,pi
from __future__ import division
ri=(22*68*2)/((68*2)+(22*2)+(22*68))
print "R''_i = R1 || R2 || h_fe =%0.2f kohm"%ri #answer in textbook is wrong
print "Now R''_i + R3 = R"
r3=6.8-1.8243
print "Therefore, R3 = R - R''_i =%0.2f kohm"%r3
k=20/6.8
print "K = R_C / R = %0.2f"%k
print "Therefore, f = 1 / 2*pi*RC*sqrt(6+4K)"
c=(1/(2*pi*6.8*50*sqrt(6+(4*2.9411))*10**6))*10**12
print "Therefore, C = %0.2f pF"%c
hfe=(4*2.9411)+23+(29/2.9411)
print "And h_fe >= 4 K + 23 + 29/K >=%0.2f"%hfe
from __future__ import division
print "The frequency of the oscillator is given by,"
print " f = 1 / 2*pi*sqrt(R1*R2*C1*C2)"
print "For f = 20 kHz,"
r2=(1/(4*(pi**2)*((20*10**3)**2)*(10*10**3)*((0.001*10**-6)**2)))*10**-3
print "Therefore, R2 = %0.2f kohm"%r2
print "For f = 70 kHz,"
r2=(1/(4*(pi**2)*((70*10**3)**2)*(10*10**3)*((0.001*10**-6)**2)))*10**-3
print "Therefore, R2 = %0.2f kohm"%r2
print "So minimum value of R2 is 0.517 k-ohm while the maximum value of R2 is 6.33 k-ohm"
from __future__ import division
print "For a Hartley oscillator,"
print " f = 1 / 2*pi*sqrt(L_eq*C) where L_eq = L1 + L2 + 2M"
leq=(1/(4*(pi**2)*((168*10**3)**2)*(50*10**-12)))*10**3 # in mH
print "Therefore, L_eq =%0.2f mH"%leq
l2=((17.95*10**-3)-(15*10**-3)-(5*10**-6))*10**3 # in mH
print "Therefore, L2 = %0.2f mH"%l2
hfe=((15*10**-3)+(5*10**-6))/((2.945*10**-3)+(5*10**-6))
print "Now h_fe = L1+M / L2+M =%0.2f"%hfe
from __future__ import division
print "(i) Assume one perticular coupling direction for which,"
print " L_eq = L1 + L2 + 2M = 0.25 mH"
f=(1/(2*pi*sqrt(0.25*100*10**-15)))*10**-6 # in MHz
print "Therefore, f = 1 / 2*pi*sqrt(L_eq*C) =%0.2f MHz"%f
print "Let the direction of coupling is reversed,"
print " L_eq = L1 + L2 - 2M = 0.15 mH"
fd=(1/(2*pi*sqrt(0.15*100*10**-15)))*10**-6 # in MHz
print "Therefore, f'' = 1 / 2*pi*sqrt(L_eq*C) =%0.2f MHz"%fd
pc=((1.2994-1.00658)/1.00658)*100 # in percentage
print "Therefore, %% change = f''-f/f * 100 = %0.2f "%pc
print "(ii) Let us assume direction of coupling such that,"
print " L_eq = L1 + L2 + 2M = 0.25 mH"
print " C_t = Trim capacitor = 100 pF"
print "Therefore, C_eq = C*C_t / C+C_t = 50 pF"
f1=(1/(2*pi*sqrt(0.25*50*10**-15)))*10**-6 # in MHz
print "Therefore, f = 1 / 2*pi*sqrt(L_eq*C_eq) =%0.2f MHz"%f1
print "If now direction of coupling is reversed,"
print " L_eq = L1 + L2 - 2M = 0.15 mH"
f2=(1/(2*pi*sqrt(0.15*50*10**-15)))*10**-6 # in MHz
print "Therefore, f'' = 1 / 2*pi*sqrt(L_eq*C_eq) =%0.2f MHz"%f2
pc1=((1.83776-1.4235)/1.4235)*100
print "Therefore, %% change = f''-f/f * 100 =%0.2f"%pc1
from sympy import symbols,solve
from __future__ import division
print "For RC phase shhift oscillator,"
print " h_fe = 4K + 23 + 29/K ...given h_fe = 150"
print "Therefore, 150 = 4K + 23 + 29/K"
print "Therefore, 4K**2 - 127K + 29 = 0"
K=symbols('K')
p1=4*K**2-127*K+29
t1=solve(p1,K)[0]
print "Therefore, K =%0.2f"%t1
print " f = 1 / 2*pi*R*C*sqrt(6+4K) ...given f = 5 kHz"
print "Therefore,Choose C = 100 pF"
r=(1/(2*pi*(1000*10**-12)*(5*10**3)*sqrt(6+(4*0.23))))*10**-3 # in k-ohm
print "Therefore, R = %0.2f kohm"%r
print " K = R_C / R i.e. R_C = KR = 2.7 k-ohm"
print "Neglecting effect of biasing resistances assuming them to be large and selecting transistor with h_ie = 2 k-ohm"
print " R''_i = h_ie = 2 k-ohm"
print "Therefore,Last resistance in phase network"
r3=12-2
print " R3 = R - R''_i =%0.2f"%r3
print "Using the back to back connected zener diodes of 9.3 V (Vz) each at the output of emitter follower and using this at the output of the oscillator, the output amplitude can be controlled to 10 V i.e. 20 V peak to peak. The zener diode 9.3V and forward biased diode of 0.7 V gives total 10 V"
print "The designed circuit is shown in fig.2.58"
from __future__ import division
print "(1) f = 1 / 2*pi*sqrt(L*C_eq)"
ceq=(100*500)/600
print "Where C_eq = C1*C2 / C1+C2 = %0.2f pF"%ceq
f=(1/(2*pi*sqrt(40*83.333*10**-15)))*10**-3
print "f = %0.2f kHz"%f
print "(2) The input voltage is not required for the oscillator. The feedback voltage, which is the part of the output voltage is enough to drive the oscillator"
print "V0 = 10 V"
print "For Colpitts oscillator, gain = C2 / C1"
gain=500/100
print "Therefore, Gain =%0.2f"%gain
fv=10/5
print "Therefore, Feedback voltage(in V) = V0 / Gain =%0.2f V"%fv
print "(3) Minimum gain = C2/C1 = 5"
print "h_fe(min) = C2/C1 = 5"
print "(4) Gain = 10 = C2/C1"
c1=500/10
print "Therefore, C1 = %0.2f pF"%c1
print "(5) For C1 = 50 pF and C2 = 500 pF"
ceq=(50*500)/550
print "Where C_eq = C1*C2 / C1+C2 =%0.2f pF"%ceq
f=(1/(2*pi*sqrt(40*45.4545*10**-15)))*10**-3
print "f = 1 / 2*pi*sqrt(L*C_eq) = %0.2f kHz"%f
from __future__ import division
print "The frequency required is, f = 1 MHz and for FET, u = 20"
print "Now u = C2/C1 for oscillations"
print "Therefore, 20 = C2/C1"
print "Therefore, C2 = 20*C1 ....(1)"
print "Let C1 = 0.01 uF hence C2 = 0.2 uF"
ceq=((0.01*0.2)/(0.21))*10**3
print "Therefore, C_eq = C1*C2 / C1+C2 =%0.2f nF"%ceq
print "Now f = 1 / 2*pi*sqrt(L*C_eq)"
l=(1/(((2*pi*1*10**6)**2)*(9.5238*10**-9)))*10**6
print "Therefore, L( = %0.2f uH"%l
print "The baising resistances can be selected as,"
print "R1 = 12 M-ohm and R2 = 8 M-ohm"
print "These resistances must be large"
print "The designed circuit is shown in the fig 2.59"
from __future__ import division
leq=500+5000+600
print "L_eq = L1 + L2 + 2M =%0.2f uH"%leq
f=(1/(2*pi*sqrt(150*6100*10**-18)))*10**-3
print "f = 1 / 2*pi*sqrt(C*L_eq) =%0.2f kHz"%f
from __future__ import division
print "L_s = 0.8 H, C_s = 0.08 pF, R_s = 5 k-ohm, C_M = 1 pF"
fs=(1/(2*pi*sqrt(0.8*0.08*10**-12)))*10**-3
print "f_s = 1 / 2*pi*sqrt(C_s*L_s) =%0.2f kHz"%fs
ceq=(0.08*10**-12)/1.08
print "C_eq = C_M*C_s / C_M+C_s =%0.2f F"%ceq
fp=(1/(2*pi*sqrt(0.8*7.4074*10**-14)))*10**-3
print "Therefore, f_p = 1 / 2*pi*sqrt(C*L_eq) =%0.2f kHz"%fp
from __future__ import division
print "The series and parallel resonating frequencies are,"
print "f_s = 1 / 2*pi*sqrt(C*L) while f_p = 1 / 2*pi*sqrt(L*C_eq)"
print "f_p/f_s = 1/2*pi*sqrt(L*C_eq) * 2*pi*sqrt(LC) = sqrt(c/C_eq) but C_eq = C*C_M/C+C_M"
fp=sqrt(1+(0.04/2))
print "f_p/f_s = sqrt(C/(C*C_M/C+C_M)) = sqrt(C*(C+C_M)/C*C_M) = sqrt(1+(C/C_M)) =%0.2f"%fp
print "f_p = 1.00995*f_s"
inc=0.00995*100
print "Therefore, %% increase = (1.00995*f_s-f_s / f_s)*100 =%0.2f"%inc,
from __future__ import division
print "C = 20 pF, L2 = 1000 uH, L1 = 100 uH, M = 20 uH"
leq=100+1000+40
print "Therefore, L_eq = L1 + L2 + 2M =%0.2f uH"%leq
f=(1/(2*pi*sqrt(1140*20*10**-18)))*10**-6
print "Therefore, f = 1 / 2*pi*sqrt(L_eq*C) =%0.2f MHz"%f
print "The feedback fraction beta is given by,"
b=100/1100
print "beta = V_f/V0 = X_L1 / X_L1+X_L2 = L1 / L1+L2 =%0.2f"%b
print "It is a Hartley oscillator"
from __future__ import division
print "Using the expression of the frequency,"
print "f = 1 / 2*pi*RC*sqrt(6)"
c=(1/(2*pi*10*sqrt(6)*10**6))*10**9
print "Therefore, C = %0.2f nF"%c
print "For FET phase shift oscillator,"
print "|A| = g_m*R_L and |A| >= 29"
rl=(29/5000)*10**3
print "Therefore, g_m*R_L >= 29 i.e. R_L(in k-ohm) >=%0.2f"%rl
print "With R_L = 5.8 k-ohm,"
print "R_L = R_D*r_d / R_D+r_d"
rd=40/5.8965
format(7)
print "Therefore, R_D =%0.2f kohm"%rd
from __future__ import division
print "The name of the oscillator is Pierce oscillator"
print "C1 = 1000 pF, C2 = 100 pF, f_s = 1 MHz"
ceq=(1000*100*10**-12)/1100
print "C_eq = C1*C2 / C1+C2 =%0.2f F"%ceq
print "At resonance, X_L = X_Ceq i.e. 2*pi*f*L = 1 / 2*pi*f*C_eq"
l=(1/(((2*pi*10**6)**2)*(90.909*10**-12)))*10**6
print "Therefore, L = 1/(2*pi*f)**2*C_eq = %0.2f uH"%l
print "The fig 2.61(a) shows the electrical equivalent of the crystal"
print "At series resonance,"
print "X_L = X_C for crystal"
print "Therefore, C = 90.909 pF for crystal"
print "The mounting capacitance is about 1 to 2 pF"
from __future__ import division
print "f = 2 kHz"
print "f = 1/ 2*pi*R*c*sqrt(6) ...For phase shift oscillator"
print "Choose C = 1 nF"
r=(1/(2*pi*2*sqrt(6)*10**-6))*10**-3
print "Therefore, r = %0.2f kohm"%r
print "Select FET with g_m = 5000 us and r_d = 50 k-ohm"
print "For phase shift oscillator, |A| >= 29 and |A| = g_m*R_L"
print "Therefore, g_m*R_L >= 29"
rl=(29/(5000*10**-6))*10**-3
print "i.e. R_L(in k-ohm) >= 29/g_m >=%0.2f"%rl
print "Select R_L = 6.8 k-ohm"
print "But R_L = R_D*r_d / R_D+r_d"
rd=7.87
print "Therefore, R_D = %0.2f kohm"%rd