Properties of Rectangular Waveguide

Introduction

This example demonstrates how to use scikit-rf to calculate some properties of rectangular waveguide. For more information regarding the theoretical basis for these calculations, see the References.

Object Creation

This first section imports necessary modules and creates several RectangularWaveguide objects for some standard waveguide bands.

[1]:
%matplotlib inline
import skrf as rf
rf.stylely()

# imports
from scipy.constants import mil,c
from skrf.media import RectangularWaveguide, Freespace
from skrf.frequency import Frequency

import matplotlib.pyplot as plt
import numpy as np

# plot formatting
plt.rcParams['lines.linewidth'] = 2
[2]:
# create frequency objects for standard bands
f_wr5p1  = Frequency(140,220,1001, 'GHz')
f_wr3p4  = Frequency(220,330,1001, 'GHz')
f_wr2p2 = Frequency(330,500,1001, 'GHz')
f_wr1p5 = Frequency(500,750,1001, 'GHz')
f_wr1   = Frequency(750,1100,1001, 'GHz')

# create rectangular waveguide objects
wr5p1 = RectangularWaveguide(f_wr5p1.copy(), a=51*mil, b=25.5*mil, rho = 'au')
wr3p4 = RectangularWaveguide(f_wr3p4.copy(), a=34*mil, b=17*mil, rho = 'au')
wr2p2 = RectangularWaveguide(f_wr2p2.copy(), a=22*mil, b=11*mil, rho = 'au')
wr1p5 = RectangularWaveguide(f_wr1p5.copy(), a=15*mil, b=7.5*mil, rho = 'au')
wr1   = RectangularWaveguide(f_wr1.copy(), a=10*mil, b=5*mil, rho = 'au')

# add names to waveguide objects for use in plot legends
wr5p1.name = 'WR-5.1'
wr3p4.name = 'WR-3.4'
wr2p2.name = 'WR-2.2'
wr1p5.name = 'WR-1.5'
wr1.name = 'WR-1.0'

# create a list to iterate through
wg_list = [wr5p1, wr3p4,wr2p2,wr1p5,wr1]

# creat a freespace object too
freespace = Freespace(Frequency(125,1100, 1001, 'GHz'))
freespace.name = 'Free Space'

Conductor Loss

[3]:
fig, ax = plt.subplots()

for wg in wg_list:
    wg.frequency.plot(rf.np_2_db(wg.alpha), label=wg.name)

ax.legend()
ax.set_xlabel('Frequency(GHz)')
ax.set_ylabel('Loss (dB/m)')
ax.set_title('Loss in Rectangular Waveguide (Au)');
../../_images/examples_networktheory_Properties_of_Rectangular_Waveguides_8_0.png
[4]:
fig, ax = plt.subplots()
resistivity_list = np.linspace(1,10,5)*1e-8 # ohm meter
for rho in resistivity_list:
    wg = RectangularWaveguide(f_wr1.copy(), a=10*mil, b=5*mil,
                              rho = rho)
    wg.frequency.plot(rf.np_2_db(wg.alpha),label=r'$ \rho $=%.e$ \Omega m$'%rho )

ax.legend()
ax.set_xlabel('Frequency(GHz)')
ax.set_ylabel('Loss (dB/m)')
ax.set_title('Loss vs. Resistivity in\nWR-1.0 Rectangular Waveguide');
../../_images/examples_networktheory_Properties_of_Rectangular_Waveguides_9_0.png

Phase and Group Velocity

[5]:
fig, ax = plt.subplots()
for wg in wg_list:
    wg.frequency.plot(100*wg.v_p.real/c, label=wg.name )

ax.legend()
ax.set_ylim(50,200)
ax.set_xlabel('Frequency(GHz)')
ax.set_ylabel('Phase Velocity (\%c)')
ax.set_title('Phase Velocity in Rectangular Waveguide');
../../_images/examples_networktheory_Properties_of_Rectangular_Waveguides_11_0.png
[6]:
fig, ax = plt.subplots()
for wg in wg_list:
    plt.plot(wg.frequency.f_scaled[1:],
             100/c*np.diff(wg.frequency.w)/np.diff(wg.beta),
             label=wg.name )

ax.legend()
ax.set_ylim(50,100)
ax.set_xlabel('Frequency(GHz)')
ax.set_ylabel('Group Velocity (\%c)')
ax.set_title('Group Velocity in Rectangular Waveguide');
../../_images/examples_networktheory_Properties_of_Rectangular_Waveguides_12_0.png

Propagation Constant

[7]:
fig, ax = plt.subplots()
for wg in wg_list+[freespace]:
    wg.frequency.plot(wg.beta,   label=wg.name )

ax.legend()
ax.set_xlabel('Frequency(GHz)')
ax.set_ylabel('Propagation Constant (rad/m)')
ax.set_title('Propagation Constant \nin Rectangular Waveguide');
ax.semilogy();
../../_images/examples_networktheory_Properties_of_Rectangular_Waveguides_14_0.png

References