import math
#variable declaration
F = 9*10**9; #Reflex Klystron operating frequency in hz
Va = 300; #beam voltage in volts
I = 20; #Beam current in mA
n = 1; # for 7/4 mode
#Calculations
#transit time for reflector space = n+3/4
I1 = I*10**-3; #beam current in mA
Prfmax =(0.3986*I1*Va)/float(n+3/float(4)); #maximum RF power
#result
print'Maximum R-F power is %3.3f'%(Prfmax),'Watts';
import math
#variable declaration
Vdc = 2.5*10**3; #Beam voltage
Idc = 25*10**-3; #beam current in A;
Zo = 10; #charecteristic impedance
F = 9.5*10**9; #TWT operating frequency in hz
N = 40; #circuit
#Calculations
C = ((Idc*Zo)/float((4*Vdc)))**(1/float(3)); #gain parameter
Ap = (-9.54)+(47.3*N*C); #Output power gain of twt
w = 2*math.pi*F;
vdc = 0.593*10**6*math.sqrt(Vdc);
Be = w/float(vdc);
#result
print'Gain parameter is %3.3g'%C;
print'Output Power gain is %3.3f'%Ap,' dB';
print'phase constant of electron beam is %e'%Be,' rad/m';
import math
#variable declaration
e = 1.609*10**-19; #charge of electron
me = 9.109*10**-31; #mass of electron in kg
B = 0.40; #magnetic flux density
b = 10*10**-2; #Radius of vane edge from the centre
a = 4*10**-2; #radius of cathode
#Calculations
Wc = (e/me)*B; #cyclotron angular frequency in radians
Vc = (e/(8*me))*(B**2)*(b**2)*(1-(a/float(b))**2)**2; #cut-off voltage
#result
print'Cyclotron Angular Frequency is %g'%Wc,'rad';
print'Cut-off voltage is %g'%Vc,'V';
print'Note:Cut-off voltage obtained in textbook is wrongly calculated.Instead of (a/b)**2 ,(a/b) is calculated';
import math
#variable declaration
Va = 900 ; #Accelarating voltage in volts
F = 3.2*10**9; #operating frequency
d = 10**-3;
#Calculations
Ve = (0.593*10**6)*math.sqrt(Va); #electron velocity
w = 2*math.pi*F;
theta = w*(d/float(Ve)); #transit angle in radians
Be = math.sin(theta/float(2))/(theta/float(2)); #Beam Coupling Co-efficient
#result
print'Electron Velocity is %3.3e'%Ve,'m/s';
print'Transit Angle is %g'%theta,'rad';
print'Beam Coupling Co-efficient is %3.3f '%Be;
import math
#variable declaration
I2 = 28*10**-3 ; #induced current in amperes
V2 = 850; #fundamental component of catcher-gap voltage
Vb = 900; #beam voltage
Ib = 26*10**-3; #beam current
Bc = 0.946; #beam coupling coefficient of catcher gap
#Calculations
n = ((Bc*I2*V2)/(2*Ib*Vb))*100; #efficiency of klystron
#result
print'Efficiency of the klystron is %g'%n;
print'Note:In textbook Bc value is taken as 0.946 in calculation';
import math
#variable declaration
Vd = 2.2*10**5; #carrier Drift Velocity in m/s
l = 5*10**-6; #drift region length
#Calculations
F = Vd/float((2*l)); #frequency of IMPATT Diode
#result
print'Frequency of IMPATT Diode is %g'%(F/10**9),' Ghz';
import math
#variable declaration
Vd = 3*10**5; #Carrier Drift Velocity in m/s
l = 7*10**-6; #drift region length
#Calculations
F = Vd/float(2*l); #frequency of IMPATT Diode
#result
print'Frequency of IMPATT Diode is %3.2f'%(F/float(10**9)),' Ghz';
import math
#variable declaration
Na = 1.8*10**15; #Doping Concentration
J = 25*10**3; #current density in A/cm^2
q = 1.6*10**-19; #charge of electron
#Calculations
Vaz = J/float(q*Na); #Avalanche Zone Velocity
#result
print'Avalanche Zone Velocity of TRAPATT is %g'%(Vaz);
print'Note: wrong calculation done in Textbook';
import math
#variable declaration
l = 12*10**-3; #gunn diode oscillator length in m
Vd = 2*10**8; #Drift velocity in gunn diode
#Calculations
F = Vd/float(l); #Frequency of Gunn Diode Oscillator
#result
print'Frequency of Gunn Diode Oscillator is %3.3g'%(F/10**9),' Ghz';
import math
#variable declaration
l = 2.5*10**-6; #Drift length of gunn diode in m
Vd = 2*10**8; #Drift velocity in gun diode
Vgmin = 3.3*10**3; #minimum voltage gradient required to start the diode
#Calculations
Vmin = Vgmin*l;
#result
print'Minimum Voltage required to operate gunn diode is %g'%(Vmin*10**3),' mV';