Post Reply 
(11C) Distance, Speed and Time
07-13-2019, 06:30 AM (This post was last modified: 07-14-2019 03:49 AM by Gamo.)
Post: #1
(11C) Distance, Speed and Time
Program to calculates the Distance (d), Speed (s), or Time (t)

for a moving body according to the following formulas:

d = st [distance = speed x time]

s = d/t [speed = distance ÷ time]

t = d/s [time = distance ÷ speed]

Given any two of the quantities d, s and t, the program will calculate the third.

---------------------------------------
Remark:

This program was adapted from HP-97 Owner's Handbook page 235

Since HP-11C doesn't have the special "test-clearing feature of data entry"

so this program use Conditional Test to simulate Data Entry Flag.
--------------------------------------
Procedure:

[A] Distance
[B] Speed
[C] Time

Example: Fix 4

Distance = 3500 miles
Speed = 2070.101 miles per hour
Time = ?

3500 [A] display 0.0000
2070.101 [B] display 0.0000
[C] display answer 1.4127 // Time is 1 hour, 41 minutes, 27 seconds
-----------------------------
Speed = 95 kilometers per hour
Time = 48 hours
Distance = ?

95 [B] display 0.0000
48 [C] display 0.0000
[A] display answer 4560.0000 kilometers // Distance
---------------------------
Distance = 1.5 kilometers
Time = 0.03349 // 3 minutes, 34.9 seconds
Speed = ?

1.5 [A] display 0.0000
.03349 [C] display 0.0000
[B] display answer 25.1280 Kilometers per hour // Speed
--------------------------
Program: [ , ] is a decimal point
Code:

LBL A  // Distance
STO 1
,
X≠Y
RTN
RCL 2
RCL 3
x
RTN
-------
LBL B  // Speed
STO 2
,
X≠Y
RTN
RCL 1
RCL 3
÷
RTN
------
LBL C  // Time
->H
STO 3
,
X≠Y
RTN
RCL 1
RCL 2
÷
->H.MS
RTN

Gamo
Find all posts by this user
Quote this message in a reply
07-14-2019, 11:00 AM (This post was last modified: 07-15-2019 01:24 AM by Gamo.)
Post: #2
RE: (11C) Distance, Speed and Time
This add-on program option for Distance, Speed and Time from previous post

Added the Distance or Speed for the units conversion
between Mile and Kilometer

Previous Program calculate Distance, Speed or Time using these Labels

[A] Distance
[B] Speed
[C] Time

mile and kilometer conversion

[D] Mile to Kilometer
[E] Kilometer to Mile

Program: recommend FIX 2 precision
Code:

LBL D  // Mile to Kilometer
SF0
GTO 0
LBL E  // Kilometer to Mile
CF 0
LBL0
5
LN
F0
GTO 1
÷
RTN
LBL 1
x
RTN

Procedure:

Mile [D] display Kilometer
Kilometer [E] display Mile
----------------------------
Gamo
Find all posts by this user
Quote this message in a reply
07-15-2019, 12:43 AM (This post was last modified: 07-15-2019 04:08 AM by Gamo.)
Post: #3
RE: (11C) Distance, Speed and Time
Example using Google Map:

   

According to the information from Google Map

Distance from Los Angeles to Las Vegas is 269.4 mile
Approximate time of arrival is 3 hour and 49 minute

What is the speed according to this information?
What is the speed answer in kilometer per hour?

If speed change to 90 mile per hour, how long it take to get to Las Vegas?

-------------------------------
Procedure: FIX 2

Distance: 269.4 mi
Time: 3 h 49 min
Speed: ?

269.4 [A] display 0.00
3.49 [C] display 0.00
[B] display 70.59

Answer: Speed is 70 mile per hour

---------------------

Change unit from mile per hour to kilometer per hour

Previous mil/hr answer on display [D] display 113.60

Answer: 114 kilometer per hour

--------------------
Speed change to 90 mile per hour what is the time?

90 [B] display 0.00
[C] display 2.59

Answer: 3 hour

Increasing speed from 70 to 90 mil/h the arrival time will be about 50 minutes faster.

The recommended speed from Google Map is 70 mil/h that is based on California freeway speed limit.
--------------------
Remark:

Please drive according to the Speed Limit in your area
to avoid unwanted speeding ticket !!!

Gamo
Find all posts by this user
Quote this message in a reply
07-15-2019, 02:52 AM
Post: #4
RE: (11C) Distance, Speed and Time
(07-15-2019 12:43 AM)Gamo Wrote:  Please drive according to the Speed Limit in your area
to avoid unwanted speeding ticket !!!

Here is another reason: The physics of speeding cars

Quote:The risk of being in a serious car crash doubles for every 5 km/hr over 60
Find all posts by this user
Quote this message in a reply
07-15-2019, 03:50 AM (This post was last modified: 07-15-2019 04:18 AM by Gamo.)
Post: #5
RE: (11C) Distance, Speed and Time
Thanks Albert Chan

Good detail information.

Before in California most Freeway posted 65 mil/hr speed limit but
nowadays changed to 70 mil/hr (Even in the old days posted 55 mil/hr)

No wonder that Google Map calculate Distance and Time based
on 70 mil/hr speed.
-------------------------
With Google Map again from Los Angeles to New York

Distance = 2789.5 mi
Time = 41 hr

The speed is 68 mil/hr // Assume that continue driving none stop to destination


Gamo
Find all posts by this user
Quote this message in a reply
07-17-2019, 01:39 AM
Post: #6
RE: (11C) Distance, Speed and Time
This program used Flags just like the example shown here for HP-65

Distance, Speed and Time using Flags in program.

https://www.hpmuseum.org/forum/thread-13290.html

Gamo
Find all posts by this user
Quote this message in a reply
07-18-2019, 11:30 AM
Post: #7
RE: (11C) Distance, Speed and Time
This version work the same as the HP-65 program example above.

Program make used of the
Subroutine, Flags and Indirect Line Number Branching.

The main focus on this program is the Indirect Line Number Branching.
I don't see people using this feature much and HP-11C User's Handbook
doesn't give program example on this feature.
--------------------------------
Procedure: USER mode
1. Initialize [A]
2. Input any two of [B] [C] [D]
3. To calculate [E] the Unknown [B] [C] or [D]
--------------------------------
Program:
Code:

001 LBL A  // Initialize 
002 SF1?
003 CLx
004 RTN
-----------
005 LBL B  // Distance
006  1
007  5
008 CHS  // Ready to send Program Line# to Store to Indirect Register
009 GSB 0
010 F1?
011 GTO I  // Goto line 015
012 RCL 2
013 RCL 3
014  x
015 STO 1
016 RTN
-----------
017 LBL C  // Speed
018  2
019  7
020 CHS  // Ready to send Program Line# to Store to Indirect Register
021 GSB 0
022 F1?
023 GTO I  // Goto line 027
024 RCL 1
025 RCL 3
026  ÷
027 STO 2
028 RTN
----------
029 LBL D  // Time
030  4
031  1
032 CHS  // Ready to send Program Line# to Store to Indirect Register
033 GSB 0
034 F1
035 GTO I  // Goto line 041
036 RCL 1
037 RCL 2
038  ÷
039 >H.MS
040 RTN
041 >H
042 STO 3
043 RTN
-----------
044 LBL E  // Compute
045 CF1?
046 RTN
-----------
047 LBL 0  // Use for storing individual Indirect Register Line# Branching 
048 STO I
049 X<>Y
050 RTN

Gamo
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 4 Guest(s)