Physics for the hp-15c - Dr. D G Simpson

Description

J E Patterson - jepspectro.com - 20180416

This program works with the DM15C series of calculators by SwissMicros. The extended memory firmware should be installed. The hp15c Simulator by Torsten Manz can be used as well if the DM15C preferences are set to 229 registers. The programs are self-contained so they can be extracted as separate programs.

**********************************************************************************************************************

1. Projectile Problem


Projectile Problem starts at line 1 and ends at line 67

Dr. D G Simpson - Home Page - HP 15C Calculator Programs
Department of Physical Sciences and Engineering Prince George’s Community College
May 3, 2014

This program solves the following projectile problem: given a target sitting on a hill at coordinates (xt , yt) and a cannon at the origin with muzzle velocity vc. At what angle should the cannon be aimed to hit the target? The solution is found numerically using Newton’s method.

To run the program, enter:

vc ENTER
xt ENTER
yt ENTER €
Enter initial angle guess GSB A

Here vc, xt, and yt may be in any consistent set of units, and the angle (the initial estimate of the answer) is in degrees. The program returns the angle needed to hit the target in degrees.

After running the program, the calculator will be set to degrees mode.

Example:
Let vc = 30 m/s, (xt, yt) = (50 m, 20 m), and an initial angle guess = 30°.
3 0 ENTER
5 0 ENTER
2 0 ENTER
3 0 GSB A
The program returns the aiming angle = 41.5357°

**********************************************************************************************************************

2. Kepler’s Equation


Kepler’s Equation starts at line 68 and ends at line 104

Dr. D G Simpson - Home Page - HP 15C Calculator Programs
Department of Physical Sciences and Engineering Prince George’s Community College
May 3, 2014

Given the mean anomaly M (in degrees) and the orbit eccentricity e, this program solves Kepler’s equation

M = E - e sin E

to find the eccentric anomaly E. This is a very simple implementation—it includes no convergence test, and simply solves Kepler’s equation by performing 15 iterations of Newton’s method.

To run the program, enter:
M ENTER
e GSB B
where M is in degrees. The program returns the eccentric anomaly E in degrees.
After running the program, the calculator will be set to degrees mode.

Example:
Let M = 60°, e = 0.15.
6 0 ENTER
. 1 5 GSB B
The program returns the eccentric anomaly E = 67.9667°

**********************************************************************************************************************

3. Hyperbolic Kepler’s Equation


Hyperbolic Kepler’s Equation starts at line 105 and ends at line 139

Dr. D G Simpson - Home Page - HP 15C Calculator Programs
Department of Physical Sciences and Engineering Prince George’s Community College
May 3, 2014

Given the mean anomaly M (in degrees) and the orbit eccentricity e, this program solves the hyperbolic Kepler equation

M = e sinh(F) - F

to find the hyperbolic eccentric anomaly F . This is a very simple implementation—it includes no convergence test, and simply solves the hyperbolic Kepler equation by performing 15 iterations of Newton’s method.

To run the program, enter:
M ENTER
e GSB C
where M is in degrees. The program returns the variable F .

Example:
Let M = 60°, e = 1.15.
6 0 ENTER
1 . 1 5 GSB C
The program returns the hyperbolic eccentric anomaly F = 1.5555.

**********************************************************************************************************************

4. Barker’s Equation


Barker’s Equation starts at line 140 and ends at line 172

Dr. D G Simpson - Home Page - HP 15C Calculator Programs
Department of Physical Sciences and Engineering Prince George’s Community College
May 3, 2014

Given the constant K = √GM/2q3 (t - Tp) this program solves Barker's equation

tan (f/2) + 1/3 tan3(f/2) = √GM/2q3 (t-Tp)

to find the true anomaly f.

To run the program enter K as follows:

K GSB D

The program returns the anomaly f.
The program will work in either Degrees or Radians mode.

Example:
Let K = 19.38 and set the calculator’s angle mode to degrees.
19.38 GSB D
The program returns f = 149.0847°.

**********************************************************************************************************************

5. Reduction of an Angle


Reduction of an Angle starts at line 173 and ends at line 208

Dr. D G Simpson - Home Page - HP 15C Calculator Programs
Department of Physical Sciences and Engineering Prince George’s Community College
May 3, 2014

This program reduces a given angle to the range (0, 360°) in degrees mode, or (0, 2π) in radians mode. It will work correctly whether the calculator is set for degrees or radians mode.

To run the program:
Angle θ GSB E
The program will return the equivalent reduced angle.

Example:
Let Angle θ = 5000° and set the calculator’s angle mode to degrees.
5 0 0 0 GSB E
The program returns 320°.

**********************************************************************************************************************

6. Helmert’s Equation


Helmert’s Equation starts at line 209 and ends at line 256

Dr. D G Simpson - Home Page - HP 15C Calculator Programs
Department of Physical Sciences and Engineering Prince George’s Community College
May 3, 2014

Given the latitude θ (in degrees) and the elevation H (in meters), this program uses Helmert's equation to find the acceleration due to gravity g.

To run the program, enter:
θ ENTER
H GSB 1
where θ is in degrees and H is in meters.

The program returns the acceleration due to gravity g in m/s2
After running the program, the calculator will be set to degrees mode.

Example:
Let θ = 38.898° and H = 53 m.
3 8 . 8 9 1 ENTER
5 3 GSB 1
The program returns 9.80052 m/s2.

**********************************************************************************************************************

7. Pendulum Period


Pendulum Period starts at line 257 and ends at line 310

Dr. D G Simpson - Home Page - HP 15C Calculator Programs
Department of Physical Sciences and Engineering Prince George’s Community College
May 3, 2014

Given the length L and amplitude θ° of a simple plane pendulum, this program finds the exact period T , using the arithmetic-geometric mean method.

To run the program, enter:
L ENTER
θ GSB 2
where L is in meters and θ is in degrees. The program returns the period T in seconds.
After running the program, the calculator will be set to degrees mode.

Example:
Let L = 1.2 m and θ = 65°.
1 . 2 ENTER
6 5 GSB 2
The program returns T = 2.3898 sec.

**********************************************************************************************************************

8. 1D Perfectly Elastic Collisions


1D Perfectly Elastic Collisions starts at line 311 and ends at line 353

Dr. D G Simpson - Home Page - HP 15C Calculator Programs
Department of Physical Sciences and Engineering Prince George’s Community College
May 3, 2014

Given the masses m1 and m2 of two bodies and their initial velocities v1i and v2i , this program finds the post-collision velocities v1f and v2f using

v1f = v1i(m1 - m2)/(m1 + m2) + v2i(2m2)/(m1 + m2)
v2f = v1i(2m1)/(m1 + m2) + v2i(m2 - m1)/m1 + m2)

To run the program, enter:
m1 ENTER
m2 ENTER
v1i ENTER
v2i GSB 3
The program will return the post-collision velocities v1f in the X register and v2f
in the Y register, in the same units.

Example:
Let m1 = 2.0 kg, m2 = 7.0 kg, v1i = 4.0 m/s, and v2i = -ƒ5.0kg.
2 ENTER
7 ENTER
4 ENTER
5 CHS GSB 3
The program returns v1f = -10 m/s in the X register, and v2f = -ƒ1 m/s in the Y register.

**********************************************************************************************************************

The programs below each originally started with label A. Here labels A to E and labels 1 to 3 are used. The internal label 0 subroutines now use labels 4 to 8.

Program Resources

Labels

Name Description Name Description
 A Aiming angle  3 Post-collision velocities
 B Eccentric anomaly E  4 Aiming angle subroutine - originally label 0
 C Hyperbolic eccentric anomaly F  5 Eccentric anomaly subroutine - originally label 0
 D True anomaly f  6 hyperbolic eccentric anomaly subroutine - originally label 0
 E Equivalent reduced angle  7 Equivalent reduced angle subroutine - originally label 0
 1 Acceleration due to gravity g  8 Pendulum period subroutine - originally label 0
 2 Pendulum period T

Storage Registers

Name Description
.0
.1
.2
.3
.4
.5

Program

Line Display Key Sequence Line Display Key Sequence Line Display Key Sequence
000 118 42,21, 6 f LBL 6 236 43 11 g
001 42,21,11 f LBL A 119 45 .1 RCL . 1 237 6 6
002 43 8 g RAD 120 45 .2 RCL . 2 238 48 .
003 42 3 f → RAD 121 40 + 239 9 9
004 44 .3 STO . 3 122 45 .2 RCL . 2 240 26 EEX
005 33 R⬇ 123 42,22,23 f HYP SIN 241 16 CHS
006 44 .1 STO . 1 124 45 .0 RCL . 0 242 5 5
007 33 R⬇ 125 20 × 243 20 ×
008 44 .0 STO . 0 126 30 244 40 +
009 33 R⬇ 127 45 .2 RCL . 2 245 34 x↔y
010 44 .2 STO . 2 128 42,22,24 f HYP COS 246 3 3
011 1 1 129 45 .0 RCL . 0 247 48 .
012 48 . 130 20 × 248 0 0
013 0 0 131 1 1 249 8 8
014 1 1 132 34 x↔y 250 6 6
015 4 4 133 30 251 26 EEX
016 44 .4 STO . 4 134 10 ÷ 252 16 CHS
017 45 .3 RCL . 3 135 30 253 6 6
018 42,21, 4 f LBL 4 136 44 .2 STO . 2 254 20 ×
019 2 2 137 42, 6, .3 f ISG . 3 255 30
020 20 × 138 22 6 GTO 6 256 43 32 g RTN
021 23 SIN 139 43 32 g RTN 257 42,21, 2 f LBL 2
022 45 .0 RCL . 0 140 42,21,14 f LBL D 258 43 7 g DEG
023 20 × 141 44 .0 STO . 0 259 44 .0 STO . 0
024 45 .3 RCL . 3 142 43 16 g ABS 260 34 x↔y
025 24 COS 143 1 1 261 44 .1 STO . 1
026 43 11 g 144 48 . 262 1 1
027 45 .1 RCL . 1 145 5 5 263 45 .0 RCL . 0
028 20 × 146 20 × 264 2 2
029 2 2 147 36 ENTER 265 10 ÷
030 20 × 148 36 ENTER 266 24 COS
031 30 149 20 × 267 40 +
032 45 .0 RCL . 0 150 1 1 268 2 2
033 45 .2 RCL . 2 151 40 + 269 10 ÷
034 10 ÷ 152 11 √x̅ 270 44 .2 STO . 2
035 43 11 g 153 40 + 271 45 .0 RCL . 0
036 9 9 154 3 3 272 2 2
037 48 . 155 15 1/x 273 10 ÷
038 8 8 156 14 274 24 COS
039 20 × 157 36 ENTER 275 11 √x̅
040 30 158 36 ENTER 276 44 .3 STO . 3
041 45 .3 RCL . 3 159 20 × 277 1 1
042 2 2 160 1 1 278 48 .
043 20 × 161 30 279 0 0
044 24 COS 162 34 x↔y 280 1 1
045 45 .0 RCL . 0 163 10 ÷ 281 44 .4 STO . 4
046 20 × 164 45 .0 RCL . 0 282 42,21, 8 f LBL 8
047 2 2 165 36 ENTER 283 45 .2 RCL . 2
048 20 × 166 43 16 g ABS 284 36 ENTER
049 45 .3 RCL . 3 167 10 ÷ 285 36 ENTER
050 2 2 168 20 × 286 45 .3 RCL . 3
051 20 × 169 43 25 g TAN-¹ 287 40 +
052 23 SIN 170 2 2 288 2 2
053 45 .1 RCL . 1 171 20 × 289 10 ÷
054 20 × 172 43 32 g RTN 290 44 .2 STO . 2
055 2 2 173 42,21,15 f LBL E 291 33 R⬇
056 20 × 174 44 .1 STO . 1 292 45 .3 RCL . 3
057 40 + 175 1 1 293 20 ×
058 10 ÷ 176 16 CHS 294 11 √x̅
059 45 .3 RCL . 3 177 43 24 g COS-¹ 295 44 .3 STO . 3
060 34 x↔y 178 2 2 296 42, 6, .4 f ISG . 4
061 30 179 20 × 297 22 8 GTO 8
062 44 .3 STO . 3 180 44 .0 STO . 0 298 45 .1 RCL . 1
063 42, 6, .4 f ISG . 4 181 45 .1 RCL . 1 299 9 9
064 22 4 GTO 4 182 43,30, 3 g TEST x≥0 300 48 .
065 43 3 g →DEG 183 22 7 GTO 7 301 8 8
066 43 7 g DEG 184 45 .0 RCL . 0 302 10 ÷
067 43 32 g RTN 185 10 ÷ 303 11 √x̅
068 42,21,12 f LBL B 186 16 CHS 304 2 2
069 44 .0 STO . 0 187 43 44 g INT 305 20 ×
070 34 x↔y 188 1 1 306 43 26 g π
071 42 3 f → RAD 189 40 + 307 20 ×
072 44 .1 STO . 1 190 45 .0 RCL . 0 308 45 .2 RCL . 2
073 44 .2 STO . 2 191 20 × 309 10 ÷
074 43 8 g RAD 192 45 .1 RCL . 1 310 43 32 g RTN
075 1 1 193 40 + 311 42,21, 3 f LBL 3
076 48 . 194 43 32 g RTN 312 44 .5 STO . 5
077 0 0 195 42,21, 7 f LBL 7 313 33 R⬇
078 1 1 196 45 .0 RCL . 0 314 44 .4 STO . 4
079 4 4 197 34 x↔y 315 33 R⬇
080 44 .3 STO . 3 198 43,30, 8 g TEST x<y 316 44 .2 STO . 2
081 45 .2 RCL . 2 199 43 32 g RTN 317 33 R⬇
082 42,21, 5 f LBL 5 200 34 x↔y 318 44 .1 STO . 1
083 45 .1 RCL . 1 201 10 ÷ 319 45 .2 RCL . 2
084 45 .2 RCL . 2 202 43 44 g INT 320 30
085 30 203 45 .0 RCL . 0 321 45 .1 RCL . 1
086 45 .2 RCL . 2 204 20 × 322 45 .2 RCL . 2
087 23 SIN 205 45 .1 RCL . 1 323 40 +
088 45 .0 RCL . 0 206 34 x↔y 324 44 .0 STO . 0
089 20 × 207 30 325 10 ÷
090 40 + 208 43 32 g RTN 326 45 .4 RCL . 4
091 45 .2 RCL . 2 209 42,21, 1 f LBL 1 327 20 ×
092 24 COS 210 43 7 g DEG 328 2 2
093 45 .0 RCL . 0 211 34 x↔y 329 45 .2 RCL . 2
094 20 × 212 2 2 330 20 ×
095 1 1 213 20 × 331 45 .5 RCL . 5
096 30 214 44 .0 STO . 0 332 20 ×
097 10 ÷ 215 24 COS 333 45 .0 RCL . 0
098 30 216 0 0 334 10 ÷
099 44 .2 STO . 2 217 48 . 335 40 +
100 42, 6, .3 f ISG . 3 218 0 0 336 44 .3 STO . 3
101 22 5 GTO 5 219 2 2 337 2 2
102 43 3 g →DEG 220 5 5 338 45 .1 RCL . 1
103 43 7 g DEG 221 9 9 339 20 ×
104 43 32 g RTN 222 2 2 340 45 .4 RCL . 4
105 42,21,13 f LBL C 223 8 8 341 20 ×
106 44 .0 STO . 0 224 20 × 342 45 .0 RCL . 0
107 34 x↔y 225 9 9 343 10 ÷
108 42 3 f → RAD 226 48 . 344 45 .2 RCL . 2
109 44 .1 STO . 1 227 8 8 345 45 .1 RCL . 1
110 44 .2 STO . 2 228 0 0 346 30
111 1 1 229 6 6 347 45 .0 RCL . 0
112 48 . 230 1 1 348 10 ÷
113 0 0 231 6 6 349 45 .5 RCL . 5
114 1 1 232 34 x↔y 350 20 ×
115 4 4 233 30 351 40 +
116 44 .3 STO . 3 234 45 .0 RCL . 0 352 45 .3 RCL . 3
117 45 .2 RCL . 2 235 24 COS 353 43 32 g RTN