import math
from scipy.integrate import quad
#Boltzman consmath.tant k = 1.3806488 × 10-23 m2 kg s-2 K-1
k = 1.3806488 * 10**-23;
#Let room temperature be 27 C
T = 27. + 273;
#Bandwidth BW = 10 MHz
BW = 10. * 10 **6;
#For (a)
#Let the equivalent resismath.tance be Ra
Ra = 10. + 10;
#RMS Noise Voltage be Va
Va = (4*k*T*Ra*BW)**0.5;
print 'The rms voltage at output a is %.3e'%Va,' Volt'
#For (b)
#Let the equivalent resismath.tance be Rb
Rb = (10. * 10)/(10+10);
#RMS Noise Voltage be Vb
Vb = (4*k*T*Rb*BW)**0.5;
print 'The rms voltage at output b is %.3e'%Vb,' Volt'
#For (c)
Rc = 10;
C = 1*10**-9;
#In the textbook, the author has forgotten to multiply the result with T, hence has obtained an erroneous result.
#The given answer is 28.01uV but the correct answer is found out to be 1.2uV
def f0(f):
return Rc/(1 + (2*math.pi*Rc*C*f)**2)
Vc_square = 2*k* quad(f0,-10**7,10**7)[0]
Vc = Vc_square**0.5;
print 'The rms voltage at output c is %.3e'%Vc,' Volt'
#The Antenna noise temperature is T_ant = 10 K
T_ant = 10;
#The reciever noise temperature is Te = 140 K
Te = 140;
#Midband available gain of reciever gao = 10**10
gao = 10**10;
#Noise bandwidth is BN = 1.5 * 10**5 Hz
BN = 1.5 * 10**5;
#Boltzman consmath.tant k = 1.3806488 × 10-23 m2 kg s-2 K-1
k = 1.3806488 * 10**-23;
#Available noise power at output is pao
pao = gao*k*(T_ant + Te)*BN;
print 'The available output noise power is %.3e'%pao,' Watts'
#The dismath.tance d = 30 * 1.6 * 10**3 m;
d = 30 * 1.6 * 10**3;
#Frequency f = 4 * 10**9 Hz
f = 4 * 10**9;
#Wavelength w = c/f m
w = 3.*10**8 / f;
#Transmitter gain KT = 40 dB
KT = 10**4;
#Reciever gain KT = 40 dB
KR = 10**4;
#Reciever power PR = 10**-6 Watt
PR = 10**-6;
#Transmitter power PT
PT = PR*(4*math.pi*d/w)**2/ (KT*KR);
print 'The transmitter output is %.4f'%PT,' Watt'