C***********************************************************************MST00010
C                                                                       MST00020
C                               -MSTRIP2-                               MST00030
C                                                                       MST00040
C            PARAMETERS OF MICROSTRIP TRANSMISSION LINES AND            MST00050
C                  OF COUPLED PAIRS OF MICROSTRIP LINES                 MST00060
C                                                                       MST00070
C            IMPROVED -- VERSION OF AUG. 1 , 1978                       MST00080
C                                                                       MST00090
C  REFERENCES - 1. T.G. BRYANT AND J.A. WEISS, IEEE TRANS MTT-16 1021   MST00100
C                   (DECEMBER 1968).                                    MST00110
C              2. J.A. WEISS AND T.G. BRYANT, ELECTRONICS LETTERS       MST00120
C                   VOL. 5 P. 517 (OCTOBER 16, 1969).                   MST00130
C              3. J.A. WEISS AND T.G. BRYANT, ELECTRONICS LETTERS       MST00140
C                   VOL. 6 P. 462 (JULY 23, 1970); SEE ALSO ERRATUM,    MST00150
C                   ELECTRONICS LETTERS VOL. 6 P. 560 (AUGUST 20,1970). MST00160
C              4. T.G. BRYANT AND J.A. WEISS, IEEE TRANS MTT-19 418     MST00170
C                   (APRIL, 1971).                                      MST00180
C              5. J.A. WEISS, ADVANCES IN MICROWAVES, VOL. 8,           MST00190
C                   PP. 295-320; ACADEMIC PRESS, 1974.                  MST00200
C                                                                       MST00210
C       FOR MICROSTRIP COMPRISING - A DIELECTRIC SUBSTRATE OF RELATIVE  MST00220
C  DIELECTRIC PERMITTIVITY K AND THICKNESS H1 LYING ON A CONDUCTING     MST00230
C  GROUND PLANE; A SINGLE STRIP OF WIDTH W OR TWO PARALLEL STRIPS OF    MST00240
C  EQUAL WIDTH W WITH INNER EDGES DISTANCE S APART, LYING ON THE UPPER  MST00250
C  SURFACE OF THE SUBSTRATE; THICKNESS OF THE STRIP MATERIAL ASSUMED    MST00260
C  TO BE NEGLIGIBLE; AN UPPER GROUND PLANE LOCATED PARALLEL TO AND      MST00270
C  DISTANCE H2 ABOVE THE LOWER GROUND PLANE (OPTIONAL).                 MST00280
C                                                                       MST00290
C       THE PROGRAM COMPUTES THE FOLLOWING TRANSMISSION-LINE PARAMETERS MST00300
C  FOR A SINGLE STRIP OR FOR BOTH THE EVEN AND ODD MODES OF A COUPLED   MST00310
C  PAIR OF STRIPS -                                                     MST00320
C                                                                       MST00330
C            CHARACTERISTIC IMPEDANCE;                                  MST00340
C            PHASE VELOCITY;                                            MST00350
C            EFFECTIVE DIELECTRIC CONSTANT K-EFF;                       MST00360
C            CAPACITANCE PER UNIT LENGTH PER STRIP (OPTIONAL).          MST00370
C                                                                       MST00380
C      THE CALCULATION EMBODIES THE QUASI-STATIC APPROXIMATION, AS      MST00390
C  EXPLAINED IN REFERENCE 1; THE APPROXIMATION IS ACCURATE PROVIDED     MST00400
C  H1 IS NO GREATER THAN A FEW PERCENT OF THE WAVELENGTH IN AN UN-      MST00410
C  BOUNDED MEDIUM OF PERMITTIVITY K.                                    MST00420
C                                                                       MST00430
C      THE PROGRAM ACCEPTS ANY VALUE OF K, S/H1, AND W/H1.              MST00440
C                                                                       MST00450
C       INPUT AND OUTPUT MEDIA ARE IDENTIFIED IN THE PROGRAM BY THE     MST00460
C  FOLLOWING NAMES - INPUT (USUALLY A CARD READER), IV; OUTPUT (USU-    MST00470
C  ALLY A LINE PRINTER), IW.                                            MST00480
C                                                                       MST00490
C       INPUT DATA - THE INPUT DATA CARD IS WRITTEN IN NAMELIST FORMAT  MST00500
C  AND CONTAINS SIX DECIMAL NUMBERS AND ONE INTEGER NUMBER, ALL         MST00510
C  SEPARATED BY COMMAS, AS IN THE FOLLOWING EXAMPLE.                    MST00520
C                                                                       MST00530
C &CONST WH1=0.1,DELW=0.2,NT=20,R=0.0,DIEK=9.6,SH1=0.4,AIR=1.0, &END    MST00540
C                                                                       MST00550
C  THIS CARD SPECIFIES THE VALUES OF PROGRAM VARIABLES HAVING THE FOL-  MST00560
C  LOWING NAMES -                                                       MST00570
C                                                                       MST00580
C  WH1,DELW,NT,R,DIEK,SH1,AIR                                           MST00590
C                                                                       MST00600
C  WH1 IS THE STARTING VALUE OF W/H1; DELW IS THE INCREMENT OF W/H1;    MST00610
C  NT IS THE NUMBER OF LINES IN THE OUTPUT TABLE (EQUAL TO THE NUM-     MST00620
C  BER OF VALUES OF W/H1); R IS THE GROUND PLANE RATIO H2/H1 (FOR THE   MST00630
C  OPTION OF NO UPPER GROUND PLANE, SET R = 0.0); DIEK IS THE RELA-     MST00640
C  TIVE DIELECTRIC PERMITTIVITY K OF THE SUBSTRATE; SH1 IS THE VALUE    MST00650
C  OF S/H1; AIR TAKES ONE OF THE TWO VALUES 0.0 (SINGLE STRIP) OR       MST00660
C  1.0 (COUPLED STRIPS). THUS IN THE EXAMPLE THE OUTPUT TABLE WILL RE-  MST00670
C  FER TO THE EVEN AND ODD MODES OF COUPLED STRIPS WITH SPACING S/H1    MST00680
C  = 0.4 ON SUBSTRATE OF PERMITTIVITY K = 9.6, NO UPPER GROUND PLANE,   MST00690
C  AND WILL LIST 20 LINES, FROM W/H1 = 0.1 THROUGH W/H1 = 2.0 IN        MST00700
C  STEPS OF 0.2.                                                        MST00710
C                                                                       MST00720
C       OUTPUT - THE OUTPUT FORMAT IS ILLUSTRATED IN THE FOLLOWING      MST00730
C  TABLE SHOWING THE FIRST LINE OF OUTPUT DATA FOR THE ABOVE EXAMPLE.   MST00740
C                                                                       MST00750
C                                                                       MST00760
C   H2/H1 =  0.0     K = 9.60    COUPLED STRIPS     S/H1 = 0.4          MST00770
C                                                                       MST00780
C                                                                       MST00790
C  W/H1      ZO(E)    ZO(O)      V(E)    V(O)    K-EFF(E) K-EFF(O)      MST00800
C                 OHMS            E+08 M/SEC                            MST00810
C                                                                       MST00820
C  0.100    141.210  77.250     1.214   1.299      6.102   5.328        MST00830
C                                                                       MST00840
C                                                                       MST00850
C       SUBROUTINES REQUIRED - THE PROGRAM CALLS THREE SUBROUTINES OB-  MST00860
C  TAINED FROM THE IBM SCIENTIFIC SUBROUTINE PACKAGE (SSP). THEY ARE    MST00870
C  DGELS, SICI, AND DQG32. FOR DESCRIPTIONS AND LISTS OF THESE PROGRAMS MST00880
C  SEE THE IBM SSP MANUAL. IN ADDITION, THE PROGRAM INCLUDES FIVE SUB-  MST00890
C  ROUTINES OF ITS OWN - OUTPUT, XGEN, AMAT, MPHI, AND MGREEN AND ONE   MST00900
C  FUNCTION SUBPROGRAM  - GINT. NOTE ON THE IMPROVEMENT DATED AUG. 1,   MST00910
C  1978: THE INTEGRATION SUBROUTINE DQG32 (32-POINT GAUSSIAN QUAD-      MST00920
C  RATURE METHOD) REPLACES THE SUBROUTINE DQSF(SIMPSON'S RULE) ,        MST00930
C  RESULTING IN ACCURACY SUBSTANTIALLY BETTER THAN ONE PERCENT IN ALL   MST00940
C  CASES TESTED. REVISIONS AND TESTS PERFORMED BY R. C. LEWIS.          MST00950
C                                                                       MST00960
C       NOTE ON DIMENSION REQUIREMENTS - FOR THE DETERMINATION OF       MST00970
C  CHARGE DISTRIBUTION EACH STRIP IS DIVIDED INTO M SUBSTRIPS. IN       MST00980
C  THE PRESENT PROGRAM M = 20, BUT THE PARAMETER M CAN BE INCREASED     MST00990
C  FOR IMPROVED ACCURACY OR REDUCED FOR IMPROVED SPEED OF EXECU-        MST01000
C  TION. THE DIMENSIONS OF THE VARIABLES DEPEND ON THE VALUE OF M       MST01010
C  AS FOLLOWS -                                                         MST01020
C                                                                       MST01030
C       V(M),AUX(M-1),X(3M-1),PHI(3M-1),A(M(M+1)/2),B(M(M+1)/2)         MST01040
C                                                                       MST01050
C***********************************************************************MST01060
C                                                                       MST01070
      IMPLICIT REAL*8(A-H,O-Z)                                          MST01080
      DIMENSION V(20),AUX(19),GO(2)                                     MST01090
      COMMON/DIM/X(59),PHI(59),A(210),B(210)                            MST01100
      NAMELIST/CONST/WH1,DELW,NT,R,DIEK,SH1,AIR                         MST01110
      DATA GO/'Y','N'/                                                  MST01120
      CALL TIMES(DATE,TIME)                                             MST01130
      IV=5                                                              MST01140
      IW=1                                                              MST01150
      M=20                                                              MST01160
      N=1                                                               MST01170
      WRITE(IW,104)                                                     MST01180
  801 DO 901 NREP=1,25                                                  MST01190
      EPS=1.0E-07                                                       MST01200
      IF(NREP .EQ. 1) GO TO 91                                          MST01210
 92   WRITE(6,102)                                                      MST01220
      READ(IV,103) GOYN                                                 MST01230
      IF(GOYN .EQ. GO(1)) GO TO 91                                      MST01240
      IF(GOYN .NE. GO(1) .AND. GOYN .NE. GO(2)) GO TO 92                MST01250
      GO TO 999                                                         MST01260
 91   WRITE(6,101)                                                      MST01270
      READ(IV,CONST)                                                    MST01280
      IF(AIR) 38,7,8                                                    MST01290
 7    WRITE(IW,105) R,DIEK                                              MST01300
      WRITE(IW,106)                                                     MST01310
      GO TO 802                                                         MST01320
 8    WRITE(IW,107) R,DIEK,SH1                                          MST01330
      WRITE(IW,108)                                                     MST01340
  802 DO 902 K=1,NT                                                     MST01350
      AK=K                                                              MST01360
      WH=WH1+(AK-1.0)*DELW                                              MST01370
      CALL XGEN(M,WH,SH1)                                               MST01380
      NN=AIR+1                                                          MST01390
      ADIEK=DIEK                                                        MST01400
  803 DO 903 IJ=1,2                                                     MST01410
      IF(IJ.EQ.1) DIEK=1.0                                              MST01420
      IF(IJ.EQ.2) DIEK=ADIEK                                            MST01430
      IF(R.EQ.0.0.AND.DIEK.EQ.1.0) GO TO 39                             MST01440
      CALL MGREEN(M,WH,SH1,DIEK,R)                                      MST01450
      GO TO 804                                                         MST01460
 39   CALL MPHI(WH,M,AIR)                                               MST01470
  804 DO 903 JJ=1,NN                                                    MST01480
      CALL AMAT(AIR,M)                                                  MST01490
      DO 23 I=1,M                                                       MST01500
 23   V(I)=1.0                                                          MST01510
      IF(JJ .EQ. 1) CALL DGELS(V,A,M,N,EPS,IER,AUX)                     MST01520
      IF(JJ .EQ. 2) CALL DGELS(V,B,M,N,EPS,IER,AUX)                     MST01530
      IF(IER.NE.0) WRITE(IW,111) IER,EPS                                MST01540
 111  FORMAT(' IER= ',I3,', IN SUBROUTINE DGELS, SO THE CHARGE DENSITY  MST01550
     2  COULD NOT BE CALCULATED TO THE PRECISION OF ',E13.6,' DIGITS')  MST01560
      CAPSUM=0.0                                                        MST01570
      DO 21 I=1,M                                                       MST01580
 21   CAPSUM=CAPSUM+V(I)                                                MST01590
      CC=CAPSUM*111.256                                                 MST01600
      IF(JJ .EQ. 1 .AND. IJ .EQ. 1) CAP1E=CC                            MST01610
      IF(JJ .EQ. 1 .AND. IJ .EQ. 2) CAPKE=CC                            MST01620
      IF(JJ .EQ. 2 .AND. IJ .EQ. 1) CAP1O=CC                            MST01630
      IF(JJ .EQ. 2 .AND. IJ .EQ. 2) CAPKO=CC                            MST01640
  903 CONTINUE                                                          MST01650
      CALL OUTPUT(CAP1E,CAPKE,CAP1O,CAPKO,WH,IW,NN)                     MST01660
  902 CONTINUE                                                          MST01670
      WRITE(IW,110) DATE,TIME                                           MST01680
      WRITE(IW,199)                                                     MST01690
      GO TO 901                                                         MST01700
 38   WRITE(6,109)                                                      MST01710
  101 FORMAT(/,3X,'CONST:  WH1,DELW,NT,R,DIEK,SH1,AIR  ?',/)            MST01720
  102 FORMAT(/,3X,'CONTINUE? (''YES'' OR ''NO'')',/)                    MST01730
  103 FORMAT(A1)                                                        MST01740
  104 FORMAT('1',//,5X,'J.A. WEISS, ',                                  MST01750
     2   'ADVANCES IN MICROWAVES, VOL. 8,',/7X,'PP. 295-320; ',         MST01760
     3   'ACADEMIC PRESS, 1974.',//,10X,'PARAMETERS OF MICROSTRIP ',    MST01770
     4   'TRANSMISSION LINES',/,12X,'AND OF COUPLED PAIRS OF ',         MST01780
     5   'MICROSTRIP LINES')                                            MST01790
  105 FORMAT(//,11X,'H2/H1 = ',F6.3,5X,'K = ',F6.3,4X,'SINGLE STRIP')   MST01800
  106 FORMAT(/,10X,'W/H1',12X,'ZO',14X,'V',12X,'K-EFF',11X,'C',/,       MST01810
     2     10X,15X,'OHMS',8X,'E+08 M/SEC',23X,'PF/M',/)                 MST01820
  107 FORMAT(//3X,'H2/H1 = ',F6.3,4X,'K = ',F6.3,4X,'COUPLED STRIPS',   MST01830
     2     5X,'S/H1 = ',F5.2)                                           MST01840
  108 FORMAT(/,3X,'W/H1',6X,'ZO(E)',4X,'ZO(O)',6X,'V(E)',4X,'V(O)',4X,  MST01850
     2     'K-EFF(E) K-EFF(O)',4X,'C(E)',5X,'C(O)',/18X,'OHMS',12X,     MST01860
     3     'E+08 M/SEC',30X,'PF/M',/)                                   MST01870
  109 FORMAT(//,' AIR SHOULD BE 0.0 OR +1.0',//)                        MST01880
  110 FORMAT(//,5X,2(A8,2X),/)                                          MST01890
  199 FORMAT(///)                                                       MST01900
  901 CONTINUE                                                          MST01910
  999 CONTINUE                                                          MST01920
      CALL EXIT                                                         MST01930
      STOP                                                              MST01940
      END                                                               MST01950
C                                                                       MST01960
C                                                                       MST01970
      SUBROUTINE OUTPUT(CAP1E,CAPKE,CAP1O,CAPKO,WH,IW,NN)               MST01980
C                                                                       MST01990
      IMPLICIT REAL*8(A-H,O-Z)                                          MST02000
      DATA C/2.99792458/                                                MST02010
      EFFKE=CAPKE/CAP1E                                                 MST02020
      RKE=DSQRT(EFFKE)                                                  MST02030
      ZOE=1.0E+04/(C*CAP1E*RKE)                                         MST02040
      VELE=(1.0/RKE)*C                                                  MST02050
      IF(NN. EQ. 1) WRITE(IW,101) WH,ZOE,VELE,EFFKE,CAPKE               MST02060
      IF(NN. EQ. 1) GO TO 3                                             MST02070
      EFFKO=CAPKO/CAP1O                                                 MST02080
      RKO=DSQRT(EFFKO)                                                  MST02090
      ZOO=1.0E+04/(C*CAP1O*RKO)                                         MST02100
      VELO=(1.0/RKO)*C                                                  MST02110
      WRITE(IW,103) WH,ZOE,ZOO,VELE,VELO,EFFKE,EFFKO,CAPKE,CAPKO        MST02120
  101 FORMAT(5(5X,F10.3))                                               MST02130
  102 FORMAT(2X,F6.3,4X,F7.3,1X,F7.3,4X,F6.3,2X,F6.3,5X,F6.3,2X,F6.3)   MST02140
  103 FORMAT(2X,F6.3,4X,F7.3,1X,F7.3,4X,F6.3,2X,F6.3,5X,F6.3,2X,F6.3,   MST02150
     2     4X,F8.3,1X,F8.3)                                             MST02160
 3    RETURN                                                            MST02170
      END                                                               MST02180
C                                                                       MST02190
C                                                                       MST02200
      SUBROUTINE XGEN(M,WH,SH1)                                         MST02210
C                                                                       MST02220
      IMPLICIT REAL*8(A-H,O-Z)                                          MST02230
      COMMON/DIM/X(59),PHI(59),A(210),B(210)                            MST02240
      AM=M                                                              MST02250
      WHM=WH/AM                                                         MST02260
  801 DO 901 I=1,M                                                      MST02270
      AI=I                                                              MST02280
  901 X(I)=(AI-1.0)*WHM                                                 MST02290
      IF(SH1 .EQ. 0.0) GO TO 1                                          MST02300
      MM=2*M-1                                                          MST02310
  802 DO 902 I=1,MM                                                     MST02320
      AI=I                                                              MST02330
  902 X(I+M)=AI*WHM+SH1                                                 MST02340
 1    RETURN                                                            MST02350
      END                                                               MST02360
C                                                                       MST02370
C                                                                       MST02380
      SUBROUTINE AMAT(S,M)                                              MST02390
C                                                                       MST02400
      IMPLICIT REAL*8(A-H,O-Z)                                          MST02410
      COMMON/DIM/X(59),PHI(59),A(210),B(210)                            MST02420
  803 DO 903 I=1,M                                                      MST02430
      INDEX1=M+1-I                                                      MST02440
  804 DO 904 J=1,INDEX1                                                 MST02450
      NF1=0                                                             MST02460
  805 DO 905 K=1,J                                                      MST02470
  905 NF1=NF1+K                                                         MST02480
      NF2=0                                                             MST02490
      IF(I .LE. 2) GO TO 10                                             MST02500
      INDEX2=I-2                                                        MST02510
  806 DO 906 L=1,INDEX2                                                 MST02520
  906 NF2=NF2+L                                                         MST02530
 10   N=NF1+NF2+(I-1)*J                                                 MST02540
      INDEX3=3*M+2*(1-J)-I                                              MST02550
      A(N)=PHI(I)+S*PHI(INDEX3)                                         MST02560
      B(N)=PHI(I)-S*PHI(INDEX3)                                         MST02570
  904 CONTINUE                                                          MST02580
  903 CONTINUE                                                          MST02590
      RETURN                                                            MST02600
      END                                                               MST02610
C                                                                       MST02620
C                                                                       MST02630
      SUBROUTINE MPHI(WH,M,S)                                           MST02640
C                                                                       MST02650
      IMPLICIT REAL*8(A-H,O-Z)                                          MST02660
      COMMON/DIM/X(59),PHI(59),A(210),B(210)                            MST02670
      AM=M                                                              MST02680
      INDEX1=3*M-1                                                      MST02690
      IF(S .EQ. 0.0) INDEX1=M                                           MST02700
      EXWON=WH/(2.0*AM)                                                 MST02710
      WYWON=1.0D 00                                                     MST02720
  807 DO 907 K=1,INDEX1                                                 MST02730
      XO=X(K)                                                           MST02740
      EXP=XO+EXWON                                                      MST02750
      EXN=XO-EXWON                                                      MST02760
      WYP=2.0*WYWON                                                     MST02770
      PHI(K)=(EXN/(2.0*EXWON))*DLOG((EXN**2)/(EXN**2+WYP**2))-(EXP      MST02780
     2   /(2.0*EXWON))*DLOG((EXP**2)/(EXP**2+WYP**2))+(WYP/EXWON)       MST02790
     3   *(DATAN(EXP/WYP)-DATAN(EXN/WYP))                               MST02800
  907 CONTINUE                                                          MST02810
      RETURN                                                            MST02820
      END                                                               MST02830
C                                                                       MST02840
C                                                                       MST02850
      SUBROUTINE MGREEN(M,WH,SH1,DIEK,R)                                MST02860
C                                                                       MST02870
      IMPLICIT REAL*8(A-H,O-Z)                                          MST02880
      COMMON/DIM/X(59),PHI(59),A(210),B(210)                            MST02890
      COMMON /PASS/ R1,CO,BO,DIEK1                                      MST02900
      EXTERNAL GINT                                                     MST02910
      AM=M                                                              MST02920
      R1=R                                                              MST02930
      DIEK1=DIEK                                                        MST02940
      CO=WH/AM*0.5                                                      MST02950
      X1=5.0                                                            MST02960
      INT=2                                                             MST02970
      H=X1/DFLOAT(INT)                                                  MST02980
      IF(SH1 .EQ. 0.0) MA=M                                             MST02990
      IF(SH1 .NE. 0.0) MA=3*M-1                                         MST03000
  808 DO 908  MM=1,MA                                                   MST03010
      BO=X(MM)                                                          MST03020
      YTOT=0.0D0                                                        MST03030
      XU=0.0                                                            MST03040
      XL=0.0                                                            MST03050
C                                                                       MST03060
C       COMPUTE FIRST INTEGRAL                                          MST03070
C                                                                       MST03080
  809 DO 909 I=1,INT,1                                                  MST03090
      XU=XU+H                                                           MST03100
      CALL DQG32(XL,XU,GINT,YRESUL)                                     MST03110
      YTOT=YTOT+YRESUL                                                  MST03120
      XL=XL+H                                                           MST03130
  909 CONTINUE                                                          MST03140
      AI1=YTOT                                                          MST03150
C                                                                       MST03160
C        COMPUTE SECOND INTEGRAL                                        MST03170
C                                                                       MST03180
      S1=(CO+BO)*X1                                                     MST03190
      S2=(BO-CO)*X1                                                     MST03200
      CALL SICI(SI,CI,S1)                                               MST03210
      AI2A=DSIN(S1)/X1-(CO+BO)*CI                                       MST03220
      CALL SICI(SI,CI,S2)                                               MST03230
      AI2B=DSIN(S2)/X1-(BO-CO)*CI                                       MST03240
      AI2=AI2A-AI2B                                                     MST03250
      PHI(MM)=4.0*(AI1+1.0/((1.0+DIEK)*CO*2.0)*AI2)                     MST03260
  908 CONTINUE                                                          MST03270
      RETURN                                                            MST03280
      END                                                               MST03290
      FUNCTION GINT(U)                                                  MST03300
      IMPLICIT REAL*8(A-H,O-Z)                                          MST03310
      COMMON /PASS/ R,CO,BO,DIEK                                        MST03320
      V=(R-1.0)*U                                                       MST03330
      W1=CO*U                                                           MST03340
      W2=DCOSH(U)                                                       MST03350
      W3=DSINH(U)                                                       MST03360
      W4=DCOS(BO*U)                                                     MST03370
      IF(R .NE. 0)W4=W4*DSINH(V)                                        MST03380
      IF(R .EQ. 0)DEN=W3+DIEK*W2                                        MST03390
      IF(R .NE. 0)DEN=W3*DCOSH(V)+DIEK*W2*DSINH(V)                      MST03400
      GINT=DSIN(W1)/W1*W3/U*W4/DEN                                      MST03410
      RETURN                                                            MST03420
      END                                                               MST03430
