HP Forums

Full Version: (71B) Automotive Cylinders: Calculating Displacement and Piston Speed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
Reference URL's