Waveguide
Calculate the various properties of rectangular waveguides
For example:
- Cutoff frequency
- Phase constant
- Attenuation constant due to conductor and/or dielectric loss
Example 1: Properties of a WR-90 Waveguide
WR-90 waveguide:
import numpy as np
import scipy.constants as sc
import matplotlib.pyplot as plt
from waveguide import phase_constant, attenuation_constant
# WR-90 waveguide dimensions
a, b = 0.9 * sc.inch, 0.45 * sc.inch
# Conductivity of waveguide walls, S/m
cond = 2e7
# Frequency sweep
freq = np.linspace(7, 13, 100) * sc.giga
Phase constant:
beta = phase_constant(freq, a, b, cond=cond)
plt.figure()
plt.plot(freq/1e9, beta)
plt.ylabel(r"Phase constant, $\beta$ (rad/m)")
plt.xlabel("Frequency (GHz)")
plt.xlim([7, 13])
Attenuation constant:
alpha = attenuation_constant(freq, a, b, cond=cond)
plt.figure()
plt.plot(freq/1e9, alpha)
plt.ylabel(r"Attenuation constant, $\alpha$ (Np/m)")
plt.xlabel("Frequency (GHz)")
plt.xlim([7, 13])
Example 2: Cutoff Frequencies
import numpy as np
import scipy.constants as sc
from waveguide import cutoff_frequency
# Waveguide sizes to analyze (EIA designations)
wr_sizes = np.array([28, 22.4, 18.8, 14.8, 12.2, 10, 6.5, 5.1, 4.3, 3.4, 2.8])
# Calculate cutoff frequencies
f_center = np.empty_like(wr_sizes)
f1 = np.empty_like(wr_sizes)
f2 = np.empty_like(wr_sizes)
for i, _wr in np.ndenumerate(wr_sizes):
a = _wr * 10 * sc.mil # waveguide width
f1[i] = cutoff_frequency(a, a/2, m=1, n=0) * 1.25 # TE10
f2[i] = cutoff_frequency(a, a/2, m=2, n=0) * 0.95 # TE20
f_center[i] = (f1[i] + f2[i]) / 2
# Plot
fig, ax = plt.subplots(figsize=(12,12))
ax.loglog(wr_sizes, f_center/1e9, 'ko')
ax.errorbar(wr_sizes, f_center/1e9, yerr=[(f_center-f1)/1e9, -(f_center-f2)/1e9], c='k', fmt='o', ls='--', capsize=5, capthick=2)
ax.set_xlabel("\nEIA waveguide designation (\"WR-\")")
ax.set_ylabel("Frequency range (GHz)")
ax.set_ylim([20, 500])
ax.grid(which='both')
plt.yticks(ticks=[20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500],
labels=[20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500])
ax.set_xticks(ticks=wr_sizes, minor=False)
ax.set_xticks(ticks=[], minor=True)
plt.xticks(ticks=wr_sizes, labels=wr_sizes, rotation=90)
Example 3: Alumina-Filled WR-28 Waveguide
WR-28 waveguide filled with 1 inch long alumina slug:
import numpy as np
import scipy.constants as sc
import matplotlib.pyplot as plt
import waveguide as wg
# WR-28 waveguide dimensions
a, b = 0.28 * sc.inch, 0.14 * sc.inch
# Conductivity of waveguide walls, S/m
cond = 1.8e7
# Frequency sweep
freq = np.linspace(22, 42, 401) * sc.giga
# Relativity permittivity
er = 9.3
# Alumina length, m
length = 1 * sc.inch
# Section lengths
total_length = 1.7 * sc.inch
length1 = (total_length - length) / 2
length2 = length
length3 = length1
# S-parameters
_, _, s21, _ = wg.dielectric_sparam(freq, a, b, er, 0, cond, length1, length2, length3)
fig, ax = plt.subplots()
ax.plot(freq/1e9, 20*np.log10(np.abs(s21)))
plt.ylabel(r"$S_{21}$ magnitude (dB)")
plt.xlabel("Frequency (GHz)")
plt.xlim([22, 42])
Metadata
Release files for waveguide 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| waveguide-0.0.3.tar.gz | 3.9 kB | Without provenance | Details for waveguide-0.0.3.tar.gz |
Release files / waveguide-0.0.3.tar.gz
| Download URL | waveguide-0.0.3.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8df98fcc8e77fc4a3ceaae1c517d580f74f1deed8296541472a971f2de10a284
|
|
BLAKE2b-256 checksum How to use checksums |
5faf649c766cecda25dde271de4a6e5f904a9010270e1c0c42a505e16ce49c06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
|
Security for waveguide 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.