import math
#Variable declaration
P=10000. #average power (W)
V=1000. #amplitude (V)
#Calculations&Results
W1=4*math.pi*10**6
Wc=2*math.pi*10**8
alpha = P/V**2
print "alpha=%.2f"%alpha
#(b)=
A=1000+2*225+2*150+2*75
peak_power=alpha*A**2
print "A=%.0f V\npeak_power=%.0f W"%(A,peak_power)
#Variable declaration
n=1
q=1.602*10**-19 #C
k=1.38*10**-23
T=290 #K
Is=10**-8 #A
#Calculations&Results
a=q/(n*k*T)
Ib=0 #A
Rj=1/(a*(Ib+Is))
print "(a)Rj=%d kohm"%(Rj*10**-3)
Ib=100*10**-6
Rj=1/(a*(Ib+Is))
print "(b)Rj=%.1f ohm"%Rj
#Variable declaration
fc = 5*10**6 #hz
Vm = 1 #V
fm = 1*10**3 #Hz
#Calculations&Results
#(a)
#Since the i/p frequency is multiplied by 12
fd = 10*12 #Hz
print "Frequency deviation at output = +/-%d KHz"%fd
#(b)
fosc = 55*10**6 #i/p signal from oscillator (Hz)
fs = fosc+fc+fd*10**3
print "\nSum frequency at output = %.2f MHz"%(fs*10**-6)
#(c)
a=1
delf=10*1000
fm=1000
B=a*delf/fm
print "\nFrequency deviation = %d"%B
#(d)
a=2
delf=10*1000
fm=500
B=a*delf/fm
print "\nFrequency deviation = %d "%B
#Variable declaration
IDss=50*10**-3 #mA
gm=200*10**-3 #mS
VL=.25 #V
RL=50 #ohms
#Calculations&Results
Vp=2*VL #V
#gm=-2*IDss/Vp
Vp=2*IDss/gm #V
print "Vp=%.2f V"%Vp
gc=IDss/(2*Vp)
print "gc=%.e S"%gc
Av=gc*RL
print "Av=%.1f"%Av