Showing posts with label DM32. Show all posts
Showing posts with label DM32. Show all posts

Saturday, July 4, 2026

Swiss Micros DM32: Estimating Earth’s Acceleration at Latitude

Swiss Micros DM32: Estimating Earth’s Acceleration at Latitude



Introduction



Earth’s gravitational force is usually set a constant of 9.80665 m/s², usually shortened to 9.8 m/s² or 9.81 m/s² in publications such as physics text books. However, in reality gravity on Earth is not constant. There are many ways to calculate (estimate) the gravitational acceleration depending where you are on Earth. Gravity depends on many factors including latitude (degrees North or South) and the elevation. The blog focuses on the effect of latitude on Earth’s gravity.



The is part of the Acceleration Due to Gravity table from the Desk Ref book (see the Source section). The column for m/s² is added.



Degrees Latitude (North or South)

Gravity Acceleration (cm/s²)

Gravity Acceleration (m/s²)

0 (Equator)

978.0327

9.780327

15

978.3786

9.783786

30

979.3249

9.793249

45

980.6199

9.806199

60

981.9178

9.819178

75

982.8698

9.828698

90

983.2186

9.832186

[Glover, Young, pg. 587]



There are many ways to estimate the gravitational acceleration depending where you are on Earth. Gravity depends on many factors including latitude (degrees North or South) and the elevation.



Earth’s gravity tends to be at the strongest at the poles. However, gravity weakens at higher elevations, where we are further away from the center of the planet.





Gravity Estimate – (Univ. of Illinois)



The formula that is presented by The Grainger College of Engineering Physics Van [Univ. of Illinois] is a simple but pretty accurate estimation of gravity:



g = g_45 – 1 / 2 * (g_poles – g_equator) * cos(2 * latitude * π ÷ 180)

where:

g_poles = 9.832 m/s²

g_45 = 9.806 m/s²

g_equator = 9.78 m/s²

lat = latitude, north or south

2 * latitude is converted to radians. (as it is multiplied by π ÷ 180)



Simplifying the equation leads to:

1 / 2 * (g_poles – g_equator) = 1 / 2 * (9.832 – 9.78) = 0.026

2 * latitude * π ÷ 180 = latitude * π ÷ 90 (in radians)



Then:

g = 9.806 – 0.026 * cos(latitude * π ÷ 90)

(in radians)



DM32 Program: Gravity Estimate



Input L as D.MS (degrees/minutes/seconds) format.



E01 LBL E
E02 RAD
E03 INPUT L
E04 →HR
E05 90
E06 ÷
E07 π
E08 ×
E09 COS
E10 0.026
E11 ×
E12 +/-
E13 9.806
E14 +
E15 STO G
E16 RTN



World Geodetic System 84 Ellipsoidal Gravity Formula



The formula is presented by the World Geodetic System (WGS): [Wikipedia]



g = Ge * ((1 + k * sin² L) ÷ √(1 – e² * sin² L))

L: latitude in decimal degrees

with the constants:

Ge = 9.7803253359 m/s²

k = 0.001931852652

e² = 0.0066943799901



Input L as D.MS (degrees/minutes/seconds) format.



DM32: WEG ‘84



G01 LBL G
G02 DEG
G03 INPUT L
G04 →HR
G05 SIN
G06 x²
G07 STO T
G08 0.001931852652
G09 ×
G10 1
G11 +
G12 1
G13 RCL T
G14 0.0066943799901
G15 ×
G16 -
G17 SQRT
G18 ÷
G19 9.7803253359
G20 ×
G21 STO G
G22 RTN



Table of Values



Sources

“Gravity of Earth” Wikipedia. (2026, January 31).

https://en.wikipedia.org/wiki/Gravity_of_Earth Retrieved March 9, 2026.



Grainger Engineering Office of Marketing and Communications. (answer written by Rebecca H.) (2016, November 21). “How gravitational force varies at different locations on Earth.” Illinois. https://van.physics.illinois.edu/ask/listing/64061. Retrieved March 10, 2026.



Glover, Thomas J. and Richard A. Young. Desk Ref. Sequoia Publishing, Inc. Anchorage, AK 4th Edition. 2022 pg. 587


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.

Saturday, March 7, 2026

TI-84 Plus CE and Swiss Micros DM32: Blood Alcohol Level

TI-84 Plus CE and Swiss Micros DM32: Blood Alcohol Level


Just in time for the upcoming St. Patrick’s Day in a few weeks…


Introduction


The blood alcohol level is calculated by the following approximation by Walter L. Gregory Jr. using data from the CRC Handbook of Tables for Applied Engineering (1970). The program is based off the HP-97/HP-67 program listed in their Medical Practitioner pac (1979). (see source):


BAC ≈ ((ALC * OZ) ÷ 50 – T) * (3.751 ÷ WT)


ALC: Percentage of alcohol consumed. Enter as a whole number. For example, if the drink has 40% alcohol, ALC = 40. If the alcohol is measured in proof, divide the proof by 2.

OZ: The total amount of ounces consumed within the period of time. For example: six 12-oz beers total 72 ounces.

WT: The weight of the person in pounds.

T: The number of hours drinks are consumed. If T > 1, then T = hours – 1. Otherwise T = 0.


If calculated BAC is below 0, then set BAC = 0.


TI-84 Program CE: ALCOHOL

Type: TI Basic


Disp “BLOOD ALCOHOL (US)”

Input “WEIGHT (LB)? “, W

Input “OUNCES? “, O

Input “PERCENTAGE? “, P

Input “HOURS OF DRINKING? “, H

If H≤1 : Then : 0 → H

Else : H – 1 → H : End

(P * O / 50 – H) * 3.751 / W → A

Disp “BLOOD ALCOHOL: “, A


Swiss Micros DM32 (HP 32SII): ALCOHOL


A01 LBL A

A02 INPUT W

A03 INPUT O

A04 INPUT P

A05 INPUT H

A06 RCL H

A07 1

A08 x≥y?

A09 SF 1

A10 STO- H

A11 FS? 1

A12 Cl x

A13 FS? 1

A14 STO H

A15 CF 1

A16 RCL P

A17 RCL× O

A18 50

A19 ÷

A20 RCL- H

A21 3.751

A22 RCL÷ W

A23 ×

A24 x<0?

A25 Cl x

A26 RTN


Notes:


A07 1, A08 x≥y?, A09 SF 1: If hours > 1, set Flag 1. Using flags can sometimes eliminates the need for additional labels.


A24 x<0?, A25 Cl x: If the number in the display (x stack) negative, change it to zero.


Examples


Example 1:

Inputs:

Weight: W = 150 lbs

Ounces: O = 4 oz

Percentage: P = 20%

Hours: H = 0.5 hours (T = 0)

Output: 0.0400


Example 2:

Inputs:

Weight: W = 180 lbs

Ounces: O = 45 oz

Percentage: P = 50%

Hours: H = 2.5 hours (T = 1.5)

Output: 0.9065

(typo:  Thank you, Pedro Leiva)


Be sure to check your local laws for legal blood alcohol levels. This program is not suited to be evidence in legal matters.


One thing remains: DON’T DRINK AND DRIVE



Source


Hewlett Packard. HP-67/HP-97. User’s Library Solutions: Medical Practitioner. Corvallis, OR. April 1979. pp. 9-12



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.

Saturday, October 11, 2025

RPN Calculators: INPUT vs PROMPT

RPN Calculators: INPUT vs PROMPT


Later RPN keystroke programming calculators are able to display alphabetic messages and store to variables for alphabetic names.


HP 32S, HP 32SII, HP 33S, HP 35S, DM32

HP 41C (all variants), DM41X

HP 42S, DM42, DM42n, Free 42

Single letter variable names

Numeric-named variables only

Both numeric-named variables and alphabetic (and alphanumeric) variable names. Alphabetic and alphanumeric named variables are enclosed in quotes (alpha strings) well stored and recalled and take additional memory.

Can display messages by setting Flag 10 and using the equation feature to type messages

Can display messages and prompts

Can display messages and prompts


Two common ways to cue the user to enter values are the INPUT and PROMPT commands.


The INPUT Command: HP 32 and HP 42S (and Swiss Micros/emulator equivalents)


Note: The INPUT command is not available in the HP 41C’s command set.


General syntax: INPUT var


When an INPUT command is encountered, the screen will display [var]?= on the X stack.


Example:

INPUT R displays R? [previous value stored in R]


HP 32 Family: The variable is a single-letter name or the indirect variable i.

HP 42S Family: A custom alpha variable, a numeric-named variable (i.e. 00, 01, 02, etc.), indirect variables, or the stack levels X, Y, T, Z, or L (last argument).


The INPUT has the double benefit of storing whatever is entered into the variable asked for. INPUT will also show the previously stored value, so we can just accept it by pressing R/S to keep the old value.


Example: Volume of a Cone


HP 32 family

HP 42S family

V01 LBL V

V02 INPUT R

V03 INPUT H

V04 π

V05 RCL R

V06 x^2

V07 ×

V08 RCL H

V09 ×

V10 3

V11 ÷

V12 RTN


No quotes are needed for alphabetic variables.



00 {30-Byte Prgm }

01 LBL “VCONE1”

02 INPUT “R”

03 INPUT “H”

04 PI

05 RCL “R”

06 x↑2

07 ×

08 RCL “H”

09 ×

10 3

11 ÷

12 RTN


We could use variables 00 and 01 (for example) for radius and height, respectively, except the input command prompt will show “R00?” or “R01?” which may not be user-friendly.


The INPUT does not replace the contents of the alpha register.


If we want the alphanumeric/alphanumeric variables (“R”, “H”) to be erased, we could have inserted CLV “R” and CLV “H” at the end, but that will erase the value associated with them.



The PROMPT Command: HP 41C and HP 42S (and Swiss Micros/emulator equivalents)


Note: The PROMPT command is not available on the HP 32S family.


General Syntax:

alpha string”

PROMPT

STO var


The alpha string is displayed until something, usually a numeric value, is entered. Unlike the INPUT command, the PROMPT does not automatically store the entered value into a variable. Therefore, if you want to use the value for future use, a STO (store) command must be used following the prompt.


Let’s take our volume of the cone example again:


HP 41C family

HP 42S family

01 LBL “VCONE2”

02 ^T RADIUS?

03 PROMPT

04 STO 00

05 ^T HEIGHT?

06 PROMPT

07 STO 01

08 PI

09 RCL 00

10 X↗2

11 *

12 RCL 01

13 *

14 3

15 /

16 RTN



R00 = radius

R01 = volume

00 { 40-Byte Prgm }

01 LBL “VCONE2”

02 “RADIUS?”

03 PROMPT

04 STO 00

05 “HEIGHT?”

06 PROMPT

07 STO 01

08 PI

09 RCL 00

10 X↑2

11 ×

12 RCL 01

13 ×

14 3

15 ÷

16 RTN



R00 = radius

R01 = volume


With PROMPT, I like to use the numeric-named memory registers, but we can use alphabetic or alphanumeric registers as well.


HP 32SII/DM32: Simulating PROMPT with Flag 10


Even though the HP 32SII does not have a PROMPT command, we can kind of simulate it by using the equation message feature.


To set flag 10: [ |→ ] [ × ]* (FLAGS), { SF }. [ . ] [ 0 ]

To clear flag 10: [ |→ ] [ × ]* (FLAGS), { CF }. [ . ] [ 0 ]

We have to use the decimal point key in order to access flags beyond 9.

(*HP 35S: [ ←| ] [ ↑ ] (FLAGS))


HP 32SII/33S/35S/DM32


W01 LBL W

W02 SF 10

W03 “=RADIUS”

W04 STO R

W05 “=HEIGHT”

W06 STO H

W07 CF 10


W08 π

W09 RCL R

W10 x^2

W11 ×

W12 RCL H

W13 ×

W14 3

W15 ÷

W16 RTN


Turn message mode on

Enter as an equation =RADIUS

Enter radius and press [R/S]

Enter as an equation =HEIGHT

Enter height and press [R/S]

Turn message mode off, so equations can operate normally



Note: Equations are NOT on the original HP 32S.



I hope you find this helpful.


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, September 13, 2025

RPN: DM32 and DM42: Stopping Sight Distance (Metric)

RPN: DM32 and DM42: Stopping Sight Distance (Metric)



The Stopping Sight Distance Formula – Derivation


The stopping sight distance (SSD) formula calculates the theoretical distance that a driver needs to see to react and stop to avoid colliding with a person or hazard safely.


The SSD is measured in meters (or in US units, feet). This blog entry will focus on the SI system (meters, kilograms, seconds).


The SSD is broken down into two parts:


SSD = d1 + d2


Part 1: d1: Reaction Distance


d1 = reaction distance = v * t

v = velocity of the vehicle

t = reaction time that the driver takes to hit their brakes. The ideal reaction time is 1 second (or less). However, if the driver is tired or is later in age, the reaction time will increase. Typically, the reaction time is assumed to be 2.5 seconds.


In calculating SSD, the velocity is entered in usually in km/hr. (kilometers per hour). We need to change this into m/s.


1 km / hr * 1,000 m / 1 km * 1 hr / 3,600 s = 1,000 / 3,600 m/s = 5 / 18 m/s


Note many publication rounds this conversion factor to 0.278.


Hence, the completed reaction distance portion is:


d1 = 5 / 18 * v * t



Part 2: d2: Stopping Distance


This part is more complicated and includes factors such as friction force (µ), weight of the car (mass/g, g = 9.80665 m/s^2), and grade of the road (grd%, which is the increase or decrease of the slope of the road).


A common formula for d2 is:

d2 = v^2 / (a * (µ + grd%))


Another way to determine d2 is to equate the kinetic energy of the car with the work required to stop the car:


KE = work

m * v^2 / 2 = (µ + grd%) * w * d2


where:

m = mass of the car, in kg

v = velocity of the car, in km/hr

µ = friction factor (unit-less)

d2 = distance in m

w = weight of the car in N

grd% = grade of the road, in decimal (i.e. 1% = 0.01) (unit-less)

g = 9.80665 m/s^2


Note that mass = weight / gravity acceleration; m = w / g:


w / g * v^2 / 2 = (µ + grd%) * w * d2


Solving for d2:


d2 = v^2 / (2 * g * µ) = v^2 / (2 * g) * 1 / (µ * grd%)



Note that d2 is in meters. But v is in km/hr. Once again, a conversion factor is required. I’m focusing on the portion v^2 / (2 * g). I’m going to break the problem down into two parts: numerator and denominator.


Numerator:


1 km^2 / hr^2 * 1^2 hr^2 / 3,600^2 s^2 * 1,000^2 m^2 / 1^2 km^2 = 25 / 324 m^2 / s^2


Denominator:


2 * g = 2 * 9.80665 m/s^2 = 19.6133 m/s^2


Numerator/Denominator:


(25 / 324 m^2/s^2) / 19.6133 m/s^2 ≈ 3.934090328 * 10^-3 m ≈ 1/254.188368 m


Publications and associations, such as the AASHTO (American Association of State Highway and Transportation Officials), will often round 254.188368 to 254.



The Completed Formula


SSD = d1 + d2 = d1 = 5/18 * v * t + v^2 / (254.188368 * (µ + grd%))


The value of µ usually takes the values between 0.3 and 0.4. For the program, I’m assuming that µ = 0.35 for wet road conditions and µ = 0.70 dry conditions



SSD in US Units


Using similar analysis, the SSD in US units is:


SSD = 22/15 * v * t + v^2 / (29.91388812 * (µ +grd%))


where: v = velocity in mi/hr (mph), t = reaction time in seconds, SSD in feet (ft)


Publications will round the constants to 1.47 and 30, respectively.


On obtaining the conversion factors, note that:

1 mi/hr = 22/15 ft/s

1 mi^2/hr^2 = 484/225 ft^2/s^2

2 * g = 2 * 9.80665 m/s^2 * 100/30.48 ft/s^2 ≈ 2 * 32.17404856 ft/s^2 ≈ 64.34809711 ft/s^2

(484/225) / (64.38409711) ≈ 0.033429288 ≈ 1/29.91388812



DM32/ HP 32II Program: Stopping Sight Distance (SI Units)

(not for the HP 32S because it uses messages)


D01 LBL D

D02 35 [store constants; wet conditions times 100]

D03 STO A

D04 70 [store constants; dry conditions times 100]

D05 STO B

D06 2.5 [store default reaction time]

D07 STO T

D08 INPUT T

D09 INPUT V

D10 INPUT G [enter grade as a percentage: 1% → 1]

D11 SF 10 [set message mode, SF, decimal point, 0]

D12 “1 WET 2 DRY”

D13 INPUT i [input indirect variable]

D14 CF 10 [turn off message mode, CF, decimal point, 0]

D15 RCL V

D16 x^2

D17 RCL (i)

D18 RCL+ G

D19 100

D20 ÷

D21 254.188368

D22 ×

D23 ÷

D24 5

D25 RCL× V

D26 RCL× T

D27 18

D28 ÷

D29 +

D30 STO D [store and view SSD]

D31 VIEW D

D32 RTN


HP 42S/DM42/Free 42 Program: Stopping Sight Distance (SI Units)

(This program is similar to the 32SII version.)


00 {121-Byte Program}

01 LBL “SSD”

02 35

03 STO 01

04 70

05 STO 02

06 2.5

07 STO 03

08 “REACT TIME?”

09 PROMPT

10 STO 03

11 RCL 04

12 “VELOCITY?”

13 PROMPT

14 STO 04

15 RCL 05

16 “GRADE?”

17 PROMPT

18 STO 05

19 RCL 00

20 “1. WET 2. DRY”

21 PROMPT

22 STO 00

23 RCL 04

24 X↑2

25 RCL IND 00

26 RCL+ 05

27 100

28 ÷

29 254.188368

30 ×

31 ÷

32 5

33 RCL× 03

34 RCL× 04

35 18

36 ÷

37 +

38 STO 06

39 “SSD=”

40 ARCL ST X

41 RTN



Variables:

R00 = choice variable

R01 = wet condition friction coefficient * 100

R02 = dry condition friction coefficient * 100

R03 = reaction distance (set to default as of 2.5 sec)

R04 = velocity (km/hr)

R05 = grade

R06 = SSD in meters


Examples


Velocity: 96.5606 km/hr (about 60 mi/hr), Time: 2.5 seconds, Grade: 0%

Dry Conditions (i = 2): SSD: 119.4578 m

Wet Conditions (i = 1, µ = 0.35), SSD: 171.8596 m


Velocity: 96.5606 km/hr, Time: 1.5 seconds, Dry Road

Grade: +1%: SSD: 91.8973 m

Grade: -1%: SSD: 93.3948 m



Sources


American Association of State Highway and Transportation Officials NCHRP Report 400. 1997. Last accessed April 27, 2025. https://onlinepubs.trb.org/onlinepubs/nchrp/nchrp_rpt_400.pdf


Chandra, Satish IITR “Stopping Sight Distance on a road. Definition, concept, and evaluation of SSD with examples.” YouTube Video. July 16, 2023. https://www.youtube.com/watch?v=HEzdJE7NQeU&t=973s Last accessed April 27, 2025.


Omni Calculator. “Stopping Distance Calculator” July 22, 2024. Last accessed April 26, 2025. https://www.omnicalculator.com/physics/stopping-distance



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.

Sharp EL-5200/EL-9000 AER II Program Collection – September 2026

Sharp EL-5200/EL-9000 AER II Program Collection – September 2026 For my review on the Sharp EL-5200 (also known as the Sharp EL-9000)...