import math
from math import pi
f=5*10**6
c=100*10**-12 #tuning capacitance in F
Q=150.0 #Q−factor of the ckt
Rl=5*10**3 #load resistance in ohm
Rc=40*10**3 #o/p reistance of transistor
Ic=500*10**-6 #transister collector current in A
C=0.6*10**-12 #collector to base capacitance in F
Vt=26*10**-3 #thermal voltage in V
#transe conductance is given as
gm=Ic/Vt
RD2=Q/(2*pi*f*c)
#At resonance the output admittance is purely conductive and is given as
Yo=(1/Rc)+(1/RD2)+(1/Rl)
#The voltage gain is given as
Av=-(gm/Yo)
Av=round(Av,2)
print 'The voltage gain is',Av
#The Millar capacitance is given as
Cm=(1-Av)*C*10**12
Cm=round(Cm,2)
print 'The Millar capacitance is',Cm,'pF'
from math import pi
f=5*10**6 #in Hz
w0=2*pi*f
Q=100.0 #Q−factor of the ckt
L=2*10**-6 #inductance expressed in H
Rs=1000.0 #source resistance in ohm
Ic=500*10**-6 #transister collector current in A
Vt=26*10**-3 #thermal voltage in V
hfe=200.0
C_be=10*10**-12 #in pF
#refer to problem 5.4.1
Av=78.0
Cm=47.0
gm=Ic/Vt
r_be=hfe/gm
#The dynamic resistance of the tuned ckt is
RD1=Q*w0*L #The effective dynamic conductance is
RD1eff_1=(1/Rs)+(1/RD1)+(1/r_be)
RD1_eff=1/RD1eff_1
#Tha effective Q−factor is
Qeff=RD1_eff/(w0*L)
Qeff=round(Qeff,2)
print 'The effective Q−factor is',Qeff
#The voltage gain refered to source is
Avs=RD1_eff*Av/Rs
Avs=round(Avs,2)
print 'The voltage gain is',Avs