Water-Cooled VW Performance Handbook
Shiftpoint Optimizer — BASIC program listing
This code runs for me using PC-BASIC. Copying the following program listing and pasting into your BASIC editor should eliminate any typing errors.
100 REM SHIFTPOINT OPTIMIZER PROGRAM 105 REM Jack Broomall Racing 110 CLS 114 DIM G(30) 115 DIM R(30) 120 DIM T(30) 121 DIM A 125 PRINT "Shift Point Optimizer Program" 130 FOR A=1 TO 1000 135 NEXT A 140 CLS 145 GOTO 195 150 CLS 155 PRINT "Note: It will be necessary to re-enter all data points." 159 DIM W 160 FOR W=1 TO 30 165 R(W)=0 170 T(W)=0 175 NEXT W 180 PRINT 185 PRINT 190 GOTO 200 195 CLS 200 PRINT "Input Torque vs. RPM Information from Dyno Testing" 205 PRINT "++++++++++++++++++++++++++++++++++++++++++++++++++" 209 DIM N 210 N=1 215 PRINT "Data Point"; N 220 PRINT 225 INPUT "Engine Speed (RPM): ";R(N) 230 PRINT 235 INPUT "Engine Torque (lb/ft): ";T(N) 240 PRINT 245 CLS 250 PRINT "If you wish to enter another data point enter 1" 255 PRINT 260 PRINT "If you wish to run the program enter 2" 264 DIM I 265 INPUT "1 or 2";I 270 IF I>1 THEN 295 275 N=N+1 280 CLS 285 GOTO 215 290 CLS 295 CLS 300 PRINT "Please check that torque/RPM data points are correct" 305 PRINT 310 PRINT 315 PRINT "Data points entered this run:" 320 PRINT 325 PRINT "Data", "RPM", "Torque" 330 PRINT "Point",,"(lb/ft)" 335 PRINT "-------------------------" 339 DIM J 340 FOR J=1 TO N 345 PRINT J,R(J),T(J) 350 NEXT J 355 FOR A=1 TO 1000 360 NEXT A 365 PRINT 370 PRINT 375 PRINT "If data are correct as displayed, enter 1 to continue" 380 PRINT "If data are incorrect enter 2 to make corrections" 385 INPUT "1 or 2";I 390 IF I>1 THEN 150 395 CLS 400 GOTO 420 405 CLS 410 PRINT "Note: It will be necessary to re-enter all gearing & tire info." 415 PRINT 420 PRINT "Input Transmission Ratio Information" 425 PRINT "------------------------------------" 430 PRINT 435 PRINT "Please enter information as requested." 440 PRINT 445 INPUT "Number of forward gears: ";G 450 FOR T=1 TO G 455 IF T=1 THEN 475 460 IF T=2 THEN 495 465 IF T=3 THEN 515 470 IF T>3 THEN 535 475 PRINT 480 PRINT "First gear ratio: " 485 INPUT G(1) 490 GOTO 550 495 PRINT 500 PRINT "Second gear ratio: " 505 INPUT G(2) 510 GOTO 550 515 PRINT 520 PRINT "Third gear ratio: " 525 INPUT G(3) 530 GOTO 550 535 PRINT 540 PRINT T; "th gear ratio: " 545 INPUT G(T) 550 NEXT T 555 CLS 560 PRINT "Input differential ratio" 565 PRINT "------------------------" 570 PRINT 575 PRINT "Differential ratio: " 579 DIM D 580 INPUT D 585 CLS 590 PRINT "Input tire diameter" 595 PRINT "-------------------" 600 PRINT 605 PRINT "Tire diameter (inches): " 610 INPUT T1 615 CLS 620 PRINT "Please check that the following input data are entered correctly." 625 FOR A=1 TO 1000 630 NEXT A 635 PRINT 640 PRINT 644 DIM B 645 FOR B=1 TO G 650 PRINT "Gear " ;B; " is " ;G(B); ":1" 655 PRINT 660 NEXT B 665 PRINT "Differential ratio is ";D;":1" 670 PRINT 675 PRINT "Tire diameter is ";T1; " inches" 680 PRINT 685 FOR A=1 TO 1000 690 NEXT A 695 PRINT "If data are correct as displayed, enter 1 to continue" 700 PRINT "If data are incorrect, enter 2 to make corrections." 705 INPUT "1 or 2";I 710 IF I>1 THEN 405 715 CLS 720 PRINT "For maximum torque at front wheels, make upshifts as follows:" 725 PRINT "-------------------------------------------------------------" 729 PRINT 730 DIM U 731 DIM U2 732 DIM K 733 DIM C 734 DIM F 735 FOR F=1 TO (G-1) 740 G1=G(F) 745 G2=G(F+1) 750 FOR U=R(1) TO R(N) STEP 20 755 FOR C=1 TO (N-1) 760 IF U>=R(C) AND U<R(C+1) THEN 770 765 NEXT C 770 T2=T(C) +(T(C+1)-T(C))*((U-R(C))/(R(C+1)-R(C))) 775 T3=T2*G1*D 780 U2=U*(G(F+1)/G(F)) 785 IF U2<R(1) THEN 840 790 FOR K=1 TO (N-1) 795 IF U2>=R(K) AND U2<R(K+1) THEN 805 800 NEXT K 805 T5=T(K)+(T(K+1))*((U2-R(K))/(R(K+1)-R(K))) 810 T4=T5*G2*D 815 IF T3<T4 THEN 825 820 GOTO 850 825 PRINT "Make ";F; "-" ;(F+1); " shift at ";U; " rpm." 830 PRINT 835 GOTO 860 840 NEXT U 845 U=U-20 850 IF U=R(N) THEN 825 855 GOTO 840 860 NEXT F 865 PRINT 870 PRINT "END OF OUTPUT" 875 END