70cm-RX-TX-Switch-with-Preamp/scripts/calc_pindiode.py

20 lines
449 B
Python
Raw Normal View History

2020-02-02 18:15:46 +01:00
#!/usr/bin/env python3
import math as m
R = 50 # Ω
P = 5 # W
f = 435e6 # Hz
If = 10e-3 # A
tau = 0.4e-6 # s
Irf=m.sqrt(P/R) # RF current
Qreq=Irf/(2*m.pi*f) # Required charge per cycle for RF current
Qs=If*tau # Stored charge in PIN diode
print(f"RF current: {Irf:.3g} A")
print(f"Required charge (Q_r): {Qreq:.3g} As")
print(f"Stored charge (Q_s): {Qs:.3g} As")
print(f"Q_s = {Qs/Qreq:.3g} ⋅ Q_r")