1
1
Waveguide
2
2
=========
3
3
4
- * Calculate the properties of rectangular waveguides*
4
+ * Calculate the various properties of rectangular waveguides*
5
5
6
- Example: Simple Waveguide
7
- -------------------------
6
+ For example:
7
+ - Cutoff frequency
8
+ - Phase constant
9
+ - Attenuation constant due to conductor and/or dielectric loss
10
+
11
+ Example 1: Properties of a WR-90 Waveguide
12
+ ------------------------------------------
8
13
9
14
WR-90 waveguide:
10
15
``` python
11
16
import numpy as np
12
17
import scipy.constants as sc
13
18
import matplotlib.pyplot as plt
14
- import waveguide as wg
19
+ from waveguide import phase_constant, attenuation_constant
15
20
16
- # WR-90
17
- a, b = 0.9 * sc.inch, 0.45 * sc.inch
21
+ # WR-90 waveguide dimensions
22
+ a, b = 0.9 * sc.inch, 0.45 * sc.inch
18
23
19
- # Conductivity, S/m
24
+ # Conductivity of waveguide walls , S/m
20
25
cond = 2e7
21
26
22
27
# Frequency sweep
@@ -25,7 +30,7 @@ freq = np.linspace(7, 13, 100) * sc.giga
25
30
26
31
Phase constant:
27
32
``` python
28
- beta = wg. phase_constant(freq, a, b, cond = cond)
33
+ beta = phase_constant(freq, a, b, cond = cond)
29
34
30
35
plt.figure()
31
36
plt.plot(freq/ 1e9 , beta)
@@ -34,36 +39,81 @@ plt.xlabel("Frequency (GHz)")
34
39
plt.xlim([7 , 13 ])
35
40
```
36
41
42
+ <p align =" center " >
37
43
<img src =" https://raw.githubusercontent.com/garrettj403/Waveguide/main/examples/results/simple-waveguide-phase-constant.png " width =" 500 " >
44
+ </p >
38
45
39
46
Attenuation constant:
40
47
``` python
41
- alpha = wg. attenuation_constant(freq, a, b, cond = cond)
48
+ alpha = attenuation_constant(freq, a, b, cond = cond)
42
49
43
50
plt.figure()
44
51
plt.plot(freq/ 1e9 , alpha)
45
- plt.ylabel(r " Attenuation constant, $ \b eta $ ( Np/m) " )
52
+ plt.ylabel(r " Attenuation constant, $ \a lpha $ ( Np/m) " )
46
53
plt.xlabel(" Frequency (GHz)" )
47
54
plt.xlim([7 , 13 ])
48
55
```
49
56
57
+ <p align =" center " >
50
58
<img src =" https://raw.githubusercontent.com/garrettj403/Waveguide/main/examples/results/simple-waveguide-attenuation-constant.png " width =" 500 " >
59
+ </p >
60
+
61
+ Example 2: Cutoff Frequencies
62
+ -----------------------------
63
+
64
+ ``` python
65
+ import numpy as np
66
+ import scipy.constants as sc
67
+ from waveguide import cutoff_frequency
68
+
69
+ # Waveguide sizes to analyze (EIA designations)
70
+ wr_sizes = np.array([28 , 22.4 , 18.8 , 14.8 , 12.2 , 10 , 6.5 , 5.1 , 4.3 , 3.4 , 2.8 ])
71
+
72
+ # Calculate cutoff frequencies
73
+ f_center = np.empty_like(wr_sizes)
74
+ f1 = np.empty_like(wr_sizes)
75
+ f2 = np.empty_like(wr_sizes)
76
+ for i, _wr in np.ndenumerate(wr_sizes):
77
+ a = _wr * 10 * sc.mil # waveguide width
78
+ f1[i] = cutoff_frequency(a, a/ 2 , m = 1 , n = 0 ) * 1.25 # TE10
79
+ f2[i] = cutoff_frequency(a, a/ 2 , m = 2 , n = 0 ) * 0.95 # TE20
80
+ f_center[i] = (f1[i] + f2[i]) / 2
81
+
82
+ # Plot
83
+ fig, ax = plt.subplots(figsize = (12 ,12 ))
84
+ ax.loglog(wr_sizes, f_center/ 1e9 , ' ko' )
85
+ 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 )
86
+ ax.set_xlabel(" \n EIA waveguide designation (\" WR-\" )" )
87
+ ax.set_ylabel(" Frequency range (GHz)" )
88
+ ax.set_ylim([20 , 500 ])
89
+ ax.grid(which = ' both' )
90
+ plt.yticks(ticks = [20 , 30 , 40 , 50 , 60 , 70 , 80 , 90 , 100 , 200 , 300 , 400 , 500 ],
91
+ labels = [20 , 30 , 40 , 50 , 60 , 70 , 80 , 90 , 100 , 200 , 300 , 400 , 500 ])
92
+ ax.set_xticks(ticks = wr_sizes, minor = False )
93
+ ax.set_xticks(ticks = [], minor = True )
94
+ plt.xticks(ticks = wr_sizes, labels = wr_sizes, rotation = 90 )
95
+
96
+ ```
97
+
98
+ <p align =" center " >
99
+ <img src =" https://raw.githubusercontent.com/garrettj403/Waveguide/main/examples/results/waveguide-loss-cutoff-frequency.png " width =" 500 " >
100
+ </p >
51
101
52
- Example: Alumina-Filled Waveguide
53
- ---------------------------------
102
+ Example 3 : Alumina-Filled WR-28 Waveguide
103
+ -----------------------------------------
54
104
55
- WR-28 waveguide filled with 1 inch alumina slug
105
+ WR-28 waveguide filled with 1 inch long alumina slug:
56
106
``` python
57
107
import numpy as np
58
108
import scipy.constants as sc
59
109
import matplotlib.pyplot as plt
60
110
61
111
import waveguide as wg
62
112
63
- # WR-28
64
- a, b = 0.28 * sc.inch, 0.14 * sc.inch
113
+ # WR-28 waveguide dimensions
114
+ a, b = 0.28 * sc.inch, 0.14 * sc.inch
65
115
66
- # Conductivity
116
+ # Conductivity of waveguide walls, S/m
67
117
cond = 1.8e7
68
118
69
119
# Frequency sweep
@@ -72,7 +122,7 @@ freq = np.linspace(22, 42, 401) * sc.giga
72
122
# Relativity permittivity
73
123
er = 9.3
74
124
75
- # Alumina length
125
+ # Alumina length, m
76
126
length = 1 * sc.inch
77
127
78
128
# Section lengths
@@ -91,4 +141,6 @@ plt.xlabel("Frequency (GHz)")
91
141
plt.xlim([22 , 42 ])
92
142
```
93
143
144
+ <p align =" center " >
94
145
<img src =" https://raw.githubusercontent.com/garrettj403/Waveguide/main/examples/results/alumina-filled-waveguide-sparam.png " width =" 500 " >
146
+ </p >
0 commit comments