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

Saturday, July 11, 2026

HP 20S: The July 2026 Program Collection

HP 20S: The July 2026 Program Collection


Triangulation






d = l * sin(α) * sin(ß) ÷ sin(α + ß)


Store in the following registers before calculation:

R1 = measure of angle A

R2 = measure of angle B

R3 = length l from point A to B


Solve:

R4: distance


Code:

01: LBL A; 61, 41 ,A

02: DEG; 61, 23

03: RCL 1; 22, 1

04: SIN; 23

05: ×; 55

06: RCL 2; 22, 2

07: SIN; 23

08: ÷; 45

09: (; 33

10: RCL 1; 22, 1

11: +; 75

12: RCL 2; 22, 2

13: ); 34

14: SIN; 23

15: ×; 55

16: RCL 3; 22, 3

17: =; 74

18: STO 4; 21, 4

19: RTN; 61, 26


Examples


Example 1:

Inputs: R1 = 60°, R2 = 50°, R3 = 10

Output: R4: 7.05990377592


Example 2:

Input: R1 = 30°, R2 = 80°, R3 = 27.5

Output: R4: 14.4101446626


Source:

“Triangulation (surveying)” Wikipedia. https://en.wikipedia.org/wiki/Triangulation_(surveying) (last edited October 24, 2025). Retried March 17, 2026


Payment: Continuous Compounding


PMT = PV * (e^r – 1) ÷ (1 – e^(-r * t))


Store in the following registers before calculation:

R1 = t: number of payments

R2 = r: periodic interest rate (as a decimal)

R3 = PV: present value


Solve:

R4: PMT: present


Code:

01: GTO B; 61, 41, b

02: RCL 3; 22, 3

03: ×; 55

04: (; 33

05: RCL 2; 22, 2

06: e^x; 12

07: -; 65

08: 1; 1

09: ); 34

10: ÷; 45

11: (; 33

12: 1; 1

13: -; 65

14: (; 33

15: RCL 1; 22, 1

16: ×; 55

17: RCL 2; 22, 2

18: ); 34

19: +/-; 32

20: e^x; 12

21: ); 34

22: =; 74

23: STO 4; 21, 4

24: RTN; 61, 26


Examples


Example 1:

Input: t: 36, r: 0.10 ÷ 12, PV: 5,000.00

Output: PMT: 161.434037378


Example 2:

Input: t: 60, r: 0.05 ÷ 12; PV: 26,349.56

Output: PMT: 497.374636585


Electrical Engineering: System Temperature to Noise Figure


When an amplifier is activated, two ways to express noise are the noise temperature (in Kelvin) and the noise figure (in decibels, dB). Using a reference temperature of 290 K, when the noise temperature (T) is known, the noise figure (F) can be calculated by:


F = 10 * log((T + 290) ÷ 290)


If temperature is given in degrees Celsius (°C), then the formula for noise figure becomes:


F = 10 * log((T°C + 563.15) ÷ 290)


since T = T°C + 273.15.


The following program assumes that temperature is given in degrees Celsius.


Store in the following registers before calculation:

R1 = T°C; temperature in degrees Celsius


Solve:

R2: F: noise figure


Code:

01: LBL C; 61, 41, C

02: RCL 1; 21, 1

03: +; 75

04: 5; 5

05: 6; 6

06: 3; 3

07 . ; 73

08: 1; 1

09: 5; 5

10: =; 74

11: ÷; 45

12: 2; 2

13: 9; 9

14: 0; 0

15: =; 74

16: LOG; 51, 13

17: ×; 55

18: 1; 1

19: 0; 0

20: =; 74

21: STO 2; 21, 2

22: RTN; 61, 26


Examples


Example 1:

Input: T = -160 °C (store in R1)

Output: F: 1.43068666235 dB


Example 2:

Input: T = 15°C

Output: F: 2.99642532081 dB


Source:

Ball, John A. Algorithms for RPN Calculators John Wiley & Sons: New York. 1978. ISBN 0-47-03070-8. pp. 266-267


Moderate Exercise: Target Heart Rate Range


The following equations calculate the target heart range for a typical person engaging in moderate exercise. According to the particle by Jenna Fletcher (see Source), the American Heart Society (AHA) states the person is engaged in moderate exercise when their heart rate is 50% to 70% of their maximum heart rate. The maximum heart rate is 220 minus the person’s age.


Disclaimer: This is not medical advice, any questions should be discussed with a doctor or health professional.


The moderate range is determined by:

high = (220 – age) * 0.7 = low * 1.4

low = (220 – age) * 0.5 = high * 5/7


For high intensity, use the range 70% to 85%.


Code:

01: LBL D; 61, 41, d

02: +/-; 32

03: +; 75

04: 2; 2

05: 2; 2

06: 0; 0

07: =; 74

08: ÷; 2

09: 2; 2

10: =; 74

11: R/S; 26

12: ×; 55

13: 1; 1

14: . ; 73

15: 4 ; 4

16: =; 74

17: RTN; 61, 26


Examples


Example 1:

Input: Age 49 (my age at the time of this blog)

Output: low: 85.5, high: 119.7


Example 2:

Input: Age 25

Output: low: 97.5, high: 136.5


Source:

Fletcher, Jenna. “What a target heart rate is and how to calculate it”. Medically Reviewed by Debra Sullivan Ph. D. Medical News Today. January 22, 2024. https://www.medicalnewstoday.com/articles/target-heart-rate-calculator March 16, 2026.



Percentile in a Range


The program calculates the percentile of x in the range [a, b].


percentile = (x – a) ÷ (b – a) * 100%


Store before calculating:

R1 = a, R2 = b, R3 = x


Code:

01: LBL E; 61, 42, E

02: ( ; 33

03: RCL 3; 22, 3

04: - ; 65

05 RCL 1; 22, 1

06: ) ; 34

07: ÷; 45

08: ( ; 33

09: RCL 2; 22, 2

10: - ; 65

11: RCL 1; 22, 1

12: ) ; 34

13: ×; 55

14: 2; 2

15: 10^x; 51, 12

16: =; 74

17: RTN; 61, 26


Examples


Example 1:

Input: R1 = 10, R2 = 50, R3 = 30 (30 in [10, 50])

Output: 50 (50%)


Example 2:

Input: R1 = 85.5, R2 = 117.5, R3 = 110 (110 in [85.5, 117.5])

Output: 76.5625 (76.5625%)


Programming all five of these programs will fill the program space of the HP 20S entirely (99 steps)!


Eddie


All original content copyright, © 2011-2026. 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.

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.

HP 67 Collection: October 2026

HP 67 Collection: Oct ober 2026 All examples are done in FIX 4. (DSP 4) Earth's Gravity at a Specific Latitude The true ea...