Projectile Problem

Description

by Dr. D.G. Simpson, http://www.pgccphy.net/1030/software.html

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 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 , xt , and yt 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.

Example:
Let v0 = 30 m/s, (xt , yt) = (50 m, 20 m), and θ = 30°.
Enter the above program, then type:

30 ENTER 50 ENTER 20 ENTER 30 f A

The program returns θ = 41.5357°.

Program Resources

Labels

Name Description
 A Main program, initialise registers
 0 Newton's algorithm

Storage Registers

Name Description
.0 Stores distance from target
.1 Stores heights above target
.2 Stores projectile's muzzle velocity
.3 Initial angle estimate
.4 Control variable

Program

Line Display Key Sequence Line Display Key Sequence Line Display Key Sequence
000 023 20 × 046 20 ×
001 42,21,11 f LBL A 024 45 .3 RCL . 3 047 2 2
002 43 8 g RAD 025 24 COS 048 20 ×
003 42 3 f → RAD 026 43 11 g 049 45 .3 RCL . 3
004 44 .3 STO . 3 027 45 .1 RCL . 1 050 2 2
005 33 R⬇ 028 20 × 051 20 ×
006 44 .1 STO . 1 029 2 2 052 23 SIN
007 33 R⬇ 030 20 × 053 45 .1 RCL . 1
008 44 .0 STO . 0 031 30 054 20 ×
009 33 R⬇ 032 45 .0 RCL . 0 055 2 2
010 44 .2 STO . 2 033 45 .2 RCL . 2 056 20 ×
011 1 1 034 10 ÷ 057 40 +
012 48 . 035 43 11 g 058 10 ÷
013 0 0 036 9 9 059 45 .3 RCL . 3
014 1 1 037 48 . 060 34 x↔y
015 4 4 038 8 8 061 30
016 44 .4 STO . 4 039 20 × 062 44 .3 STO . 3
017 45 .3 RCL . 3 040 30 063 42, 6, .4 f ISG . 4
018 42,21, 0 f LBL 0 041 45 .3 RCL . 3 064 22 0 GTO 0
019 2 2 042 2 2 065 43 3 g →DEG
020 20 × 043 20 × 066 43 7 g DEG
021 23 SIN 044 24 COS 067 43 32 g RTN
022 45 .0 RCL . 0 045 45 .0 RCL . 0