Showing posts with label HP 20S. Show all posts
Showing posts with label HP 20S. Show all posts

Sunday, August 24, 2025

HP 20S: Acoustics Programs

HP 20S: Acoustics Programs


Program A: Speed of Sound in Dry Air


cs = 20.05 × √(273.15 + T°C)


Code:

01: 61, 41, A: LBL A

02: 75: +

03: 2: 2

04: 7: 7

05: 3: 3

06: 73: .

07: 1: 1

08: 5: 5

09: 74: =

10: 11: √

11: 55: ×

12: 2: 2

13: 0: 0

14: 73: .

15: 0: 0

16: 5: 5

17: 74: =

18: 61, 25: RTN



Program B: Mersenne's Law: Fundamental Frequency



f0 = √(F ÷ µ) ÷ (2 × L)

F: force (N)

µ: mass per unit length (kg/m)

L: string length (m)

f0: fundamental frequency (Hz)

(Marshall, pg. 19)



Store before running:

R1: force

R2: µ

R3: L



Code (continuing from the previous section):

19: 61, 41, b: LBL B

20: 33: (

21: 22, 1: RCL 1

22: 45: ÷

23: 22, 2: RCL 2

24: 34: )

25: 11: √

26: 45: ÷

27: 33: (

28: 2: 2

29: 55: ×

30: 22, 3: RCL 3

31: 34: )

32: 74: =

33: 61, 26: RTN



Program C: Standing Wavelength in an Open Pipe for the 1st through 5th Harmonic



λ = 2 × L ÷ n

L: length of the pipe

n: nth harmonic (positive integer)

(Marshall, pg. 21)



Code (continuing from the previous section):

34: 61, 41, C: LBL C

35: 21, 1: STO 1

36: 1: 1

37: 21, 2: STO 2

38: 61, 41, 3: LBL 3

39: 2: 2

40: 55: ×

41: 22, 1: RCL 1

42: 45: ÷

43: 22, 2: RCL 2

44: 74: =

45: 26: R/S

46: 1: 1

47: 21, 75, 2: STO+ 2

48: 22, 2: RCL 2

49: 31: INPUT

50: 5: 5

51: 61, 42: x≤y?

52: 51, 41, 3: GTO 3

53: 61, 26: RTN



Program D: Finding the perfect length and height for recording studios given the width.



Length = W × φ (stored in R1)

Width = W (stored in R2)

Height = W ÷ φ (stored in R3)

φ = (1 + √5) ÷ 2

(Marshall, pg. 34)



Code (continuing from the previous section):

54: 61, 41, d: LBL D

55: 21, 1: STO 1

56: 22, 2: STO 2

57: STO 3: STO 3

58: 33: (

59: 1: 1

60: 75: +

61: 5: 5

62: 11: √

63: 34: )

64: 45: ÷

65: 2: 2

66: 74: =

67: 21, 55, 1: STO× 1

68: 21, 45, 3: STO÷ 3

69: 22, 1: RCL 1

70: 26: R/S

71: 22, 2: RCL 2

72: 26: R/S

73: 22, 3: RCL 3

74: 61, 26: RTN


HP 20S - The Complete Code:

01: 61, 41, A: LBL A

02: 75: +

03: 2: 2

04: 7: 7

05: 3: 3

06: 73: .

07: 1: 1

08: 5: 5

09: 74: =

10: 11: √

11: 55: ×

12: 2: 2

13: 0: 0

14: 73: .

15: 0: 0

16: 5: 5

17: 74: =

18: 61, 25: RTN

19: 61, 41, b: LBL B

20: 33: (

21: 22, 1: RCL 1

22: 45: ÷

23: 22, 2: RCL 2

24: 34: )

25: 11: √

26: 45: ÷

27: 33: (

28: 2: 2

29: 55: ×

30: 22, 3: RCL 3

31: 34: )

32: 74: =

33: 61, 26: RTN

34: 61, 41, C: LBL C

35: 21, 1: STO 1

36: 1: 1

37: 21, 2: STO 2

38: 61, 41, 3: LBL 3

39: 2: 2

40: 55: ×

41: 22, 1: RCL 1

42: 45: ÷

43: 22, 2: RCL 2

44: 74: =

45: 26: R/S

46: 1: 1

47: 21, 75, 2: STO+ 2

48: 22, 2: RCL 2

49: 31: INPUT

50: 5: 5

51: 61, 42: x≤y?

52: 51, 41, 3: GTO 3

53: 61, 26: RTN

54: 61, 41, d: LBL D

55: 21, 1: STO 1

56: 22, 2: STO 2

57: STO 3: STO 3

58: 33: (

59: 1: 1

60: 75: +

61: 5: 5

62: 11: √

63: 34: )

64: 45: ÷

65: 2: 2

66: 74: =

67: 21, 55, 1: STO× 1

68: 21, 45, 3: STO÷ 3

69: 22, 1: RCL 1

70: 26: R/S

71: 22, 2: RCL 2

72: 26: R/S

73: 22, 3: RCL 3

74: 61, 26: RTN


Examples


LBL A:

Input: T = 0°C: Speed of sound: 331.371367011 m/s

Input: T = 10°C (50°F): Speed of sound: 337.82583835 m/s

Input: T = 26.66666667 (80°F) C: Speed of sound: 347.170058532 m/s



LBL B:

R1: 45 N, R2: 0.008 kg, R3: 0.06 m; f: 625 Hz

R1: 3 N, R2: 0.006 kg, R3: 0.058 m; f: 192.764480819 Hz



LBL C:

Open ended pipe length: 1.2 m

The wavelengths for the 1st, 2nd, 3rd, 4th, and 5th harmonics respectively:

2.4, 1.2, 0.8, 0.6, 0.48

Open ended pipe length: 0.059 m

The wavelengths for the 1st, 2nd, 3rd, 4th, and 5th harmonics respectively:

0.118, 0.059, 3.933333333E-2, 0.0295, 0.0236



LBL D:

Width: 12 ft; Length: 19.416407865 ft, Height: 7.416407865 ft

Width: 18 ft 6 in = 18.5 ft; Length: 29.9336287919 ft, 11.4336287919 ft



Source

Marshall, Steve. Acoustics: The Art of Sound. Wooden Books, LLC. San Rafael, California. 2023. ISBN 978-1-952178-33-7


Eddie


All original content copyright, © 2011-2025. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.


The author does not use AI engines and never will.

Saturday, March 22, 2025

HP 20S - Normal Distribution, Direction Cosine, Fire Friction Loss

HP 20S - Normal Distribution, Direction Cosine, Fire Friction Loss


HP 20S Normal Distribution


Goal: To estimate the area of the normal curve


∫( e^(-x^2 / 2) dx, a, b) / √(2 * π)


Steps:

1. Enter the programming editor: [ <| ] [ R/S ] {PRGM}

2. Load the integration program: [ <| ] [ ← ] {LOAD} [ e^x ] { B }. The screen shows “int”.

3. Go one up one step to get to Step 58: [ <| ] [ 8 ] { ↑ }

4. Enter the program after 58: 61, 41, F (LBL F)

51, 11

x^2

45

÷

2

2

74

=

32

±

12

e^x

45

÷

33

(

2

2

55

×

61, 22

π

34

)

11

74

=


5. Store the lower limit in register 5: a [ STO ] [ 5 ]

6. Store the upper limit in register 6: b [ STO ] [ 6 ]

7. Enter the number of intervals, it must be an even integer, and execute label A: n [ XEQ ] [ √ ] { A }


Example

At n = 20 intervals, estimate areas (ALL setting)

a = 0, b = 3; area ≈ 0.498649878

a = -3, b = 3; area ≈ 0.997293118

a = -1, b = 2; area ≈ 0.818595675



HP 20S: Direction Cosines


The direction cosines of 3D vector v = [x, y, z] are:


a = arccos(x / norm(v))

b = arccos(y / norm(v))

c = arccos(z / norm(v))

where norm(v) = √( x^2 + y^2 + z^2 )


The following program sets the angle mode to degrees, however, a change in the second step will allow the user to use radians or grads instead. The program uses the rectangular to polar conversion to obtain the norm.


Math note:

Find the magnitude of (√(x^2 + y^2), z).


magnitude

= √( [√(x^2 + y^2)]^2 + z^2 )

= √( x^2 + y^2 + z^2)

= norm(v)


Executing the →P command gives the angle first. Obtaining the magnitude requires a swap. ( [ <| ] [ INPUT ] {SWAP} ).


61, 41, b

LBL B

61, 23

DEG (61, 24 for RAD, 61, 25 for GRD)

22, 1

RCL 1

31

INPUT

22, 2

RCL 2

51, 21

→ P

51, 31

SWAP

31

INPUT

22, 3

RCL 3

51, 21

→ P

51, 31

SWAP

21, 4

STO 4

22, 1

RCL 1

41, C

XEQ C

26

R/S

22, 2

RCL 2

41, C

XEQ C

26

R/S

22, 3

RCL 3

41, C

XEQ C

61, 26

RTN

61, 41, C

LBL C (subroutine)

45

÷

22, 4

RCL 4

74

=

51, 24

ACOS

61, 26

RTN


Store x in register 1, y in register 2, and z in register 3. The angles are shown in order


Examples (FIX 4):


x = 4, y = 8, z = 5

Direction Cosines: a ≈ 67.0231°, b ≈ 38.6734°, c ≈ 60.7941°


x = -3, y = 8, z = 6

Direction Cosines: a ≈ 106.6992°, b ≈ 39.9807°, c ≈ 54.9217°


Source:

“Direction Cosine” Wikipedia. Accessed November 5, 2024. https://en.wikipedia.org/wiki/Direction_cosine




HP 20S: Determining the Coefficient for Friction Loss


When fighting fires, the friction loss of a hose lay can be determined by the formula:


FL = C * (flow rate/100)^2 * (hose length/100)


where:


C = coefficient

flow rate = the rate of water in GPM (gallons per minute)

hose length = length of the hose in ft (feet)

FL = friction loss in PSI (pounds per square inch)


This formula assumes a single line is used.


Solving for C:


C = FL / ((flow rate/100)^2 * (hose length/100))


The friction loss was determined by using various flow rates and hose lengths by using the FireCalc Pocket Calculator. You can see my spotlight on the FireCalc Pocket Calculator here: https://edspi31415.blogspot.com/2024/11/spotlight-akron-brass-firecalc-pocket.html


Friction Loss Table:


1” Hose Size


GPM ↓ / Length →

100 ft

150 ft

200 ft

100

150

225

300

150

338

506

675

200

600

900

1200


1.5” Hose Size


GPM ↓ / Length →

100 ft

150 ft

200 ft

100

24

36

48

150

54

81

108

200

96

144

192


2” Hose Size


GPM ↓ / Length →

100 ft

150 ft

200 ft

100

8

12

16

150

18

27

36

200

32

48

64


The coefficient is built in to the FireCalc. I used the HP 20S to extract the coefficient by the following program:


61, 41, A

LBL A

33

(

22, 2

RCL 2

45

÷

1

1

0

0

0

0

34

)

51, 11

x^2

55

×

33

(

22, 3

RCL 3

45

÷

1

1

0

0

0

0

34

)

74

‘=

15

1/x

55

×

22, 1

RCL 1

74

=

61, 26

RTN



Values are stored in the following registers:

Register 1 = friction loss (PSI)

Register 2 = flow rate (GPM)

Register 3 = hose length (ft)


Fortunately, running the program with various data points above, I obtain the coefficient as:


1” Hose Size: coefficient = 150

1.5” Hose Size: coefficient = 24

2” Hose Size: coefficient = 8



Source:

Task Force Tips. “Hydraulic Calculations Every Firefighting Needs to Know” Firefighter Trending Report. 2024. Retrieved November 10, 2024. https://tft.com/hydraulic-calculations-every-firefighter-needs-to-know/


Enjoy!


Eddie


All original content copyright, © 2011-2025. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Basic vs. Python: Circle Inscribed in Circle [HP 71B, Casio fx-CG 100]

Basic vs. Python: Circle Inscribed in Circle Calculators Used: Basic: HP 71B Python: Casio fx-CG 100 Introduction ...