0% found this document useful (0 votes)
177 views

Programs hp15c

This document contains programs written for the Hewlett-Packard HP 15C scientific calculator to solve various physics and orbital mechanics problems. It includes programs to solve projectile problems, Kepler's equation, hyperbolic Kepler's equation, Barker's equation, and the reduction of an angle. For each program, it provides the relevant equations, instructions on how to run the program by inputting variables, and examples of the program output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
177 views

Programs hp15c

This document contains programs written for the Hewlett-Packard HP 15C scientific calculator to solve various physics and orbital mechanics problems. It includes programs to solve projectile problems, Kepler's equation, hyperbolic Kepler's equation, Barker's equation, and the reduction of an angle. For each program, it provides the relevant equations, instructions on how to run the program by inputting variables, and examples of the program output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

HP 15C Calculator Programs

Dr. D.G. Simpson


Department of Physical Sciences and Engineering
Prince George’s Community College
May 3, 2014

These calculator programs are written for the Hewlett-Packard HP 15C scientific
calculator, and can be easily modified to run on other HP calculators that use HP RPN.

Contents

1. Projectile Problem
2. Kepler’s Equation
3. Hyperbolic Kepler’s Equation
4. Barker’s Equation
5. Reduction of an Angle
6. Helmert’s Equation
7. Pendulum Period
8. 1D Perfectly Elastic Collisions

1
1 Projectile Problem
This program solves the following projectile problem: given a target sitting on a hill at
coordinates .x t ; y t / and a cannon at the origin with muzzle velocity v0 , 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:

v0 ENTER xt ENTER yt ENTER 0 f A

Here v0 , x t , and y t may be in any consistent set of units, and the angle 0 (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.

Program Listing

001- 42,21,11 f LBL A


002- 43 8 g RAD
003- 42 3 f !RAD
004- 44 .3 STO .3
005- 33 R#
006- 44 .1 STO .1
007- 33 R#
008- 44 .0 STO .0
009- 33 R#
010- 44 .2 STO .2
011- 1 1
012- 48 .
013- 0 0
014- 1 1
015- 4 4
016- 44 .4 STO .4
017- 45 .3 RCL .3
018- 42,21, 0 f LBL 0
019- 2 2
020- 20 
021- 23 SIN
022- 45 .0 RCL .0
023- 20 
024- 45 .3 RCL .3
025- 24 COS
026- 43 11 g x2
027- 45 .1 RCL .1
028- 20 
029- 2 2

2
030- 20 
031- 30 
032- 45 .0 RCL .0
033- 45 .2 RCL .2
034- 10 
035- 43 11 g x2
036- 9 9
037- 48 .
038- 8 8
039- 20 
040- 30 
041- 45 .3 RCL .3
042- 2 2
043- 20 
044- 24 COS
045- 45 .0 RCL .0
046- 20 
047- 2 2
048- 20 
049- 45 .3 RCL .3
050- 2 2
051- 20 
052- 23 SIN
053- 45 .1 RCL .1
054- 20 
055- 2 2
056- 20 
057- 40 C
058- 10 
059- 45 .3 RCL .3
060- 34 x?y
061- 30 
062- 44 .3 STO .3
063- 42, 6,.4 f ISG .4
064- 22 0 GTO 0
065- 43 3 g !DEG
066- 43 7 g DEG
067- 43 32 g RTN

Example. Let v0 D 30 m/s, .x t ; y t / D .50 m; 20 m/, and 0 D 30ı . Enter the


above program, then type:

30 ENTER 50 ENTER 20 ENTER 30 f A

The program returns  D 41:5357ı.

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

M D 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 f A

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.

Program Listing

001- 42,21,11 f LBL A


002- 44 .0 STO .0
003- 34 x?y
004- 42 3 f !RAD
005- 44 .1 STO .1
006- 44 .2 STO .2
007- 43 8 g RAD
008- 1 1
009- 48 .
010- 0 0
011- 1 1
012- 4 4
013- 44 .3 STO .3
014- 45 .2 RCL .2
015- 42,21, 0 f LBL 0
016- 45 .1 RCL .1
017- 45 .2 RCL .2
018- 30 -
019- 45 .2 RCL .2
020- 23 SIN
021- 45 .0 RCL .0
022- 20 
023- 40 +
024- 45 .2 RCL .2
025- 24 COS
026- 45 .0 RCL .0
027- 20 

4
028- 1 1
029- 30 -
030- 10 
031- 30 -
032- 44 .2 STO .2
033- 42, 6,.3 f ISG .3
034- 22 0 GTO 0
035- 43 3 g !DEG
036- 43 7 g DEG
037- 43 32 g RTN

Example. Let M D 60ı , e D 0:15. Enter the above program, then type:

60 ENTER .15 f A

The program returns E D 67:9667ı.

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

M D e sinh F  F

to find the variable F . This is a very simple implementation—it includes no conver-


gence test, and simply solves the hyperbolic Kepler equation by performing 15 itera-
tions of Newton’s method.
To run the program, enter:

M ENTER e f A

where M is in degrees. The program returns the variable F .

Program Listing

001- 42,21,11 f LBL A


002- 44 .0 STO .0
003- 34 x?y
004- 42 3 f !RAD
005- 44 .1 STO .1
006- 44 .2 STO .2
007- 1 1
008- 48 .
009- 0 0
010- 1 1
011- 4 4
012- 44 .3 STO .3
013- 45 .2 RCL .2
014- 42,21, 0 f LBL 0
015- 45 .1 RCL .1
016- 45 .2 RCL .2
017- 40 +
018- 45 .2 RCL .2
019- 42,22,23 f HYP SIN
020- 45 .0 RCL .0
021- 20 
022- 30 -
023- 45 .2 RCL .2
024- 42,22,24 f HYP COS
025- 45 .0 RCL .0
026- 20 
027- 1 1
028- 34 x?y 1

6
029- 30 -
030- 10 
031- 30 -
032- 44 .2 STO .2
033- 42, 6,.3 f ISG .3
034- 22 0 GTO 0
035- 43 32 g RTN

Example. Let M D 60ı , e D 1:15. Enter the above program, then type:

60 ENTER 1.15 f A

The program returns F D 1:5555.

7
4 Barker’s Equation
p
Given the constant K D GM=.2q 3 /.t  Tp /, this program solves Barker’s equation
    s
f 1 3 f GM
tan C tan D .t  Tp /
2 3 2 2q 3

to find the true anomaly f .


To run the program, enter the dimensionless number
s
GM
KD .t  Tp /
2q 3

as follows:

K f A

The program returns the anomaly f .


The program will work in either Degrees or Radians mode.

Program Listing

001- 42,21,11 f LBL A


002- 44 .0 STO .0
003- 43 16 g ABS
004- 1 1
005- 48 .
006- 5 5
007- 20 
008- 36 ENTER
009- 36 ENTER
010- 20 
011- 1 1
012- 40 +
p
013- 11 x
014- 40 +
015- 3 3
016- 15 1=x
017- 14 yx
018- 36 ENTER
019- 36 ENTER
020- 20 
021- 1 1
022- 30 -
023- 34 x?y
024- 10 

8
025- 45 .0 RCL .0
026- 36 ENTER
027- 43 16 g ABS
028- 10 
029- 20 
030- 43 25 g TAN1
031- 2 2
032- 20 
033- 43 32 g RTN

Example. Let K D 19:38 and set the calculator’s angle mode to degrees. Enter the
above program, then type:

19.38 f A

The program returns f D 149:0847ı.

9
5 Reduction of an Angle
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:

 f A

The program will return the equivalent reduced angle.

Program Listing

001- 42,21,11 f LBL A


002- 44 .1 STO .1
003- 1 1
004- 16 CHS
005- 43 24 COS1
006- 2 2
007- 20 
008- 44 .0 STO .0
009- 45 .1 RCL .1
010- 43,30, 3 g TEST 3
011- 22 0 GTO 0
012- 45 .0 RCL .0
013- 10 
014- 16 CHS
015- 43 44 g INT
016- 1 1
017- 40 +
018- 45 .0 RCL .0
019- 20 
020- 45 .1 RCL .1
021- 40 +
022- 43 32 g RTN
023- 42,21, 0 f LBL 0
024- 45 .0 RCL .0
025- 34 x?y
026- 43,30, 8 g TEST 8
027- 43 32 g RTN
028- 34 x?y
029- 10 
030- 43 44 g INT
031- 45 .0 RCL .0
032- 20 
033- 45 .1 RCL .1

10
034- 34 x?y
035- 30 -
036- 43 32 g RTN

Example. Let  D 5000ı and set the calculator’s angle mode to degrees. Enter the
above program, then type:

5000 f A

The program returns 320ı.

11
6 Helmert’s Equation
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 f A

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.

Program Listing

001- 42,21,11 f LBL A


002- 43 7 g DEG
003- 34 x?y
004- 2 2
005- 20 
006- 44 .0 STO .0
007- 24 COS
008- 45 .1 RCL .1
009- 20 
010- 45 .2 RCL .2
011- 34 x?y
012- 30 -
013- 45 .0 RCL .0
014- 24 COS
015- 43 11 g x2
016- 45 .3 RCL .3
017- 20 
018- 40 +
019- 34 x?y
020- 45 .4 RCL .4
021- 20 
022- 30 -
023- 43 32 g RTN

R.1 = 0:025928
R.2 = 9:80616
R.3 = 6:9  105
R.4 = 3:086  106

12
Example. Let  D 38:898ı, H D 53 m. Enter the above program, then type:

38.898 ENTER 53 f A

The program returns g D 9:80052 m/s2 .

13
7 Pendulum Period
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  f A

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.

Program Listing

001- 42,21,11 f LBL A


002- 43 7 g DEG
003- 44 .0 STO .0
004- 34 x?y
005- 44 .1 STO .1
006- 1 1
007- 45 .0 RCL .0
008- 2 2
009- 10 
010- 24 COS
011- 40 +
012- 2 2
013- 10 
014- 44 .2 STO .2
015- 45 .0 RCL .0
016- 2 2
017- 10 
018- 24 COS
p
019- 11 x
020- 44 .3 STO .3
021- 1 1
022- 48 .
023- 0 0
024- 1 1
025- 44 .4 STO .4
026- 42,21, 0 f LBL 0
027- 45 .2 RCL .2
028- 36 ENTER
029- 36 ENTER
030- 45 .3 RCL .3
031- 40 C
032- 2 2

14
033- 10 
034- 44 .2 STO .2
035- 33 R#
036- 45 .3 RCL .3
037- 20 
p
038- 11 x
039- 44 .3 STO .3
040- 42, 6,.4 f ISG .4
041- 22 0 GTO 0
042- 45 .1 RCL .1
043- 9 9
044- 48 .
045- 8 8
046- 10 
p
047- 11 x
048- 2 2
049- 20 
050- 43 26 g 
051- 20 
052- 45 .2 RCL .2
053- 10 
054- 43 32 g RTN

Example. Let L D 1:2 m and  D 65ı . Enter the above program, then type:

1.2 ENTER 65 f A

The program returns T D 2:3898 sec.

15
8 1D Perfectly Elastic Collisions
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
   
m1  m2 2m2
v1f D v1i C v2i
m1 C m2 m1 C m2
   
2m1 m2  m1
v2f D v1i C v2i
m1 C m2 m1 C m2

To run the program, enter:

m1 ENTER m2 ENTER v1i ENTER v2i f A

The program will return the post-collision velocities v1f (in the X register) and v2f
(in the Y register), in the same units.

Program Listing

001- 42,21,11 f LBL A


002- 44 .5 STO .5
003- 33 R#
004- 44 .4 STO .4
005- 33 R#
006- 44 .2 STO .2
007- 33 R#
008- 44 .1 STO .1
009- 45 .2 RCL .2
010- 30 
011- 45 .1 RCL .1
012- 45 .2 RCL .2
013- 40 +
014- 44 .0 STO .0
015- 10 
016- 45 .4 RCL .4
017- 20 
018- 2 2
019- 45 .2 RCL .2
020- 20 
021- 45 .5 RCL .5
022- 20 
023- 45 .0 RCL .0
024- 10 
025- 40 +
026- 44 .3 STO .3
027- 2 2

16
028- 45 .1 RCL .1
029- 20 
030- 45 .4 RCL .4
031- 20 
032- 45 .0 RCL .0
033- 10 
034- 45 .2 RCL .2
035- 45 .1 RCL .1
036- 30 
037- 45 .0 RCL .0
038- 10 
039- 45 .5 RCL .5
040- 20 
041- 40 +
042- 45 .3 RCL .3
043- 43 32 g RTN

Example. Let m1 D 2:0 kg, m2 D 7:0 kg, v1i D 4:0 m/s, and v2i D 5:0 kg.
Enter the above program, then type:

2 ENTER 7 ENTER 4 ENTER 5 CHS f A

The program returns v1f D 10 m/s in the X register, and v2f D 1 m/s in the Y
register.

17

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy