from __future__ import division
gm=(1/26)*10**3
print "(i) g_m = I_C / V_T =%0.2f mA/V"%gm
rbe=200/(38.46)
print "(ii) r_b''e = h_fe / g_m =%0.2f kohm"%rbe
cc=((38.46*10**-3)/(500*10**6))*10**12
print "(iii) (C_e + C_C) = g_m / 2*pi*f_T = g_m / omega_T =%0.2f pF"%-cc
cbe=76.92-3
print "Therefore, C_b''e = C_e =%0.2f pF"%cbe
print "(iv) We know that,"
print "f_T = h_fe*f_beta"
print "Therefore, 2*pi*f_T = h_fe*2*pi*f_beta"
print "omega_T = h_fe*omega_beta"
ob=((500*10**6)/200)*10**-3
print "omega_beta = omega_T / h_fe =%0.2f rad/s"%ob
from math import sqrt
from __future__ import division
ft=25*2
print "(i) f_T = |A_i|*f =%0.2f MHz"%ft
hfe=50000/200
print "(ii) h_fe(in kHz) = f_T / f_beta =%0.2f kHz"%hfe
print "(iii) |A_i| = h_fe / sqrt(1+((f/f_beta)**2)) :"
print "At f = 10 MHz"
ai=250/sqrt(1+(((10*10**6)/(200*10**3))**2))
print "|A_i| =%0.2f"%ai
print "At f = 100 MHz"
ai=250/sqrt(1+(((100*10**6)/(200*10**3))**2))
print "|A_i| =%0.2f"%ai
from math import sqrt,pi
from __future__ import division
print "a) The 3dB frequency for circuit gain and voltage gain is given as,"
print "(f_H)=1/(2*pi*R_eq*C_eq)"
r=(200*1000)/(200+1000)
print "where R_eq =(R_s+r_bb'')parallel to r+b''e =%0.2f ohm"%r
c=(100*10**-12)+((1+50)*3*10**-12)
print "and C_eq =(C_b''e)+(1+(g_m*R_L)*C_b''c)= %0.2f F"%c
f=1/((2*pi*166.67*253*10**-12))
print "f_H = %0.2f Hz"%f
print "b)Voltage gain is given as,"
a=(-50*1)
print "A=(-g_m*R_L)=%0.2f"%a
from __future__ import division
print "f_H=1/(2*pi*R_eq*C_eq)"
print "and f_H''=2(f_H)"
print "1/(2*pi*R_eq*C_eq) = 2/(2*pi*R_eq*C_eq)"
print "R_eq'' = R_eq/2"
print "R_eq=(r_b''e)parallel to (r_bb''+R_s)"
print "= (r_b''e)=1000 ohm"
print "Therefore R_eq'' =500 ohm"
print "Therefore 500=((r_b''e)*(r_bb''+R_s))/((r_b''e)+(r_bb'')+R_s)"
print " = 1000(100+R_s)/(1000+100+R_s)"
r=(4.5*10**5)/500
print "R_s = %0.2f ohm"%r
from math import sqrt,pi
from __future__ import division
print "Hybrid-pi Equivalent is as shown in fig.4.29"
print "(i) Mid frequency voltage gain :"
print "V_o / V_s = -h_fe*R_L / R_s+h_ie"
hie=(100+1000)*10**-3
print "h_ie = r_bb'' + r_b''e =%0.2f kohm"%hie
hfe=0.2*1000
print "h_fe = g_m * r_b''e =%0.2f"%hfe
vo=-200/2
print "Therefore, V_o / V_s =%0.2f"%vo
fb=(1/(2*pi*1000*(204*10**-12)))*10**-3
print "(ii) f_beta = 1 / 2*pi*r_b''e*(C_e+C_C) =%0.2f kHz"%fb
print "f_beta = %0.2f kHz"%fb
ft=(200*780)*10**-3
print "(iii) f_T = h_fe * f_beta =%0.2f kHz"%ft
from math import sqrt,pi
from __future__ import division
print "(i) We know that,"
print " f_H = 1 / 2*pi*R_eq*C_eq"
print "where R_eq = (R_s+r_bb'')*r_b''e / R_s+r_bb''+r_b''e"
print "and C_eq = C_e + C_C*[1+g_m*R_L]"
rbe=100/100
print " r_b''e(in k-ohm) = h_fo / g_m = %0.2f kohm"%rbe
print "C_eq = C_e + C_C*[1+g_m*R_L] = C_e + C_C[1+100*10**-3*500]"
print " = C_e + 51 pF"
ce=((100*10**-3)/(2*pi*(400*10**6)))*10**12
print "C_e = g_m / 2*pi*f_T =%0.2f pF"%ce
ceq=39.79+51
print "Therefore, C_eq =%0.2f pF"%ceq
req=1/(2*pi*5*90.79*10**-6)
print "R_eq = 1 / 2*pi*f_H*C_eq =%0.2f ohm"%req
print "Therefore, 350.6 = (R_s+100)*1000 / R_s+1100"
rs=(285.66*10**3)/649.4
print "Therefore, R_s = %0.2f ohm"%rs
print "(ii) The mid-band voltage gain V_o/V_s is given as"
print " V_o/V_s = -h_fe*R_L / R_s+h_ie"
hie=(100+1000)*10**-3
print "where h_ie = r_bb'' + r_b''e =%0.2f K"%hie
vo=(-100*500)/(439.88+1100)
print "Therefore, V_o/V_s =%0.2f"%vo
from math import sqrt,pi
from __future__ import division
print "Assume that the output time-constant is negligible as compared to the time consedtant. When this is the case"
print "A_vs = V_o/V_s = -g_m*R''_L*G''_s / G''_s+g_b''e+sC"
gs=6.66*10**-3
print "where G''_s = 1 / (R_s||R_b)+r_bb'' =%0.2f"%gs
gbe=1/1000
print "g_b''e = 1 / r_b''e =%0.2f"%gbe
rl=(0.5/1.5)*10**3
print "R''_L = R_L || R_C =%0.2f ohm"%rl
print " sC = admittance of C"
c=100+(3*(1+(50*333.33*10**-3)))
print "where C = C_e + C_C*(1+g_m*R''_L) =%0.2f"%c
print "At 10 kHz,"
sc=2*pi*10*153*10**-9
print "sC = 2*pi*f*C =%0.2f"%sc
print "Therefore, At 10kHz signal frequency"
avs=(-50*333.33*6.66*10**-6)/((6.66*10**-3)+(10**-3)+(9.613*10**-6))
print "A_vs = V_o / V_s =%0.2f"%avs