home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1
/
HamRadio.cdr
/
ant
/
antenna
/
msant.bas
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
3KB
|
126 lines
10 REM ANALYSIS PROGRAM FOR MICROSTRIP ANTENNAS
20 REM "ANTENNA DESIGN USING PERSONAL COMPUTERS"
30 REM K. CARVER'S CAVITY MODEL
40 DIM FLDA(180)
50 PI=3.141593
60 DEF FNLOG10(X)=.4343*LOG(X)
70 KEY OFF
80 SCREEN 0,1
90 CLS
100 COLOR 1,0
110 PRINT "MICROSTRIP ANTENNA ANALYSIS"
120 COLOR 4,0
130 PRINT
140 INPUT "TYPE PATCH RESONANT LENGTH(cm)";L1
150 INPUT "TYPE PATCH WIDTH(cm)";W1
160 INPUT "TYPE DIELECTRIC CONSTANT";DC
170 INPUT "TYPE SUBSTRATE THICKNESS(cm)";THK
180 INPUT "TYPE LOSS TANGENT";LT
190 IF LT<1E-08 THEN LT=1E-08
200 INPUT "TYPE DISTANCE FROM FEED PT. TO RAD. EDGE(cm)";DIST
210 COLOR 14,0
220 F1=SQR(1/(1+10*THK/W1))
230 REM EFFECTIVE DIELECTRIC CONSTANT
240 EDC=(DC+1)/2+(DC-1)/2*F1
250 REM AW=2*L1*SQR(EDC)
260 AW=2.08*L1*SQR(DC)
270 REM WALL CONDUCTANCE
280 GWL=8.360001E-03*W1/AW
290 REM EFFECTIVE LENGTH EXTENSION
300 K=.412*((EDC+.3)/(EDC-.258))*((W1/THK+.262)/(W1/THK+.813))
310 REM WALL SUSCEPTANCE
320 BWL=.01668*K*(L1/AW)*EDC
330 F=.7747+.5977*(W1/L1-1)-.1638*(W1/L1-1)^2
340 ALR=-2362*THK*BWL*F/(AW*W1)
350 ALI=2362*THK*GWL*F/(AW*W1)
360 KPR=ALR*L1
370 KPI=ALI*L1
380 DEL0=0
390 DELI=0
400 FOR N=1 TO 4
410 P=2*KPR*(PI-DEL0)+2*KPI*DEL1
420 Q=KPR*KPR-KPI*KPI+DEL1*DEL1-PI*PI+DEL0*(2*PI-DEL0)
430 R=2*KPI*(PI-DEL0)-2*KPR*DEL1
440 S=2*DEL1*(PI-DEL0)+2*KPI*KPR
450 W=(DEL0^3-DEL1^2*DEL0-2*DEL0*DEL1^2)/3
460 X=(-DEL1^3+DEL0^2*DEL1+2*DEL0^2*DEL1)/3
470 DEL0=(P*Q+R*S)/(Q*Q+S*S)-W
480 DEL1=(R*Q-S*P)/(Q*Q+S*S)-X
490 NEXT N
500 EGR=PI/L1-DEL0/L1
510 EGI=-DEL1/L1
520 FR=.5*PI*3*EGR/SQR(DC)
530 PRINT
540 PRINT USING "THE RESONANT FREQUENCY IS ###.###GHz";FR
550 Q0=EGR/(2*EGI)
560 CAP=(DC*8.85E-12*W1*L1/10000)/(2*THK/100)
570 RES=Q0/(2*PI*FR*1E+09*CAP)
580 PRINT USING "THE RADIATION RESISTANCE IS ####.## ohms";RES
590 RIN=RES*COS(PI*DIST/L1)^2
600 PRINT USING "INPUT RESISTANCE AT FEED IS ###.## ohms";RIN
610 SD=1/SQR(PI*FR*1E+09*4*PI*5.7)
620 QC=THK/100/SD
630 QD=1/LT
640 X0=1/Q0+1/QC+1/QD
650 QT=1/X0
660 VSWR=2
670 BW=(VSWR-1)/(QT*SQR(VSWR))
680 BW=100*BW
690 PRINT USING "THE BANDWIDTH IS ##.#%";BW
700 PRINT
710 COLOR 4,0
720 INPUT "DO YOU WANT TO PLOT PATTERNS(Y,N)";IP$
730 IF IP$="N" THEN GOTO 1200
740 INPUT "E-PLANE(E) OR H-PLANE(H) PATTERN";IP$
750 IF IP$="E" OR IP$="H" THEN GOTO 770
760 GOTO 740
770 FMAX=0
780 XK0=2*PI*FR/.3
790 AE=XK0*L1/200
800 AH=XK0*W1/200
810 FOR TH=0 TO 90
820 IND=TH+90
830 THR=TH*PI/180
840 STH=SIN(THR)
850 FLDA(IND)=1
860 IF STH=0 THEN GOTO 890
870 IF IP$="E" THEN FLDA(IND)=ABS(COS(AE*STH))
880 IF IP$="H" THEN FLDA(IND)=ABS(SIN(AH*STH)*COS(THR)/(AH*STH))
890 IF FLDA(IND)>FMAX THEN FMAX=FLDA(IND)
900 FLDA(180-IND)=FLDA(IND)
910 NEXT TH
920 PRINT
930 REM NORMALIZE DATA
940 FOR TH=0 TO 180
950 FM=FLDA(TH)/FMAX
960 IF FM<.0316 THEN FM=.0316
970 FLDA(TH)=20*FNLOG10(FM)
980 NEXT TH
990 REM PLOT GRID
1000 SCREEN 0,1
1010 CLS
1020 SCREEN 2,0
1030 VIEW (262,20)-(638,188)
1040 WINDOW (-1,-1)-(1,1)
1050 CIRCLE (0,0),1,,,,.45
1060 CIRCLE (0,0),.666,,,,.45
1070 CIRCLE (0,0),.333,,,,.45
1080 FOR THD=0 TO 150 STEP 30
1090 TH=THD*PI/180
1100 LINE (COS(TH),SIN(TH))-(-COS(TH),-SIN(TH))
1110 NEXT THD
1120 PSET (FLDA(0),0)
1130 FOR TH=0 TO 180
1140 THR=TH*PI/180
1150 RAD=FLDA(TH)/30+1
1160 LINE -(RAD*COS(THR),RAD*SIN(THR))
1170 NEXT TH
1180 PRINT USING "&-PLANE PATTERN";IP$
1190 GOTO 720
1200 INPUT "CONTINUE(Y,N)";ST$
1210 IF ST$<>"N" THEN GOTO 80
1220 SCREEN 0,1
1230 COLOR 7,0
1240 KEY ON
1250 END