HP Forums
(71B) Automotive Cylinders: Calculating Displacement and Piston Speed - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (71B) Automotive Cylinders: Calculating Displacement and Piston Speed (/thread-7462.html)



(71B) Automotive Cylinders: Calculating Displacement and Piston Speed - Eddie W. Shore - 12-23-2016 07:16 PM

Automotive Cylinders: Calculating Displacement and Piston Speed

The program supplies default values which can be accepted or changed.

Program AUTOCYN
217 Bytes, 12/22/2016

Code:
10 DESTROY N,B,S,R,E,P
15 INPUT “# CYLINDERS:”,  “6”; N
20 INPUT “BORE (IN):”, “4”; B
25 INPUT “STROKE (IN):”, “4”; S
30 E = PI/4 * B^2 * S * N
35 INPUT “RPM:”; R
40 P = S * R / 6
45 DISP “ENGINE DISPLACEMENT =” @ WAIT 1
50 DISP E; “ IN^3” @ PAUSE
55 DISP “PISTON SPEED =” @ WAIT 1
60 DIPS P; “FPM”

Example 1:
N = 6 cylinders, B = 4 in, S = 4 in, RPM = 3500
Output: E ≈ 301.59290 in^3, P ≈ 2333.33333 FPM

Example 2:
N = 6 cylinders, B = 4 in, S = 3 in, RPM = 4500
Output: E ≈ 226.19467 in^3, P = 2250 FPM