import math
v_d = 10**7*10**-2 #drift velocity(in m/s)
L = 2.*10**-6 #drift length(in m)
#calculations
f = v_d/(2*L) #in Hz
#---output---#
print 'Operating Frequency (in GHz) =',round(f/10**9,4)
import math
f=10*10**9 #in Hz
L=75*10**-6 #Device length (in m)
V=25. #Voltage pulse amplified (in volts)
#calculations
E_th=V/L
#---output---#
print 'Threshold Electric field (in kV/cm) =',round(E_th,4)
import math
f_s = 2*10**9 #in Hz
f_p = 12*10**9 #in Hz
R_i = 16
R_s = 1000
#calculations
A_p = 10*math.log((f_p-f_s)/f_s)
A_p_usb = 10*math.log((f_p+f_s)/f_s)
#---output---#
print 'Power gain (in dB) =',round(math.log(10),4)
print 'Power gain as USB converter (in dB) =',round(A_p_usb,4)
import math
E_s = 12.5
E_o = 8.85*10**-12
N = 3.2*10**22 #per cubic meter
L = 8*10**-6 #in m
q = 1.6*10**-19 #in coulombs
#calculations
E = E_o*E_s
V_c = q*N*L**2/(2*E)
V_bd = 2*V_c
E_bd = V_bd/L
#---output---#
print 'Critical voltage(in kV) =',round(V_c/10**3,4)
print 'Breakdown Voltage (in kV) =',round(V_bd/10**3,4)
print 'Breakdown Electric field (in V/cm) =',round(E_bd,4)
import math
N_a = 2.5*10**16 #per cubic cm
J = 33 #in kA/cm**2
q = 1.6*10**-19
#calculations
V_z = J/(q*N_a) #Avalanche zone velocity (in cm/s)
#---output---#
print 'Avalanche zone velocity (in cm/s) =',round(V_z,4)
import math
R_neg = 25 #in ohm
R_load = 50. #in ohm
#calculations
G=((- abs(R_neg)-R_load)/(- abs(R_neg)+R_load))**2
#---output---#
print 'Power gain =',round(G,4)
import math
volt_grad = 3.3*10**3 #voltage gradient
L = 5*10**-4 #in drift length
#calculations
V_min = volt_grad*L #in volts
#---output---#
print 'Minimum voltage needed (in Volts) =',round(V_min,4)
import math
v_d = 2.*10**7 #in cm/s
L = 20.*10**-4 #in cm
#calculations
f = v_d/L
critical_field = 3.3*10**3
V = L*critical_field
#---output---#
print 'Natural frequency (in GHz) =',round(f*10**-9,4)
print 'Critical voltage (in volts) =',round(V,4)