43 double rectwaveguide::kval ()
54 double rectwaveguide::kc (
int m,
int n)
65 double rectwaveguide::fc (
int m,
int n)
76 double rectwaveguide::alphac ()
80 short m,
n, mmax, nmax;
85 mmax = (int)
floor (
f/fc(1,0));
91 for (n = 0; n<= nmax; n++){
92 for (m = 1; m <= mmax; m++){
98 (1.0 + ((2 *
b/a)*
pow((f_c/
f),2.0)));
101 ac += ((2. * Rs)/(
b *
ZF0 *
sqrt(1.0 -
pow((f_c/
f),2.0)))) *
102 (((1. + (
b/a))*
pow((f_c/
f),2.0)) +
103 ((1. -
pow((f_c/
f),2.0)) * (((
b/a)*(((
b/a)*
pow(m,2.)) +
pow(n,2.)))/
104 (
pow((
b*m/a),2.0) +
pow(n,2.0)))));
112 for (n = 1; n<= nmax; n++) {
113 for (m = 1; m<= mmax; m++) {
116 ac += ((2. * Rs)/(
b *
ZF0 *
sqrt(1.0 -
pow((f_c/
f),2.0)))) *
118 ((
pow((m*
b/a),2.)) +
pow(n,2.0)));
130 double rectwaveguide::alphac_cutoff ()
133 acc =
sqrt(
pow(kc(1,0),2.0) -
pow(kval(),2.0));
141 double rectwaveguide::alphad()
149 ad = (
pow(k,2.0) * tand)/(2.0 * beta);
159 void rectwaveguide::get_rectwaveguide_sub ()
173 void rectwaveguide::get_rectwaveguide_comp ()
183 void rectwaveguide::get_rectwaveguide_elec ()
195 void rectwaveguide::get_rectwaveguide_phys ()
213 get_rectwaveguide_sub();
216 get_rectwaveguide_comp();
219 get_rectwaveguide_phys();
226 lambda_g = (2. *
M_PI)/beta;
228 Z0 = 2.0 *
ZF0 * (
b/a) * 1/
232 lambda_g = (2. *
M_PI)/beta;
233 ang_l = (2.0 *
M_PI * l)/lambda_g;
234 atten_cond = alphac () * l;
235 atten_dielectric = alphad () * l;
236 er_eff = (1.0 -
pow((fc(1,0)/
f),2.0));
242 atten_dielectric = 0.0;
243 atten_cond = alphac_cutoff () * l;
257 double lambda_g, k, beta;
260 get_rectwaveguide_sub();
263 get_rectwaveguide_comp();
266 get_rectwaveguide_elec();
269 get_rectwaveguide_phys();
286 lambda_g = (2. *
M_PI)/beta;
287 l = (ang_l * lambda_g)/(2.0 *
M_PI);
294 lambda_g = (2. *
M_PI)/beta;
295 atten_cond = alphac () * l;
296 atten_dielectric = alphad () * l;
297 er_eff = (1.0 -
pow((fc(1,0)/
f),2.0));
303 atten_dielectric = 0.0;
304 atten_cond = alphac_cutoff () * l;
310 void rectwaveguide::show_results ()
312 short m,
n, mmax, nmax;
319 if (
f >= (2.*fc(1,0))) {
320 char text[256], txt[256];
326 for (m = 2; m<= mmax; m++) {
327 for (n=0; n<= nmax; n++) {
329 sprintf(txt,
"TE(%u,%u) ",m, n);
339 char text[256], txt[256];
344 for (m = 1; m<= mmax; m++) {
345 for (n=1; n<= nmax; n++) {
347 sprintf(txt,
"TM(%u,%u) ",m, n);