Computer Program for Mode Search in Partially-filled Waveguide T.E. van Deventer, P.B. Katehi Radiation Laboratory Department of Electrical Engineering and Computer Science University of Michigan Ann Arbor, MI GOAL The FORTRAN program PFW.FTN (Partially-Filled Waveguide) was written to compute the complex propagation: constant of the hybrid modes propagating in an inhomogeneously-filled waveguide with any number of lossy substrates and non-perfectly conducting walls. FORMULATION The general version of the program solves for the hybrid TE and TM to x modes that propagate in structures as shown in Figure 1. To determine the possible propagation constants kz, the following transcendental equations corresponding to these hybrid modes are solved for LSM (TMx) modes as tanklIhl = — tankx2h2 (1) ~1 E2 and for LSE (TEl) modes kxl kx2 — cotkxlhl = -— cotk2h2 (2) rCi 1 ^1 2 1

with k21 + (n7)2 + k = W2 11 (3) b k2 +(n7)2~+k2 = W2/2. (4) The hybrid modes are denoted LSEmn and LSMmn. The transcendental equations have an infinite number of solutions for a given mode number n. The index m denotes the order of these solutions. For b > a, the dominant mode is the LSMol mode (m = 0, n = 1) followed by m = 1, and so on. For b < a, the first mode is an LSE mode with n = 0. In this case the numbering on the index m starts at m = 1, then m = 2, and so on. The numbering is chosen to be consistent with that of the empty waveguide [1]. The equations (1), (2) are derived using the transverse resonance method, since the structure at resonance reduces to a transmissionline structure with propagation in the x-direction. In the case of perfectly conducting walls, the end transmission-lines are shortcircuited as shown in Figure 2. However finite conductivity of the metal housing has been implemented in the PFW.FTN where the top and bottom walls can have a conductivity a, which in turns can be described by a load at the end of the transmission line. The program also accounts for substrate losses with the option of inputting the dielectric and magnetic loss tangents. 6i = ei (1 -jtanSi) (5) pi = /tri(1-jtanyi). (6) This program allows to compute the complex propagation constant of any propagating mode in a rectangular waveguide structure, as a function of frequency. It can also calculate the cut-off frequency of the modes by choosing a frequency increment small enough around kz = 0. DESCRIPTION The geometry of the structure is inputted through a user-friendly menu program. The output is written in a file and on the screen, 2

x 4 x=a hi 2.......................................................................... O y=b Y Figure 1: Partially-filled waveguide configuration I-':I -i 12 h3 Figure 2: Transmission-line Analogy 3

and gives the propagation constant of the modes propagating within the frequency range of interest..1 menu The menu is an interactive program that allows for on-screen creation of the input data file. Also changes can be made on the screen by entering the variable name to be changed (e.g. FSTR to change the starting frequency). The program will then prompt for a new value of the variable. Dimensions can be entered either in centimeters or inches. Conductor losses in the top and bottom walls may be included, in which case the conductivity of the walls should be given. The maximum mode number n refers to the discussion in the previous section. The output is written in a file called'RESULT'..2 program The PFW.FTN program calculates the roots of (1) and (2) for the lossless case. When losses are considered, the roots of the transcendental equations are found using Muller's method with deflation. The present program calls for the following subroutines of the IMSL library (November 1, 1984 release) [2] * ZANLYT ( find the zeros of a univariate complex function using Muller's method) * UGETIO * USPKD *. UERTST. These subroutines have to be bound to the main program PFW.FTN for the program to run. If this library is not available, a lossless version of the program may be requested..3 limitations The program PFW.FTN is a generalized code that can handle any number of dielectric layers. However, for programming purposes, the arrays have been dimensionned to a maximum of 20 layers. 4

VERIFICATION Using the approach described in the previous section a computer program was developed to calculate the complex propagation constant. The validity of this program has been verified in the case of lossless substrates. Good agreement with Yamashita's paper [3] is shown, and the results of the program PFW.FTN given in the next section may be compared to Figure 3. 5

3.0 2.0. PO (IT: tMIatltTES 1.0 - 0 10 15 20 25 FRE'UENCY (GHz) Figure 3: Propagation Constant as a function of frequency (comparison with Yamashita) 6

I/O FILES AND CODE.1 screen sample 7

//tera/users/vandeventer/report_ dir/screen.out PAGE1 03/12/90 1:33 PM $ P THE UNIVERSITY OF MICHIGAN COLLEGE OF ENGINEERING RADIATION LABORATORY ANN ARBOR, MICHIGAN *************************************************************************** ****************************************************************************** MMMMMM M MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MM M MMM MM MM MMMMMM MM MM MM MM MM M MM MM M MM M MM MM MM MM MMMM MMMMMMMM MM M MM MM MM MM MM MM MM MM MM MM MM MM MM MM MMM MMMM MMMM MMMM MMMM MMMMMMM MMMM MMMM MMMM M MMMM MMM ***************************************************************************** ***************************************************************************** THIS PROGRAM CALCULATES THE PROPAGATION CONSTANT OF THE HYBRID MODES EXCITED IN PARTIALLY-FILLED WAVEGUIDES T. EMILIE VAN DEVENTER -- AND -- LINDA P. B. KATEHI MARCH 11, 1990 VERSION Fortran PAUSE Type return to continue Enter name of configuration data file; yamashita ENTER START FREQUENCY (GHz): 10 ENTER STOP FREQUENCY (GHz): 25 ENTER INCREMENT FREQUENCY (GHz): 1 Select units: [1] inches [2] centimeters 2 Enter # OF LAYERS IN WAVEGUIDE: 2 Enter permittivity for layer 1 1 Enter permittivity loss tangent for layer 1 0 Enter permeability for layer 1 1 Enter permeability loss tangent for layer 1 0 Enter height of layer 1 1.143 Enter permittivity for layer 2 8.875 Enter permittivity loss tangent for layer 2 0 Enter permeability for layer 2 1 Enter permeability loss tangent for layer 2 0 Enter height of layer 2.127 Enter waveguide dimension along x: 1.27 Enter waveguide dimension along y: 1.27 Enter maximum # of modes to find 3 DIMENSIONS ARE TO BE ENTERED IN CENTIMETERS Name of geometry configuration file [NAME] yamashita the units are CM cavity dimension along x [A]: 1.2700000 cavity dimension along y [B]: 1.2700000 START FREQUENCY TO RUN (GHz) [FSTR]: 10.00000 STOP FREQUENCY TO RUN (GHz) [FSTP]: 25.00000 INCREMENT FREQUENCY (GHz) [FNCR]: 1.000000 NUMBER OF DIELECTRIC LAYERS [NLY]: 2 RELATIVE ELECTRIC PARAMETERS OF LAYERS: dielectric loss permeability constant tangent real imaginary Layer 1 [EL1R]: 1.000000 [EL1I]: 0.000000 [EL1M]: 1.000000 [M1M]: 0.000000 Layer 2 [EL2R]: 8.875000 [EL2I]: 0.000000 [EL2M]: 1.000000 [M2M]: 0.000000 GEOMETRY OF DIELECTRIC LAYERS: CM Layer 1 thickness; [LIB]: 1.143000 Layer 2 thickness; [L2B]: 0.127000 PROGRAM PARAMETERS max. n mode number [M]

//t ra/u ers/vandeventer/report _dir/screen. out PAGE2 03/12/90 1:33 PM CONDUCTOR LOSSES Include lower ground losses Include upper ground losses Conductivity of the walls: [GL] F [UL] F: [SIG] 0.OOOOOOOOE+00 Enter Variable Name [**] or <return> operating frequency mode excited 11.00000 LSM_ 0 1 12.00000 LSE 1 0 12.00000 LSM_ 0 1 13.00000 LSE 1 0 13.00000 LSM- 0 1 14.00000 LSE 1 0 14.00000 LSM_ 0 1 15.00000 LSE 1 0 15.00000 LSM 0 1 16.00000 LS-E 1 16.00000 LSE 1 1 16.00000 LS- 0 1 16.00000 LSM_ 0 1 16.000099999 LSM 1 1 16.99999 LSE 1 0 16.99999 LSE 1 1 16.99999 LSM 0 1 16.99999 LSM_ 1 1 _ —__________________________ 17.99999 LSE 1 0 17.99999 LSE 1 1 17.99999 LSM- 0 1 17.99999 LSM 1 1 17.99999 LSM_ 0 2 18.99999 LSE 1 0 18.99999 LSE 1 1 18.99999 LSM- 0 1 18.99999 LSM 1 1 18.99999 LSM- 0 2 19.99999 LSE 1 0 19.99999 LSE 2 0 19.99999 LSE~ 1 1 19.99999 LSM_ 0 1 19.99999 LSM 1 1 19.99999 LSM_ 0 2 _____________________________ 20.99999 20.99999 20.99999 20.99999 20.99999 20.99999 21.99999 21.99999 21.9999 21.99999 21.99999 21.99999 21.99999 21.99999 21.99999 21.9 999 9 LSE 1 0 LSE 2 0 LSE 1 1 LSM- 0 1 LSM 0 2 LSM- 0 3 LSE 1 0 LSE 2 0 LSE- 1 1 LSE- 2 1 LSM 0 1 LSM 1 1 LSM- 2 1 LSM- 0 2 LSM 0 3 1 propagation constant kz kz/kO alpha (Np/m) 31.31126 0.13591 0.00000 79.74963 0.31731 0.00000 120.35992 0.47890 0.00000 135.77371 0.49867 0.00000 174.46198 0.64077 0.00000 177.91298 0.60677 0.00000 223.21684 0.76127 0.00000 214.72264 0.68348 0.00000 272.61243 0.86775 0.00000 248.85355 0.74262 0.00000 27.13668 0.08098 0.00000 326.30457 0.97374 0.00000 126.81892 0.37845 0.00000 281.65442 0.79106 0.00000 134.67567 0.37825 0.00000 386.91238 1.08669 0.00000 188.03099 0.52811 0.00000 314.07828 0.83312 0.00000 193.52902 0.51335 0.00000 455.72186 1.20884 0.00000 233.84915 0.62030 0.00000 155.26567 0.41186 0.00000 347.03436 0.87209 0.00000 243.39511 0.61165 0.00000 532.32367 1.33772 0.00000 272.13550 0.68387 0.00000 315.90094 0.79385 0.00000 381.62134 0.91105 0.00000 87.68021 0.20932 0.00000 290.59106 0.69374 0.00000 614.82782 1.46779 0.00000 305.95987 0.73043 0.00000 440.95157 1.05269 0.00000 419.31534 0.95337 0.00000 200.72998 0.45639 0.00000 338.57596 0.76980 0.00000 700.75470 1.59327 0.00000 554.51080 1.26076 0.00000 39.09147 0.08888 0.00000 461.96701 1.00260 0.00000 272.47369 0.59135 0.00000 390.15616 0.84675 0.00000 114.23763 0.24793 0.00000 787.95502 1.71010 0.00000 365.93430 0.79419 0.00000 71.16162 0.15444 0.00000 661.28510 1.43518 0.00000 362.40820 0.78653 0.00000 511.25302 1.06133 0.00000 328.50262 0.68195 0.00000 447.42371 0.92882 0.00000 216.15340 0.44872 0.00000 128.89127 0.26757 0.00000 874.98932 1.81642 0.00000 393.56696 0.81702 0.00000 180.87822 0.37549 0.00000 762.90967 1.58375 0.00000 525.42639 1.09075 0.00000 567.67902 1.12936 0.00000 374.12955 0.74431 0.00000 510.94788 1.01650 0.00000 280.68002 0.55840 0.00000 278.37512 0.55381 0.00000 961.05621 1.91196 0.00000 420.13651 0.83584 1.78549 244.50510 0.48643 0.00000 860.26398 1.71144 0.00000 658.85938 1.31076 0.00000 630.29608 1.20378 0.00000 412.43860 0.78770 0.00000 579.72522 1.10719 0.00000 330.02109 0.63029 0.00000 390.52069 0.74584 0.00000 045.78235 1.99730 0.00000 446.21091 0.85220 1.10039 294.31281 0.56210 0.00000 953.98407 1.82198 0.00000 124.01501 0.23685 0.00000 777.25629 1.48445 0.00000 22.99999 LSE 1 0 22.99999 LSE- 2 0 22.99999 LSE 1 1 22.99999 LSE- 2 1 22.99999 LSE- 1 2 22.99999 LSM- 0 1 22.99999 LSM 1 1 22.99999 LSM- 2 1 22.99999 LSM 0 2 22.99999 LSM- 0 3 23.99999 LSE 1 0 23.99999 LSE 2 0 23.99999 LSE 1 1 23.99999 LSE- 2 1 23.99999 LSE- 1 2 23.99999 LS- 0 1 23.99999 LSM 1 1 23.99999 LSM- 2 1 23.99999 LSM- 0 2 23.99999 LSM_ 0 3 24.99999 LSE 1 0 24.99999 LSE- 2 0 24.99999 LSE- 1 1 24.99999 LSE 2 1 24.99999 LSE- 1 2 24.99999 LSM 0 1 24.99999 LSM 1 1 24.99999 LSM- 2 1 24.99999 LSM 0 2 24.99999 LSM 1 2 24.99999 LSM- 0 3 Fortran STOP

.2 FORTRAN code 8

:era/users/vandeventer/momentdir/pfw.ftn Pagel 03/12/ 90 12: 13 t.e. van deventer radiation laboratory room 3121, eecs bldg (313) 769-2975 department of electrical engineering and computer science the university of michigan ann arbor, mi 48105 program pfw.ftn this program is divided into 3 parts, (1) main program (2) subroutines (3) functions date: o 31 may 1989 )ind pfw.bin muller.bin -b p topic: computes the propagation constant of the lse and lsm modes to solve for the transcendental equations of a general n-layers inhomogeneously-filled waveguide define parameters integer q,infer(1),n,nguess,nsig,kn,ms,ligne,nl integer itmax,ier,i,l,ifile,lunit,if,mflag integer groundup,groundlow,miter integer le,m, rdim,mid, r,mdim, index,ml, indexl real a,b,h(20),sig,ermax,mrmax,unit real muO,epsO,pi,omega,kzr,rs(0:20),rsO(0:20),is(0:20) real fop,fopstop,incrfr,fopn real epsr(20),mur(20) real losstan(20),mu tan(20) real oldlosstan(20),oldmutan(20) real incrkz real rwi,iwi,old_incrkz,eps,rkz,fop_l real attdbm,old_kzstop,as,oldincrfr real absdet,absdetl,amp,differ complex sum,sum_l,fsum complex kz,kzl,j,kO,kznoloss complex xx(1),zs,kzstart,old_sum,eqn_c complex erc(20),murc(20) character*50 config_file character*2 hmode LOGICAL do_gcl,do_ucl ______________________

tera/users/vandeventer/momnent_dir/pfw. ftn Page2 03/12/90 12:13 common blocks common/constant/muO,epsO,pi,omega,j,kO common/mike/erc,mur c common/geometry/zs,groundup,groundlow common/trick/fsum common/dimensions/mid common/param/mdim,le common/geom/a, b common/freq/fop, fopstop, incrfr common/layers/rdim,h,epsr,mur,losstan,mutan common/operate/do_gcl,do_ucl,sig common/mode/m common/units/lunit,unit external eqn_c read in input file a is the x-direction (or vertical) b is the y-direction (or horizontal) h is the height of the layers fop is the frequency of interest fopstop is the maximum frequency of interest incrfr is the increment of the frequency groundup is a flag ( 1 = losses in upper wall considered, 0 = no conductor losses ) groundlow is a flag ( 1 = losses in lower wall considered, 0 = no conductor losses ) incrkz is the increment of the propagation constant kz kzstop is an upper limit to the value of the propagation constant if le is 1, calculate the lse propagation constant if le is 2, calculate the lsm propagation constant call logo call menuc open database open(unit=12, file=' result',status='unknown') call writeout(12) groundup = 0 groundlow = 0 if (doucl) then groundup = 1 endif if (dogcl) then groundlow = 1 endif change values to SI units fop = fop *le9 fopstop = fopstop * le9 incrfr = incrfr * le9 if (lunit.eq. 1) then

:era/users/vandeventer/momentdir/pfw.ftn Page3 03/12/ 90 12: 13 unit =.0254 else if (lunit.eq. 2) then unit = le-2 endif a = a * unit b = b * unit do 103 r=l,rdim h(r) = h(r) * unit L03 enddo compute some constants pi = 4. * atan(l.) muO = 4.e-7 * pi epsO = le-9 / (36.*pi) j = cmplx(0.,1.) mid = nint(rdim / 2.) mrmax = 0.0 ermax = 0.0 do 101 r=l,rdim er_c(r) = epsr(r)*cmplx(1.00,- loss_tan(r)) mur_c(r) = mur(r)*cmplx(1.00,- mu_tan(r)) mrmax = amaxl(mur(r),mrmax) ermax = amaxl(epsr(r),ermax) 01 continue ligne = 0 fop = fop - incrfr write (12,*)'operating mode propag', &'ation constant' write (12,*)'frequency excited kz kz/kO' &,' alpha (Np/m)' write (12,*)' —---------------------------------------- &'' —-- ~ —_ _ —---— _, write (*,*)'operating mode propag', &'ation constant' write (*,*)'frequency excited kz kz/kO' &,' alpha (Np/m)' write (*,*)' —-------------------------------------- & -------—' —----- frequency loop 0 do 5 if=l,1000 fop = fop + incrfr if (fop.gt. fopstop) then goto 5000 endif fopn = fop * le-9 omega = 2. * pi * fop

'tera/users/vandeventer/moment_dir/pfw. ftn Page4 03/12/90 12:13 kO = cmplx(omega * sqrt(muO * eps0),0.) kz = cmplx(.01,0.) * kO incrkz =.001 * kO miter = 10000 * (sqrt(ermax*mrmax)+.2) if (do_ucl.or. do_gcl) then amp = sqrt(pi*fop*muO/sig) else amp = 0.0 endif zs = cmplx(amp,amp) kzstart = kz old incrkz = incrkz LSE / LSM loop do 6 le=1,2 if (le.eq. 1) then hmode ='E' else if (le.eq. 2) then hmode ='M' endif if (le.eq. 1) then ml = 0 nl = 1 else ml = 1 nl = 0 endif m - mode loop do 7 m=ml,mdim indexl = nl - 1 kz = kzstart 17 continue incrkz = old incrkz kz_l = cmplx(0.0,0.0) suml = cmplx(0.0,0.0) mflag = 0 loop to compute the kz root for lossless case -2 do 20 ms=l,miter kz = kz + incrkz rkz = real(kz) / real(k0) if (rkz.gt. sqrt(ermax*mrmax)+.2) then write (*,*)'beta > quasi-static value'

tera/users/vandeventer/moment_dir/pfw.ftn Page5 03/12/90 12:13 goto 1000 endif sum = cmplx(0.,0.) call hybrid(kz,sum) write (*,*)'fopm,lekz,rkz,sum',fopn,m,le,kz,rkz,sum ----------— refinement loop —--------------------------- the loop will be used if at least one of the real or imaginary parts of the sum changed sign since the previous case if ((real(sum_1).It. 0.0.and. real(sum).ge. 0.0) &.or. (real(sum_1).gt. 0.0.and. real(sum).le. 0.0) &.or. (aimag(sum).gt.0.0.and. aimag(suml).lt.O.O) &.or. (aimag(sum).lt.O.O.and. aimag(sum_l).gtO.O0)) & then mflag = mflag + 1 incrkz = incrkz * 0.1 kz = kz_1 check if the change of sign is due to a singularity in the function (mflag test) or a root (differ) absdet = sqrt(real(sum)**2 + aimag(sum)**2) absdetl = sqrt(real(suml)**2 + aimag(suml)**2) differ = abs(absdet - absdetl) if (differ.lt. 10.) then goto 13 endif if (mflag.gt. 4) then goto 17 endif goto 12 endif 27 sum 1 = sum kz 1 = kz 20 continue 13 continue kznoloss = kz indexl = indexl + 1 rs(indexl) = real(kz) rsO(indexl) = rkz is(indexl) = 0.0 loop to compute the kz root for lossy case ----------— initial guess —----------------------------- rwi = real(kz) iwi = 0.0 xx(1) = cmplx(rwi,iwi)

:era/users/vandeventer/momentdir/pfw. ftn Page6 03/12/90 12:13 --— muller's method (determinant) —-------------- 50 continue eps = le-3 nsig = 3 kn = 0 nguess = 1 n = 1 itmax = 100 call zanlyt(eqnc,eps,nsig,kn,nguess,n,xx,itmax,infer &,ier) attdbm = - aimag(xx(l)) * 8.686 rs(indexl) = real(xx(l)) rsO(indexl) = real(xx(l)) / real(kO) is(indexl) = attdbm kz = kznoloss goto 17 )00 continue do 153 ii=nl,indexl i = indexl+nl-ii ligne = 1 write (*,655) fopn,hmode,ii,m,rs(i),rsO(i),is(i) write (12,655) fopn,hmode,ii,m,rs(i),rsO(i),is(i) 655 format(flO.5,7x,'LS',Al,'',i2,i2,6x, f12.5, f12.5, f12.5) rs(i) = 0.0 rsO(i) = 0.0 is(i) = 0.0 53 enddo 7 continue 6 continue if (ligne.eq. 1) then write (12,*)' —----------------------- write (*, )' - ------------------- endif ligne = 0 5 continue O0 continue stop end ssssssssssSSsssssSsssssssssssssssssssssssssssssssssssssssssss subroutines SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSssss3SSSsssSSSSssSSS3SSSSSsS subroutine hybrid(kz,-sum) omputes the arrays corresponding to Ise and Ism common terms le = (1) corresponds to lse modes (electric)

tera/users/vandeventer/momentdir/pfw.ftn Page7 03/12/90 12:13 le = (2) corresponds to Ism modes (electric) ---— cannot have eps or mu equal to zero!!! —------- integer m, le, r, rdim,mid,mdim integer groundup,groundlow real a,b real ky real h(20),epsr(20),mur(20),loss_tan(20),mutan(20) real muO,eps0,pi,omega complex k(20),kx(20),kz complex j,kO,sum complex er_c(20),mur_c(20) complex zc(2,20),zO(2,0:21) complex twg,zs external twg common/constant/muO,epsO,pi,omega, j,kO common/param/mdim, le common/mode/m common/mike/erc,mur_c common/geometry/zs, groundup, groundlow common/geom/a,b common/layers/rdim, h, epsr, mur, loss_tan,mu_tan common/dimensions/mid ky = m * pi / b do 410 r=l,rdim k(r) = kO * csqrt( er_c(r)*mur_c(r) ) kx(r) = csqrt( k(r)**2 - ky**2 - kz**2) zc(l,r) = cmplx(omega * muO * mur_c(r)) / kx(r) zc(2,r) = kx(r) / cmplx(omega * epsO * er_c(r)) 10 continue i = le zO(i,O) = zs * groundup zO(i,rdim+l) = -zs * groundlow do 420 r=l,mid zO(i,r) = zc(i,r) * & (zO(i, r-)+j*zc(i,r-+j*zc r)*twg(kx(r)*h(r)))/ & (zc(i,r)+j*z0(i, r-1)*twg(kx(r)*h(r))) continue do 430 r=rdim,mid+l,-1 zO(i,r) = zc(i,r) * & (zO(i,r+1)+j*zc(i,r)*twg(-kx(r)*h(r)))/

tera/users/vandeventer/moment_dir/pfw. ftn Page8 03/12/90 12:13 & (zc(i,r)+j*zO (i,r+l)*twg(-kx(r)*h(r))) 30 continue sum = z0(i,mid) - zO(i,mid+l) write (*,*)'kz,i,mid,z0 (i,mid),zO (i,mid+l), sum' write (*,*) kz, imid, zO(imid), zO (i,mid+l) sum continue return end sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss SUBROUTINE MENUC INTEGER i,j,il,i2,n INTEGER menu INTEGER rdim,mdim, le,lunit REAL fop,fopstop, incrfr, sig, unit REAL epsr(20),mur(20),loss_tan(20),mu_tan(20) REAL a,b REAL x REAL h(20) COMPLEX eps(20) LOGICAL do_gcl,do_ucl LOGICAL exists CHARACTER*80 warning CHARACTER*10 check CHARACTER*8 ans,un CHARACTER*50 config_file CHARACTER*50 cfg_file,name_file CHARACTER*7 menuelr(19),menueli(19),menuelm(19) CHARACTER*7 menu_layer(19),menu_mu(19) common/param/mdim, le common/geom/a, b common/freq/fop,fopstop,incrfr common/layers/rdim,h,epsr,mur, loss_tan,mu_tan common/operate/dogcl,do_ucl,sig common/files/config_file common/units/lunit,unit parameter (PI=3.14159265358979324) data menu elr/' [EL1R]','[EL2R]','[EL3R]','[EL4R]', &'[EL5R]','[EL6R]',' [EL7R]','[EL8R]','[EL9R]', &' [EL10R]', [EL11R]',' [EL12R]',' [EL13R]',' [EL14R]', &' [EL15R]'''[EL16 R]'' [EL17R]','[EL18R],' [EL19R]'/ data menu eli/'[EL1I]','[EL2I]','[EL3I]','[EL4I]', & [ELI]'[E6I]','[E L7I]',' [EL8I]','[EL9I]', &' [EL10I]',' [EL11I]',' [EL12I]',' [EL13I]',' [EL14I]', &'[EL15I]','[EL16I]','[EL17I]','[EL18I]','[EL19I]'/ data menu_elm/' [ELM]','[EL2M]',' [EL3M]','[EL4M]', &' EL5M]','[EL6M]',' [EL7M]',' [EL8M]',' [EL9M]',

tera/users/vandeventer/noment dir/pfw.ftn Page9 03/12/90 12:13 &' [EL1OM]',' [EL12M]'' [EL13M]'' [EL14M]', &' [EL15M]', [EL16M]',' [EL17M]',' [EL18M]',' [EL19M]'/ data menu_mu/' [M1M' M2M]'' [M2M]''' [M3M]4M', &' [M5M]',' [M6M]',' [M7M]',' [M8M]',' [M9M]', &' [M1OM]',' [MUM]', [M1 M2M]'''[M13M]',' [M14M]', &' [M15M]',' [M16M]',' [M17M]',' [M18M]',' [M9M]' data menu_layer/' [L1B]',' [L2B]',' [L3B]',' [L4B]', &' [L5B]',' [L6B]',' [L7B]',' [L8B]',' [L9B]', &' [L1OB]','[L1lB]',' [L12B]','[L13B]',' [L14B]', &' [L15B]',' [L16B]',' [L17B]',' [L18B]',' [L19B]'/ DEFINE WRITES A FILE CONTAINING ALL OF THE PARAMETERS NEEDED FOR THE ANALYSIS OF THE INHOMOGENEOUSLY-FILLED WAVEGUIDE PROBLEM. THE VARIABLES AND PARAMETERS ARE NAMED AS FOLLOWS: a - dimension of cavity along x axis b - dimension of cavity along y axis fop - frequency of analysis in GHz fopstop - maximum frequency incrfr - frequency increment rdim - number of layers in cavity substrate THE NEXT SEGMENT DETERMINES WHETHER AN EXISTING CONFIGURATION FILE IS TO BE USED o00 write(*,*)'Enter name of configuration data file;' read(*,'(A50)') configfile {geometric configuration file name cfg_file=config_file inquire(file=cfg_file,exist=exists) {check if format file already exist call trim(cfg_file,50,il,i2) if (exists ) then warning =' WARNING: File'//cfg_file(il:i2)// &' already exists. Use existing file?'// &' ( <return> = yes )' write (6,*) warning read (5,'(al)') ans if ((ans.ne.'y').and.(ans.ne.'Y').and.(ans.ne.'')) goto 100 goto 200 endif NEXT SECTION OF CODE IS ONLY REACHED IF NO CONFIGURATION FILE ALREADY EXISTS AND WILL COLLECT ALL OF THE NECESSARY INPUT AND GENERATE A NEW CONFIGURATION 49 write(*,*)'ENTER START FREQUENCY (GHz)' read(*,*,err=949) fop 50 write(*,*)'ENTER STOP FREQUENCY (GHz)' read(*,*,err=949) fopstop 51 write(*,*)'ENTER INCREMENT FREQUENCY (GHz):' read(*,*,err=949) incrfr write(*,*)'Select units:' write(* *)' [1] inches' write(**)' [2] centimeters' read(*,*) lunit

tera/users/vandeventer/moment dir/pfw.ftn PagelO 03/12/ 90 12:13 write (* *) write(*,*)'Enter # OF LAYERS IN WAVEGUIDE: read(*,*) rdim x = 0.0 do i = 1, rdim write (*,*) write (*, *) &'Enter permittivity for layer',i read(*,*) epsr(i) if (epsr(i).eq. 0.0) epsr(i) = 1.0 write(*,*) &'Enter permittivity loss tangent for read(*,*) losstan(i) write(*,*) &'Enter permeability for layer',i read(*,*) mur(i) if (mur(i).eq. 0.0) mur(i) = 1.0 write(*,*) &'Enter permeability loss tangent for read(*,*) mutan(i) layer',i layer',i write(*,*)'Enter height of layer',i read(*,*) h(i) x = x + h(i) enddo WAVEGUIDE GEOMETRY write(*,*)'Enter waveguide dimension along x:' read(*,*) a write(*,*)'Enter waveguide dimension along y:' read(*,*) b if (x.ne. a) then goto 499 endif NUMERICAL PARAMETERS write(*,*)'Enter maximum # of modes to find' read(*,*) mdim dogcl =.false. doucl =.false. le = 2 sig = 0.0 goto 400

:era/users/vandeventer/momentdir/pfw.ftn Pagell 03/12/ 90 12: 13 THE NEXT SEGMENT READS DATA FROM EXISTING FILE 200 open(10,file=cfg_file) read (10,*) read (10,650) config_file read (10,*) read (10,*) mdim read (10,*) read (10,*) lunit read (10,*) read (10,*) a,b read (10,*) read (10,*) fop,fopstop,incrfr read (10,*) read (10,*) rdim read (10,*) do i = 1,rdim read(10,*) h(i),epsr(i),mur(i),loss_tan(i),mutan(i) enddo read (10,*) read (10,*) do_gcl read (10,*) doucl read (10,*) read (10,*) sig read (10,*) read (10,*) 50 format(A50) close (10) THE NEXT PART IS THE MAIN PART OF THE MENU SYSTEM WRITE VARIABLE LIST ON SCREEN )0 continue if (lunit.eq.2) then write(*,*)'DIMENSIONS ARE TO BE ENTERED IN CENTIMETERS un ='CM' else if (lunit.eq.1) then write(*,*)'DIMENSIONS ARE TO BE ENTERED IN INCHES un ='INCH' endif write(*,*) write(*,*) *************************************** write(*,*) write(*,705) config_file write(*,*) write(*,704) un write(*,710) a

.era/users/vandeventer/moment dir/pfw.ftn Pagel2 03/12 /90 12: 13 write(*,715) b write (*, *)'04 format('the units are',A7)'05 format('Name of geometry configuration file'10 format('cavity dimension along x [A] & f14.7)'15 format('cavity dimension along y [B] & f14.7) [NAME]', A50) ~ ~ f write(*,*)'START FREQUENCY TO RUN (GHz) [FSTR]: write(*,*)'STOP FREQUENCY TO RUN (GHz) [FSTP]: write(*,*)'INCREMENT FREQUENCY (GHz) [FNCR]: write(*,*) 716 format('frequency',i3,' in GHz',3x,A7,2x,f14.7),fop' fopstop' incrfr write (*, *) write(*,*)'NUMBER OF DIELECTRIC LAYERS [NLY]:',rdim if (rdim.gt.1) then write(*,*) write(*,*)'RELATIVE ELECTRIC PARAMETERS OF LAYERS:' write(*,*)' dielectric', &' loss permeability' write(*,*)' constant', &' tangent real &' imaginary' do i = 1,rdim write(*,720) i,menu_elr(i),epsr(i),menu_eli(i), & losstan(i),menuelm(i),mur(i),menumu(i), & mu tan(i) enddo write (*, *) write(*,718) un write(*,*)' do i = 1,rdim write(*,725) i,menu_layer(i),h(i) enddo write (*, *) endif L8 format('GEOMETRY OF DIELECTRIC LAYERS: -0 format('Layer',i3,5x,A7,':',f12.6,2x,A7,' & 2x,A7,':',f2.6,2x,A7,':', f12.6)'5 format('Layer',i3,' thickness;',A7, write(*,*) write(*,*)'PROGRAM PARAMETERS' write(*,777) mdim write(*,*) write(*,*)'CONDUCTOR LOSSES' write(*, 744) do_gcl write(*,745) doucl write(*,746) sig',2x,A7):',f12.6,':',fl2.6) 7 format ('max. n mode number 4 format('Include lower ground losses [M]', i5):',8x,' [GL]', 1,5x)

tera/users/vandeventer/moment dir/pfw.ftn Pagel3 03/12/90 12:13 745 format('Include upper ground losses 746 format('Conductivity of the walls:',8x,' [UL]',11,5x):',8x,' [SIG]',el5.8) goto 9999 THE NEXT PART READS THE RESPONSES TO THE MENU PROMPT DETECTS WHICH VARIABLE IS TO BE CHANGED PROMPTS FOR THE CHANGE AND MAKES IT AND UPDATES THE MENU write (*,*) write(*,*)'Enter Variable Name [**] or <return>' read(*,' (A4)',err=499) check ****** ALTER VARIABLES AS DESIRED if (check.eq.'') goto 600 if ( (check.eq.'STOP').or. (check.eq.'stop') &.or.(check.eq.'QUIT').or. (check.eq.'quit') &.or.(check.eq.'EXIT').or. (check.eq.'exit') &.or.(check.eq.'ABORT').or. (check.eq.'abort') ) stop if ((check.eq.'name').or.(check.eq.'NAME')) then 501 write(*,*)'ENTER NEW CONFIGURATION FILE NAME' read(*,'(a50)',err=499) namefile call trim(name file,50,il,i2) inquire(file=name_file(il:i2),exist=exists) if(exists) then warning =' WARNING: File'//name file(il:i2)// 6 6' already exists. Input existing file?'//' ( <return> = yes )' write (6,*) warning read (5,'(al)') ans if ((ans.ne.'y').and. (ans.ne.'Y').and. (ans.ne.'')) goto 501 config_f ile=name_f ile cfg_file=name_file goto 200 else config_file=name_file cfg_file=name_file goto 400 endif endif if ((check.eq.'a').or.(check.eq.'A')) then write(*,*)'ENTER A read(*,*,err=499) a goto 400 endif if ((check.eq.'b').or.(check.eq.'B')) then write(* *)'ENTER B'

tera/users/vandeventer/moment_dir/pfw.ftn Pagel4 03/12/ 90 12: 13 read(*,*,err=499) b goto 400 endif if ((check.eq.'fstr').or.(check.eq.'FSTR')) then write(*,*)'ENTER START FREQUENCY (in GHz)' read(*,*,err=499) fop goto 400 endif if ((check.eq.'fstp').or.(check.eq.'FSTP')) then write(*,*)'ENTER STOP FREQUENCY (in GHz)' read(*,*,err=499) fopstop goto 400 endif if ((check.eq.'fncr').or.(check.eq.'FNCR')) then write(*,*)'ENTER FREQUENCY INCREMENT (in GHz)' read(*,*,err=499) incrfr goto 400 endif if ((check.eq.'nly').or.(check.eq.'NLY')) then write(*,*)'ENTER # OF DIELECTRIC LAYERS' read (*, *, err=499) rdim goto 400 endif do i = 1, rdim if ((check(1:1).eq.'e').or.(check(l:l).eq.'E')) then if ((check(2:2).eq.'l').or.(check(2:2).eq.'L')) then if ((check(4:4).eq.'r').or.(check(4:4).eq.'R')) then if (check(3:3).eq.menu_elr(i) (4:4)) then write(*,*)'ENTER',menuelr(i) read(*,*,err=499) epsr(i) eps(i)= epsr(i) * cmplx(1.,losstan(i)) goto 400 endif else if ((check(4:4).eq.'i').or.(check(4:4).eq.'I')) then if (check(3:3).eq.menu_eli(i)(4:4)) then write(*,*)'ENTER',menueli(i) read(*,*,err=499) losstan(i) eps(i) = epsr(i) * cmplx(1.,losstan(i)) goto 400 endif else if ((check(4:4).eq.'m').or.(check(4:4).eq.'M')) then if (check(3:3).eq.menuelm(i)(4:4)) then write(*,*)'ENTER',menuelm(i) read(*,*,err=499) mur(i) goto 400 endif else if ((check(5:5).eq.'r').or.(check(5:5).eq.'R')) then if (check(4:4).eq.menuelr(i)(5:5)) then write(*,*)'ENTER',menuelr(i) read(*,*,err=499) epsr(i) eps(i)= epsr(i) * cmplx(1.,losstan(i)) goto 400 endif

tera/users/vandeventer/momentdir/pfw.ftn Pagel5 03/12/90 12:13 else if ((check(5:5).eq.'i').or.(check(5:5).eq.'I')) then if (check(4:4).eq. menu_eli(i) (5:5)) then write(*,*)'ENTER',menueli(i) read(*, *,err=499) losstan(i) eps(i) = epsr(i) * cmplx(1.,loss_tan(i)) goto 400 endif else if ((check(5:5).eq.'m').or.(check(5:5).eq.'M')) then if (check(4:4).eq.menuelm(i)(5:5)) then write(*,*)'ENTER',menuelm(i) read(*,*,err=499) mur(i) goto 400 endif endif endif endif if ( (check(l:l).eq.'l').or.(check(l:l).eq.'L') ) then if ( (check(3:3).eq.'b').or.(check(3:3).eq.'B') ) then if ( check(2:2).eq.menu_layer(i)(3:3) ) then write(*,*)'ENTER',menulayer(i) read(*,*,err=499) h(i) goto 400 endif else if ((check(4:4).eq.'b').or.(check(4:4).eq.'B')) then if ( check(3:3).eq.menu_layer(i)(4:4) ) then write(*,*)'ENTER',menulayer(i) read(*,*,err=499) h(i) goto 400 endif endif endif if ( (check(1:1).eq.'m').or.(check(1:1).eq.'M') ) then if ( (check(3:3).eq.'m').or.(check(3:3).eq.'M') ) then if ( check(2:2).eq.menu mu(i) (3:3) ) then write (*,*)'ENTER',menumu(i) read(*,*,err=499) mutan(i) goto 400 endif else if ((check(4:4).eq.'m').or.(check(4:4).eq.'M')) then if ( check(3:3).eq.menumu(i) (4:4) ) then write(*,*)'ENTER',menumu(i) read(*,*,err=499) mutan(i) goto 400 endif endif endif enddo if ((check.eq.'m').or.(check.eq.'M')) then write(*,*)'ENTER M' read(*,*,err=499) mdim goto 400 endif if ((check.eq.'gl').or.(check.eq.'GL')) then do_gcl =.not.do_gcl goto 400

tera/users/vandeventer/moment dir/pfw.ftn Pagel6 03/12/90 12:13 endif if ((check.eq.'ul').or.(check.eq.'UL')) then doucl =.not.doucl goto 400 endif if ((check.eq.'sig').or.(check.eq.'SIG')) then write(*,*)'ENTER CONDUCTIVITY OF THE WALLS (S/m)' read(*, *,err=499) sig goto 400 endif 499 write(*,*) write(*,*)'**********************************************' write(*,*)' Entry format error -- try again' write(*,*)'******************************** write(*,*) goto 400 THE NEXT PART IS THE LAUNCHING POINT FOR THE REST OF THE PROGRAM IT IS ONLY REACHED WHEN FINISHED WITH THE MENU PART P00 continue I***** WRITE VARIABLES TO NEW FILE OR OLD FILE 00 call trim(cfg_file,50,il,i2) inquire (file=cfg_file,exist=exists) if(exists) then write(*,*)'File already exists ---' &'overwrites not allowed.' write(*,*)'Rename [R] or <return> ( — changes not saved)' read(*,'(A8)') ans if (ans.ne.'') then if (ans.ne.'override') then goto 501 else goto 599 endif endif else 99 open(10,file=cfg_file,status='write') CALL WRITEOUT(10) close (10) endif 99 return end ******************************************************************************* ************************************************************

:era/users/vandeventer/momentdir/pfw.ftn Page17 03/12 /90 12: 13 subroutine trim(char_str, length_spec, il,i2) C finds positions of the first and last non-blank characters c in a string c c integer length_spec,il,i2,i character*(*) charstr do 10 i=l,length_spec if (charstr(i:i).ne.'') then il=i goto 15 endif 0 continue 5 do 20 i=length_spec,1,-1 if (charstr(i:i).ne.'') then i2=i goto 25 endif!0 continue'5 return end SUBROUTINE WRITEOUT WRITES ALL OF THE PARAMETERS FOR THE PROBLEM IN THE FILE OPENED AS file = ifile IN THE CALLING PROGRAM. THE NORMALIZED PARAMETERS (a,b,c,...) ARE PASSED IN THE COMMON STATEMENT AND WHEN WRITEOUT IS CALLED ARE ASSUMED NORMALIZED TO FREE SPACE WAVELENGTH. WRITE OUT RENORMALIZES TO WAVELENGTHS IN THE HOST MEDIA BEFORE WRITING OUT TO THE DATA FILE. SUBROUTINE WRITEOUT(ifile) integer mdim,le,rdim,lunit integer ifile,i,j,n real a,b real fop,fopstop,incrfr,unit,sig real h(20),epsr(20),mur(20),losstan(20),mutan(20) logical dogcl,doucl character*50 config_file common/param/mdim,le common/geom/a, b common/freq/fop,fopstop,incrfr common/layers/rdim,h,epsr,mur,loss_tan,mutan common/operate/do_gcl,do_ucl,sig

tera/users/vandeventer/momentdir/pfw.ftn Page18 03/12/90 12:13 common/files/config_file common/units/lunit,unit write (ifile,*)'*** input data file:' write (ifile,*) config_file write (ifile,*)'*** maximum mode number:' write (ifile,*) mdim write (ifile,*)'*** units (l=inch, 2=cm):' write (ifile,*) lunit write (ifile,*)'*** x and y dimensions:' write (ifile,*) a,b write (ifile,*)'*** start,stop and incrmt frequencies in GHz' write (ifile,*) fop,fopstop,incrfr write (ifile,*) f*** number of layers:' write (ifile,*) rdim write (ifile,*)'*** height, epsr, mur, loss_tan(epsr),' &,' losstan(mur):' do i = l,rdim write(ifile,*) h(i),epsr(i),mur(i),losstan(i),mutan(i) enddo write (ifile,*)'*** losses below and above walls:' write (ifile,*) dogcl write (ifile,*) do_ucl write (ifile,*)'*** conductivity of walls:' write (ifile,*) sig write (ifile,*) write (ifile,*) return end SUBROUTINE LOGO THE UNIVERSITY OF MICHIGAN COLLEGE OF ENGINEERING RADIATION LABORATORY ANN ARBOR, MICHIGAN 4MMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MM M MMM MM MM MM MM MM MM MM MM MM MM MMM MM MM MM MM MM MM MMMMMMM MM MM MM MM MM M MM MM M MM MM MM MM MM MM MM MMMM MMMMMMMM MM M MM M M MM MM MM MM MM MM MM MM MMM MMM 4MMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMM MARCH 11, 1990 VERSION WRITE(*,*)' WRITE(*,*)'' WRITE(*,*)'' WRITE(*,*)'' WRITE(*,*)''

;era/users/vandeventer/moment dir/pfw.ftn Page19 03/12/90 12:133 WRITE (*, *) WRITE(*,*)' THE UNIVERSITY OF MICHIGAN COLLEGE OF ENGI', &'NEERING' WRITE(*,*)' RADIATION LABORATORY' WRITE(*,*)' ANN ARBOR, MICHIGAN' WRITE(*,*)' WRITE(*,*)'****************************************************, WRITE(*,*) WRITE(*,*)'****************************************************', & WRITE(*,*)'' WRITE(*,*)'MMMM MMMM MMMM MMMM MMMM MMMM MMMM MMMM' &' MMMM MMMM MMMM' WRITE(*,*)' MM M M MM MM MM MM MM MM MM MM MM' &' MM MM M M M' WRITE (*,*)' MM MM MM MM MM MMMMMMM MM MM' &' MM MM MM M MM' WRITE (*,*)' MM M MM MM MM MM MM MM MM MMMM', &' MMMMMMMM MM MMM' WRITE (*,*)' MM MM MM MM MM MM MM MM MM MM', &' MM MM MM MMM' WRITE (*,*)'MMMM MMMM MMMM MMMM MMMM MMMM MMMM', &' MMMM MMMM MMMM MMM' WRITE(*,*)'' WRITE(*,*)'****************************************************, &'****WRITE(* *)** WRITE (*,)'****************************************************, WRITE(*,*) WRITE(*,*)'THIS PROGRAM CALCULATES THE PROPAGATION CONSTANT', &'OF THE HYBRID MODES' WRITE(*,*)'EXCITED IN PARTIALLY-FILLED WAVEGUIDES' WRITE(*,*)'' WRITE(*,*)' T. EMILIE VAN DEVENTER -- AND -- LINDA P. B.', &' KATEHI' WRITE(*,*)'' WRITE(*,*)' &' MARCH 11, 1990 VERSION' WRITE(*,*)'' WRITE(*,*) WRITE(*,*)'' WRITE(*,*)'' PAUSE RETURN END fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff functions ffffffffffffffffff fffffff ffffffffffffffff complex function eqn_c(kz) complex sum,fsum,kz common/trick/fsum sum = cmplx(0.,0.) call hybrid(kz,sum) eqn_c = sum

tera/users/vandeventer/moment_dir/pfw.ftn Page20 03/12/90 12:13 fsum=sum return end fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff complex function twg(arg) complex arg,j j = cmplx(0.0,l.O) if(aimag(arg).gt. 45.0) then twg = j else if (aimag(arg).It. -45.0) then twg = -j else twg = csin(arg) / ccos(arg) endif return end ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

References [1] R.F. Harrington, "Time-Harmonic Electromagnetic Fields", McGraw-Hill, 1961. [2] IMSL User's Manual, IMSL Library, Problem-Solving Software System For Mathematical and Statistical FORTRAN Programming, Edition 9.2, Revised November 1984, IMSL LIB-0009. [3] E. Yamashita, "Analysis of Microstrip-Like Transmission Lines by Nonuniform Discretization of Integral Equations," IEEE Trans. Microwave Theory Tech., vol. MTT-24, No. 4, pp.195200, April 1976. 9