Post Reply 
Oops! hp42s Mohr's Cicle Program
06-02-2015, 08:41 AM
Post: #1
Oops! hp42s Mohr's Cicle Program
I could not find a program written about Mohr's Circle on the hp42s.
So I did this for kicks!
HP 42s Program Mohr's
This simple program runs and find the principal stress using Mohr's circle equations. The example below solves for principal stress & normal stress.

Line Instruction
01 LBL "MOHR"
02 INPUT "1OR0"
03 x=0?
04 GTO "XYT"
05 INPUT "TAUXY"
06 INPUT "SIGX"
07 INPUT "SIGY"
08 +
09 2
10 ÷
11 STO "S"
12 RCL "SIGX"
13 RCL- "SIGY"
14 2
15 ÷
16 x|2
17 RCL "TAUXY"
18 x|2
19 +
20 SQRT
21 STO "R"
22 CLST
23 RCL "R"
24 RCL+ "S"
25 STO "SIG1"
26 RCL "S"
27 RCL- "R"
28 STO "SIG2"
29 VIEW "SIG1"
30 PSE
31 VIEW "SIG2"
32 PSE
33 RCL "SIGX"
34 RCL- "SIGY"
35 1/x
36 2
37 x
38 RCLx "TAUXY"
39 ATAN
40 2
41 ÷
42 STO "Q"
43 VIEW "Q"
44 PSE
45 VIEW "R"
46 PSE
47 STOP
48 LBL "XYT"
49 CLST
50 INPUT "Q"
51 INPUT "SIG1"
52 INPUT "SIG2"
53 -
54 2
55 ÷
56 STO "R"
57 VIEW "R"
58 PSE
59 +/-
60 RCL+ "SIG1"
61 STO "S"
62 VIEW "S"
63 PSE
64 RCL "Q"
65 2
66 x
67 COS
68 RCLx "R"
69 RCL- "S"
70 +/-
71 STO "SIGY"
72 RCL "S"
73 2
74 x
75 -
76 +/-
77 STO "SIGX"
78 RCL "Q"
79 2
80 x
81 TAN
82 RCL "SIGX"
83 RCL- "SIGY"
84 x
85 2
86 ÷
87 STO "TAUXY"
88 VIEW "SIGX"
89 PSE
90 VIEW "SIGY"
91 PSE
92 VIEW "TAUXY"
93 STOP
94 RTN

Created by Jean-Marc Biram, Copyright © 2007 Free Software Foundation
Distributed under the version 3, GNU general public license


While writing the above I noticed a strange result which I narrowed down to codes.

Oops! this could be interesting, load this short program. I used the Free42 on my Palm T5. If you have the real thing give it a try.

01 LBL "OOPS"
02 CLST
03 STO "M"
04 STO "N"
05 INPUT "M"
06 INPUT "N"
07 -
08 x
09 2
10 ÷
11 STO "T"
12 VIEW "T"
10 RTN

Use the following values, M as 70,000 & N as -30,000
Strangely the Ans is T = 1,050,000,000 on the T5 version
Loaded the same program on the Android Free42 and the Ans is T = 30,002
Try it for yourself! Smile Smile

Regards, Jean-Marc
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Oops! hp42s Mohr's Cicle Program - Jean-Marc - 06-02-2015 08:41 AM



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