100 ! PULSE.PGM - 18 MAR 97 110 ! Algorithm computes injector-open time for stoichiometric combustion. 120 ! This is intended to be demonstrative, not efficient. STP is assumed. 130 IMAGE ###.## Cfm ##.## ml/sec ##.# l/h 140 ! 150 DISPLAY ERASE ALL,"Displacement (in):";CUBES;:ACCEPT AT(20)SIZE(-5),CUBES 160 DISPLAY ERASE ALL," Rpm:";RPM;:ACCEPT AT(7)SIZE(-4),RPM 170 DISPLAY ERASE ALL," MAP (inches of H2O):";MAP;:ACCEPT AT(23)SIZE(-5),MAP 180 ! 190 CFM=(CUBES/2)*RPM*(MAP/406.8)/1728! 200 ! 210 ! CUBES/2 because it's a four cycle. 14.7 psi = 406.8 inches of water. 220 ! 1728 cubic inches = 1 cubic foot. 230 ! 240 FUEL_VOL=CFM*1728/8850! ; cubic inches of fuel per min 250 FUEL=FUEL_VOL*16.3871/60! ; fuel in ml/sec 260 HOUR=INT((FUEL*3.6)*10^1+.5)/10^1! ; fuel consumption per hour 270 ! 280 DISPLAY ERASE ALL,USING,130 INT(CFM*100+.5)/100;INT(FUEL*100+.5)/100;HOUR 290 PAUSE 300 ! 310 IMAGE " Inj: .#### sec .### cycle" 320 ! 330 DISPLAY ERASE ALL,"Orifice dia (in) : ";D;! ; injector nozzle diameter 340 ACCEPT AT(21)SIZE(-4),D 350 ! 360 CD=1! Coefficient of discharge. This has to do with flow through small 370 ! orifices at lower pressures than we are concerned with here. 380 W=45! ; fuel density in lbs/ft^3 390 DISPLAY ERASE ALL,"Fuel pressure (psi):";FUEL_P; 400 ACCEPT AT(22)SIZE(-5),FUEL_P! ; usually 30-32 psi 410 DELTA_P=(FUEL_P*27.6807)+MAP! ; convert to inches of H2O 420 A=PI*(D/2)^2! ; injector nozzle area 430 F=CD*A*(10.4*32.2*W*DELTA_P)^(1/2)! ; fuel flow in lbs/sec 440 F_VOL=F*628.64! ; vol in ml/sec 450 PULSE=FUEL/F_VOL! ; injector open time 460 TIME=2/(RPM/60)! ; 1 complete 4-cycle 470 ! 480 DISPLAY ERASE ALL,USING,310 INT(PULSE*10^4+.5)/10^4,INT(TIME*10^3+.5)/10^3 490 PAUSE 500 DISPLAY ERASE ALL," Vol eff:";INT((MAP*100/406)*10+.5)/10;"%" 510 PAUSE:GOTO 150 520 ! 530 ! The INT() functions in the DISPLAY statements round the values 540 ! to N significant digits as follows: 550 ! 560 ! ROUNDED_VALUE=INT(VALUE*10^N+.5)/10^N 570 ! 580 ! Anything after a ! is a comment and does not need to be entered to RUN. 590 ! 600 DISPLAY ERASE ALL," Rpm:";RPM;:ACCEPT AT(7)SIZE(-6),RPM 601 IMAGE #####. 610 DISPLAY ERASE ALL," In duration @ .050 :";DUR;:ACCEPT AT(23)SIZE(-4),DUR 620 TIME=10^6/(RPM/60)! ; in microseconds 630 IN_OPEN=TIME*DUR/360 640 DISPLAY ERASE ALL," In open:";INT(IN_OPEN+.5);"uS"; 645 DISPLAY " 1";CHR$(223);":";INT((TIME/360)+.5);"uS" 660 PAUSE:GOTO 600