Showing posts with label seismic waves. Show all posts
Showing posts with label seismic waves. Show all posts

Saturday, November 11, 2023

HP 42S/DM42 Programs in the Style of HP 65/67 Cards

HP 42S/DM42 Programs in the Style of HP 65/67 Cards


Programming Cards


In the 1970s, a programmable scientific calculators stored programs on magnetic cards.   The magnetic cards were then loaded on to calculator.   Two such calculators that used magnetic cards are the legendary HP 65 and HP 67, both from Hewlett Packard.    


The aim of these programs is to simulate classic programs from the HP 65 and HP 67 as they are stored on the cards, with prompts and messages to enhance the user experience.

The HP 65 had five user-definable keys A-E, while the HP 67 adds five additional user-defined labels a-e through a shift-key combination.

The MENU command on the HP 42S* creates a user key menu within a program, up to six keys.   I use this command to simulate running programs from loading cards.

(*and Free42, Plus42, Swiss Micros DM42)

The file included in the link below include four programs that are ported from various application books (pacs) of the HP 65 and HP 67.   


Demonstration Program:  demo.raw


When the program is run, a card is "simulated".   


I usually have the card in this format:

Left keys:  inputs, will sometimes give outputs

Key 4 (or 5): labeled CALC, get outputs

Key 6:  EXIT.  Exits the program.  Simulates removing the card.  


Demonstration


Key 1:  enter X coordinate

Key 2:  enter Y coordinate

Key 4:  calculate the norm

Key 6:  exit the program



Notes:  before GTO 30,  I have a pause command (PSE) so the menu returns.  

If I have multiple outputs, I have a stop command (STOP).  


Message convention: 

Prompts with a colon:  (:)  input

Prompts with an equals sign:  (=)  output


#  comments


00 { 134-Byte Prgm }

01▸LBL "DEMO"

02 "VECT NORM/ANG"         #  short description of the program

03 AVIEW

04 PSE                                        #  pauses the screen (allows for print)

05 "BY EWS"

06 AVIEW

07 PSE

08▸LBL 30                           # label 30 starts the menu

09 "→X"

10 KEY 1 XEQ 21

11 "→Y"

12 KEY 2 XEQ 22

13 "CALC"

14 KEY 4 XEQ 24

15 "EXIT"

16 KEY 6 XEQ 26

17 MENU                       # menu setup

18▸LBL 00

19 STOP

20 GTO 00                     # repeats the menu unless a menu key is pressed

21▸LBL 21                   # enter X

22 STO 01

23 "X:"

24 ARCL ST X   

25 AVIEW

26 PSE

27 GTO 30

28▸LBL 22                # enter Y

29 STO 02

30 "Y:"

31 ARCL ST X

32 AVIEW

33 PSE

34 GTO 30

35▸LBL 24            # calculate

36 RCL 02

37 RCL 01

38 →POL

39 "NORM="

40 ARCL ST X

41 AVIEW

42 STOP

43 "ANGLE="

44 ARCL ST Y

45 AVIEW

46 PSE

47 GTO 30

48▸LBL 26       # exit routine

49 CLMENU

50 EXITALL

51 .END.


Sample Output:


VECT NORM/ANG

BY EWS

X:5.7500

Y:6.8500

NORM=8.9434

ANGLE=49.9894


Program Space vs. Information Labels


When messages and alpha strings are added, along with the necessary AVIEW, PSE, and STOP commands, the program space requirements increase.   I put these messages to make the program as user friendly as possible.  



What's Included in the Zip Drive


Five programs:


Demonstration Program:  demo.raw

Sight Reduction Table:  str.raw

Physiologic Shunt and Fick:  phsy.raw

1-D Normal Shocks for Ideal Gases:  shock.raw

P and S Seismic Wave Velocity:  seismic.raw


PDF file of instructions and program listing



Download here (zip file):  

https://drive.google.com/file/d/1_0F_DHCGxcLbmCtrhMQbKShjrpBUgB7i/view?usp=share_link


Enjoy and please let me know, I plan to create another volume of these style of programs.  



Note:  The next blog entry will be on November 18, 2023


Eddie 


All original content copyright, © 2011-2023.  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. 


Thursday, January 1, 2015

TI-84+: Windchill Factor, Boiling Point at Various Elevations, Velocity of Seismic Waves

Happy New Year!  Time flies when we are having fun - we are in 2015 - 15 years into the 21st century.  Here's to making 2015 happy and prosperous for all!

Without further ado, here are the first programs for 2015!

Wind-Chill Factor

The equation, provided by NOA 2011, to determine wind chill is:

W = 35.74 + .6215*T – 35.75*V^.16 + .4275*T*V^.16

Where:
T = air temperature (°F)
V = speed of the wind (mph)

Program WINDCHIL
: Input “AIR TEMP IN °F:”, T
: Input “WIND SPEED (MPH):”, V
: 35.75+.6215*T-35.75*V^.16+.4275*T*V^.16→W
: Disp “WIND CHILL FACTOR:”, W

Example 1:
V = 25 mph, T = 50°F.  Result:  W = 42.75596219
V = 40 mph, T = 20°F.  Result:  W = -.9093161248

Source:  Thomas J. Glover.  “Pocket Ref: 4th Ed” – 2012.  Sequoia Publishing, Inc.:  Littleton, CO




Boiling Point at Various Elevations

Using data   from Pocket Ref, the boiling point of water at certain elevations can be estimated by the following equation:

Y » 211.99262 – (1.94802*10^-3)*X + (7.17273*10^-9)*X^2

X = elevation in feet
Y = boiling point of water in °F

Program BOILH20:
: Input “ELEV. IN FEET:”, X
: 211.99262-(1.94802E-3)*X+(7.17273E-9)*X^2→Y
: Disp “APPROX BAIL PT. (°F):”, Y

Examples:
X = elevation (feet)
Y = boiling point (°F)
250
211.5060633
1000
210.0517727
2750
206.6898088


Source:  Thomas J. Glover.  “Pocket Ref: 4th Ed” – 2012.  Sequoia Publishing, Inc.:  Littleton, CO



Velocity of P-Waves and S-Waves

In measuring seismic waves (earthquakes) of p-waves (primary waves) and s-waves (secondary waves), the following equations can be used:

(I)     First Lamé Parameter:
λ = (v*E)/((1+v)*(1-2*v))

Where: 
v = ratio of soil.  The following parameters are stated from the Foundation Engineering Handbook:

Type of Soil
v =
Clay, above the water table
0.4
Saturated Clay, below the water table
0.5
Wet Sand
0.35
Dry Sand or Rock
0.25

E = elasticity of the soil, measured in thousand-feet per pound

(II)   Shear Modulus (modulus of rigidity)
‘μ = E/(1 + v)

(III) Velocity of the P-Wave (feet/second)
P = √((λ+2μ)*g*1000/w)

w = specific soil weight, in pounds per cubic foot
g = Earth’s gravity constant,  g = 32.1740486 ft/s^2

(IV) Velocity of the S-Wave (feet/second)
S = √(μ*1000*g/w)

Program SEISMIC
: Disp “ELASTICITY (1000 LB/FT)”
: Prompt E
: Disp “SPEC. SOIL WEIGHT”, “(LB/FT^3)”
: Prompt W
: Menu(“SOIL TYPE”, “CLAY”, 1, “BELOW H20 TABLE”, 2, “WET SAND”, 3,
“DRY SAND/ROCK”, 4)
: Lbl 1
: .4→V
: Goto 5
: Lbl 2
: .5→V
: Goto 5
: Lbl 3
: .35→V
: Goto 5
: Lbl 4
: .25→V
: Goto 5
: Lbl 5
: (EV)/((1+V)(1-2V))→L
: E/(2(1+V))→M
: √((L+2M)*32174.0486/W)→P
: √(M*32174.0486/W)→S
: Disp “P-WAVE (FT/S)”,P
: Disp “S-WAVE (FT/S)”,S

Example:
Input: 
E = 3000 pounds per square foot
w = 120 pounds per cubic foot
Type of soil: Clay (v=.4)
Output:
P-Wave Velocity » 1312.863186 ft/s
S-Wave Velocity » 535.9741515 ft/s

Sources: 

Hsai-Yang Fang.  “Foundation Engineering Handbook” Springer Science & Business Media.  1990.

 Indrahil Goswami, Ph.D. P.E. “Civil Engineering PE Breadth and Depth, Exam Guide.  2nd Edition” McGraw Hill. 2014

----

This blog is property of Edward Shore. 2015.  




Python: Drawing a Ring of Circles

Python: Drawing a Ring of Circles The goal: Draw a number of circles that revolve around the origin (0,0). The center of each circle i...