Cardwell.bas (C) 2005 John Fields This program plots the capacitance change and the change in frequency and wavelength (if used in a resonant circuit) VS rotation of the plates of a Cardwell variable capacitor with wedge shaped plates. The rotation of the capacitor is represented on the abscissa and varies from 0° to 180° The capacitance is represented on the ordinate, with a range of from 0 to 1000pF Frequency and wavelength are normalized, plotted on the linear grid, and scaled for convenience of display. SCREEN 12 x = 65536 * 63 + 256 * 63 + 63 PALETTE 0, x WINDOW (0, 0)-(800, 600) start: CLS rot = 800 / 180 '1ø = 4.44 pixels Cmax = 600 '600 pixels = 600pF ka = .014 'square inches per degree of mesh kd = .0482 / 180 'plate separation per degree of mesh cmin = 20 'unmeshed capacitance a = 0 'area of plates d = 0 'distance between plates r = 0 'degrees of rotation c = 0 'capacitance COLOR 8 LOCATE 30, 1 PRINT "0 deg" LOCATE 30, 31 PRINT "<-----rotation----->" LOCATE 30, 74 PRINT "180 deg" LINE (0, 0)-(800, 0) LINE (800, 0)-(800, 600) LINE (800, 600)-(0, 600) LINE (0, 600)-(0, 0) x = 60 WHILE x < 660 LINE (0, x)-(800, x) x = x + 60 WEND x = 80 WHILE x < 560 LINE (x, 0)-(x, 540) x = x + 80 WEND WHILE x < 880 LINE (x, 0)-(x, 600) x = x + 80 WEND loop1: COLOR 4 'red LOCATE 1, 10 PRINT "CAPACITANCE" a = ka * r s = .07 - (kd * r) c = cmin + (3.15 * a) / s PSET ((rot * r), c) 'plot capacitance VS rotation COLOR 2 'green LOCATE 2, 10 PRINT "FREQUENCY" f = 2700 * (1 / (SQR(c))) PSET ((rot * r), f) 'plot frequency VS rotation COLOR 1 'blue LOCATE 3, 10 PRINT "WAVELENGTH" p = 30 * (SQR(c)) PSET ((rot * r), p) 'plot wavelength VS rotation r = r + 1 'increment rotation by 1° IF r > 180 THEN GOTO finish GOTO loop1 finish: COLOR 8 LOCATE 3, 34 PRINT "Press any key to exit." kblpa: a$ = INKEY$ IF a$ = "" THEN GOTO kblpa END