home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
hamradio
/
mininec3.arc
/
MNPOST.BAS
< prev
next >
Wrap
BASIC Source File
|
1986-12-08
|
11KB
|
345 lines
1 REM **** MININEC POST PROCESSOR **** NOSC CODE 822 JCL 12-8
2 DIM EX(300,4),EY(300,4),EZ(300,4),EP(300),N(100),P(400),X(400,3),Z(1600,2)
3 CLS
4 COLOR 2,0
5 PRINT " ++++ MININEC POST-PROCESSOR ++++"
6 PRINT :INPUT "MININEC OUTPUT DATA FILE (name.OUT) ";F$
7 T$=RIGHT$(F$,4)
8 IF LEFT$(T$,1) = "." THEN 10
9 F$=F$+".OUT"
10 OPEN F$ FOR INPUT AS #1
11 INPUT #1,I,P0,G$
12 IF G$="C" THEN GOSUB 19
13 IF (G$="D" OR G$="V") THEN GOSUB 189
14 IF (G$="E" OR G$="H") THEN GOSUB 120
15 PRINT :INPUT "CONTINUE (Y/N) ";G$
16 IF LEFT$(G$,1)="Y" THEN 3
17 GOTO 344
18 REM --- PROCESS CURRENT DATA ----
19 J=0
20 K=0
21 FOR L=1 TO I
22 J=J+1
23 EX(L,1)=J
24 K=K+1
25 INPUT #1,EY(J,1),EY(J,2),EY(J,3),EY(J,4)
26 IF EY(J,1)+EY(J,2)+EY(J,3)+EY(J,4)=4 THEN 29
27 J=J+1
28 GOTO 24
29 N(L)=K-1
30 J=J-1
31 K=0
32 EX(L,2)=J
33 NEXT L
34 CLOSE #1
35 REM --- DISPLAY DATA ----
36 P=0
37 K=1
38 L=1
39 N1=1
40 GOSUB 109
41 PRINT :INPUT "DISPLAY ANOTHER WIRE (Y/N) ";C$
42 IF LEFT$(C$,1)="N" THEN 46
43 L=L+1
44 IF L>I THEN 38
45 GOTO 40
46 PRINT
47 PRINT " ++++ SELECT PLOT DATA ++++"
48 PRINT: PRINT "ORDINATE DATA:"
49 IF I=1 THEN 55
50 P=P+1
51 PRINT :PRINT "NUMBER OF WIRES = ";I
52 PRINT :INPUT "USE DATA FROM WHICH WIRE ";W
53 IF (W<1 OR W>I) THEN 51
54 P(P)=N(W)
55 PRINT : PRINT "DATA TYPE: 1 - REAL"
56 PRINT " 2 - IMAGINARY"
57 PRINT " 3 - MAGNITUDE"
58 PRINT " 4 - PHASE"
59 INPUT "ENTER CHOICE ";C
60 IF (C<0 OR C>4) THEN 55
61 PRINT : PRINT "ABSCISSA DATA:
62 PRINT : PRINT " 1 - PULSE POSITION ON WIRE"
63 PRINT " 2 - DISTANCE (m) ALONG WIRE"
64 INPUT "ENTER CHOICE ";J
65 IF (J<1 OR J>2) THEN 61
66 ON J GOSUB 79,90
67 PRINT :PRINT "ADD MORE DATA FROM FILE ";F$;" (Y/N)";
68 INPUT C$
69 IF LEFT$(C$,1)="N" THEN 74
70 Z(K,1)=1.234
71 Z(K,2)=-1.234
72 K=K+1
73 GOTO 38
74 Z(K,1)=-1.234
75 Z(K,2)=-1.234
76 GOSUB 275
77 RETURN
78 REM ---- ABSCISSA TYPE (J=1) ----
79 N1=EX(W,1)
80 N2=EX(W,2)
81 N3=0
82 FOR L=N1 TO N2
83 Z(K,1)=N3
84 Z(K,2)=EY(L,C)
85 K=K+1
86 N3=N3+1
87 NEXT L
88 RETURN
89 REM ---- ABSCISSA TYPE (J=2) ----
90 N1=EX(W,1)
91 N2=EX(W,2)
92 PRINT : PRINT "COORDINATES OF WIRE ";W
93 INPUT " END1 (X,Y,Z) ";X1,Y1,Z1
94 INPUT " END2 (X,Y,Z) ";X2,Y2,Z2
95 S=(X2-X1)*(X2-X1)+(Y2-Y1)*(Y2-Y1)+(Z2-Z1)*(Z2-Z1)
96 IF S>0 THEN 99
97 PRINT "WIRE LENGTH = 0"
98 GOTO 92
99 S=SQR(S)/N(W)
100 X=0
101 FOR L=N1 TO N2
102 Z(K,1)=X
103 Z(K,2)=EY(L,C)
104 X=X+S
105 K=K+1
106 NEXT L
107 RETURN
108 REM ---- DISPLAY CURRENTS ----
109 PRINT : PRINT "TOTAL POWER RADIATED = ";P0;" WATTS"
110 PRINT :PRINT "WIRE NUMBER ";L;":"
111 PRINT "REAL","IMAGINARY","MAGNITUDE","PHASE"
112 PRINT " NO. ","(AMPS)","(AMPS)","(DEGREES)"
113 N1=EX(L,1)
114 N2=EX(L,2)
115 FOR J=N1 TO N2
116 PRINT EY(J,1),EY(J,2),EY(J,3),EY(J,4)
117 NEXT J
118 RETURN
119 REM --- PROCESS NEAR FIELD DATA ----
120 FOR L=1 TO I
121 INPUT #1, EX(L,1),EX(L,2),EX(L,3),EX(L,4)
122 INPUT #1, EY(L,1),EY(L,2),EY(L,3),EY(L,4)
123 INPUT #1, EZ(L,1),EZ(L,2),EZ(L,3),EZ(L,4)
124 INPUT #1, EP(L),P(L)
125 INPUT #1, X(L,1),X(L,2),X(L,3)
126 NEXT L
127 CLOSE #1
128 REM --- DISPLAY DATA ----
129 L=1
130 GOSUB 176
131 PRINT :INPUT "DISPLAY ANOTHER FIELD POINT (Y/N) ";C$
132 IF LEFT$(C$,1)="N" THEN 136
133 L=L+1
134 IF L>I THEN L=1
135 GOTO 130
136 L1=1 :L2=I
137 PRINT :PRINT " ++++ SELECT PLOT DATA ++++"
138 PRINT :INPUT "ABSCISSA DATA (X/Y/Z) ";A$
139 A$=LEFT$(A$,1)
140 M=0
141 IF A$="X" THEN M=1
142 IF A$="Y" THEN M=2
143 IF A$="Z" THEN M=3
144 IF M=0 THEN 137
145 N=0
146 PRINT :PRINT "ORDINATE DATA: X = X-COMPONENT"
147 PRINT " Y = Y-COMPONENT"
148 PRINT " Z = Z-COMPONENT"
149 PRINT " P = MAXIMUM OR PEAK VALUE"
150 INPUT "ENTER CHOICE OF FIELD COMPONENT (X/Y/Z/P) ";D$
151 D$=LEFT$(D$,1)
152 IF D$="P" THEN 163
153 PRINT "DATA TYPE:"
154 PRINT " 1 - REAL"
155 PRINT " 2 - IMAGINARY"
156 PRINT " 3 - MAGNITUDE"
157 PRINT " 4 - PHASE"
158 INPUT "CHOICE:";J
159 IF D$="X" THEN 164
160 IF D$="Y" THEN 165
161 IF D$="Z" THEN 166
162 GOTO 146
163 FOR L=L1 TO L2 :N=N+1 :Z(L,1)=X(N,M) :Z(L,2)=EP(N) :NEXT L :GOTO 167
164 FOR L=L1 TO L2 :N=N+1 :Z(L,1)=X(N,M) :Z(L,2)=EX(N,J) :NEXT L :GOTO 167
165 FOR L=L1 TO L2 :N=N+1 :Z(L,1)=X(N,M) :Z(L,2)=EY(N,J) :NEXT L :GOTO 167
166 FOR L=L1 TO L2 :N=N+1 :Z(L,1)=X(N,M) :Z(L,2)=EZ(N,J) :NEXT L
167 L2=L2+1
168 PRINT :PRINT "ADD MORE DATA FROM FILE '";F$;"' (Y/N) ";
169 INPUT C$
170 IF LEFT$(C$,1)="N" THEN 172
171 Z(L2,1)=1.234 :Z(L2,2)=-1.234 :L1=L2+1 :L2=L2+I :GOTO 137
172 Z(L2,1)=-1.234 :Z(L2,2)=-1.234
173 GOSUB 275
174 RETURN
175 REM --- DISPLAY NEAR FIELD DATA ----
176 PRINT :PRINT " *** NEAR FIELD DATA FROM FILE '";F$;"' ***"
177 PRINT :PRINT " FIELD POINT: X = ";X(L,1);", Y = ";X(L,2);", Z = ";X(L,3)
178 PRINT "VECTOR","REAL","IMAGINARY","MAGNITUDE","PHASE"
179 IF G$="E" THEN PRINT "COMPONENT","(V/M)","(V/M)","(V/M)","(DEG)"
180 IF G$="H" THEN PRINT "COMPONENT","(AMPS/M)","(AMPS/M)","(AMPS/M)","(DEG)"
181 PRINT "X",EX(L,1),EX(L,2),EX(L,3),EX(L,4)
182 PRINT "Y",EY(L,1),EY(L,2),EY(L,3),EY(L,4)
183 PRINT "Z",EZ(L,1),EZ(L,2),EZ(L,3),EZ(L,4)
184 IF G$="E" THEN PRINT "MAXIMUN OR PEAK FIELD = ";EP(L);" V/M"
185 IF G$="H" THEN PRINT "MAXIMUN OR PEAK FIELD = ";EP(L);" AMPS/M"
186 PRINT "RADIATED POWER = ";P(L);" WATTS"
187 RETURN
188 REM --- PROCESS PATTERN DATA ---
189 IF G$="V" THEN 196
190 REM INPUT DATA IN DB
191 FOR L=1 TO I
192 INPUT #1, X(L,1),X(L,2),EX(L,1),EX(L,2),EX(L,3)
193 NEXT L
194 REM INPUT DATA IN V/M
195 GOTO 200
196 INPUT #1, R0
197 FOR L=1 TO I
198 INPUT #1, X(L,1),X(L,2),EX(L,1),EX(L,2),EY(L,1),EY(L,2)
199 NEXT L
200 CLOSE #1
201 REM --- DISPLAY DATA ----
202 J=1 :K=10 :IF K>I THEN K=I
203 IF G$="D" THEN GOSUB 231
204 IF G$="V" THEN GOSUB 237
205 PRINT :INPUT "DISPLAY MORE PATTERN DATA (Y/N) ";C$
206 IF LEFT$(C$,1)="N" THEN 211
207 IF K=I THEN 202
208 J=K :K=K+10 :IF J>I THEN J=K-9
209 IF K>I THEN K=I
210 GOTO 203
211 L1=1 :L2=I
212 PRINT :PRINT " ++++ SELECT PLOT DATA ++++"
213 PRINT :INPUT "ABSCISSA DATA: (Theta/Phi) ";A$
214 A$=LEFT$(A$,1)
215 M=0
216 IF A$="T" THEN M=1
217 IF A$="P" THEN M=2
218 N=0
219 IF M=0 THEN 212
220 IF G$="D" THEN GOSUB 251
221 IF G$="V" THEN GOSUB 261
222 L2=L2+1
223 PRINT :PRINT "ADD MORE DATA FROM FILE '";F$;"' (Y/N) ";
224 INPUT C$
225 IF LEFT$(C$,1)="N" THEN 227
226 Z(L2,1)=1.234 :Z(L2,2)=-1.234 :L1=L2+1 :L2=L2+I :GOTO 212
227 Z(L2,1)=-1.234 :Z(L2,2)=-1.234
228 GOSUB 275
229 RETURN
230 REM --- DISPLAY PATTERN DATA (DBI) ---
231 PRINT :PRINT " RADIATION PATTERN DATA"
232 PRINT :PRINT "ZENITH","AZIMUTH","VERTICAL","HORIZONTAL","TOTAL"
233 PRINT "(THETA)","(PHI)","PATTERN (dB)","PATTERN (dB)","PATTERN (dB)"
234 FOR L=J TO K :PRINT X(L,1),X(L,2),EX(L,1),EX(L,2),EX(L,3) :NEXT L
235 RETURN
236 REM ---- DISPLAY PATTERN DATA (V/M) ---
237 PRINT :PRINT " RADIATION PATTERN DATA"
238 PRINT :PRINT "RADIAL DISTANCE = ";R0;" METERS"
239 PRINT "POWER LEVEL = ";P0;" WATTS"
240 PRINT :PRINT" ZENITH AZIMUTH"," E(THETA) "," E(PHI)"
241 PRINT "(THETA) (PHI)","MAG(V/M) PHASE(DEG)","MAG(V/M) PHASE(DEG)"
242 FOR L=J TO K
243 PRINT USING "###.## ";X(L,1),X(L,2);
244 PRINT USING " ##.###^^^^";EX(L,1);
245 PRINT USING " ###.## ";EX(L,2);
246 PRINT USING " ##.###^^^^";EY(L,1);
247 PRINT USING " ###.##";EY(L,2)
248 NEXT L
249 RETURN
250 REM --- SAVE PATTERN DATA (BDI) ---
251 PRINT :INPUT "ORDINATE DATA (Vertical/Horizontal/Total) ";D$
252 D$=LEFT$(D$,1)
253 J=0
254 IF D$="V" THEN J=1
255 IF D$="H" THEN J=2
256 IF D$="T" THEN J=3
257 IF J=0 THEN 259
258 FOR L=L1 TO L2 :N=N+1 :Z(L,1)=X(N,M) :Z(L,2)=EX(N,J) :NEXT L
259 RETURN
260 REM --- SAVE PATTERN DATA (V/M) ---
261 PRINT :PRINT "ORDINATE DATA: T = E-THETA COMPONENT"
262 PRINT " P = E-PHI COMPONENT"
263 INPUT "ENTER CHOICE OF COMPONENT (ET/EP) ";D$
264 D$=LEFT$(D$,1)
265 PRINT :PRINT "DATA TYPE: 1 - MAGINTUDE"
266 PRINT " 2 - PHASE"
267 INPUT "CHOICE:";J
268 IF D$="T" THEN 271
269 IF D$="P" THEN 272
270 GOTO 273
271 FOR L=L1 TO L2 :N=N+1 :Z(L,1)=X(N,M) :Z(L,2)=EX(N,J) :NEXT L :GOTO 273
272 FOR L=L1 TO L2 :N=N+1 :Z(L,1)=X(N,M) :Z(L,2)=EY(N,J) :NEXT L
273 RETURN
274 REM ---FIND MAX & MIN ---
275 PRINT :PRINT "PLOT FORMAT: 1 - ONE ORDINATE SCALE"
276 PRINT " 2 - TWO ORDINATE SCALES"
277 PRINT " 3 - POLAR OR SMITH CHART"
278 INPUT "ENTER CHOICE ";C :PRINT
279 IF (C<1 OR C>3) THEN 275
280 IF C=2 THEN PRINT "--- TWO CURVES IS ASSUMED ---"
281 L1=1 :L2=I
282 IF G$="C" THEN 299
283 XL=9.999999E+35 :XH=-9.999999E+35
284 YL=9.999999E+35 :YH=-9.999999E+35
285 FOR L=L1 TO L2
286 IF Z(L,1)<XL THEN XL=Z(L,1)
287 IF Z(L,1)>XH THEN XH=Z(L,1)
288 IF Z(L,2)<YL THEN YL=Z(L,2)
289 IF Z(L,2)>YH THEN YH=Z(L,2)
290 NEXT L
291 L2=L2+1
292 IF Z(L2,1)=-1.234 THEN 316
293 IF C><2 THEN 297
294 Y1=YL :Y2=YH
295 L1=L2+1 :L2=L2+I
296 GOTO 284
297 L1=L2+1 :L2=L2+I :GOTO 285
298 REM --- CURRENTS MAX & MIN ---
299 IF C<>2 THEN 303
300 IF P=2 THEN 303
301 PRINT:PRINT "BUT, THERE ARE ";P;" CURVES"
302 GOTO 275
303 XL=9.999999E+35 :XH=-9.999999E+35
304 YL=9.999999E+35 :YH=-9.999999E+35
305 FOR J=1 TO P
306 L2=L1+P(J)-1
307 FOR L=L1 TO L2
308 IF Z(L,1)<XL THEN XL=Z(L,1)
309 IF Z(L,1)>XH THEN XH=Z(L,1)
310 IF Z(L,2)<YL THEN YL=Z(L,2)
311 IF Z(L,2)>YH THEN YH=Z(L,2)
312 NEXT L
313 L1=L2+2
314 NEXT J
315 L2=K
316 PRINT :PRINT " ","MINIMUM","MAXIMUM"
317 PRINT "ABSCISSA",XL,XH
318 IF C=2 THEN PRINT "ORDINATE",Y1,Y2," (LEFT SIDE)"
319 PRINT "ORDINATE",YL,YH
320 IF C=3 THEN 332
321 PRINT :INPUT "CHANGE ABSCISSA RANGE (Y/N) ";C$
322 IF LEFT$(C$,1)="N" THEN 325
323 INPUT "NEW LOWER LIMIT = ";XL
324 INPUT "NEW UPPER LIMIT = ";XH
325 PRINT :INPUT "CHANGE ORDINATE RANGE (Y/N) ";C$
326 IF LEFT$(C$,1)="N" THEN 332
327 IF C><2 THEN 330
328 INPUT "NEW LOWER LIMIT (LEFT SIDE) = ";Y1
329 INPUT "NEW UPPER LIMIT (LEFT SIDE) = ";Y2
330 INPUT "NEW LOWER LIMIT = ";YL
331 INPUT "NEW UPPER LIMIT = ";YH
332 PRINT :INPUT "PLOT DATA FILE (name.DAT) ";F$
333 T$=RIGHT$(F$,4)
334 IF LEFT$(T$,1) = "." THEN 336
335 F$=F$+".DAT"
336 OPEN F$ FOR OUTPUT AS #1
337 IF C=1 THEN PRINT #1, XL;",";XH;",";YL;",";YH
338 IF C=2 THEN PRINT #1, XL;",";XH;",";Y1;",";Y2;",";YL;",";YH
339 FOR L=1 TO L2
340 PRINT #1, Z(L,1);",";Z(L,2)
341 NEXT L
342 CLOSE #1
343 RETURN
344 SYSTEM
R