Displaying the Stat Curve Fitting Equations

Contributions to this software library are always welcome. Please ensure that you post program listings rather than .raw files. They give a reasonable idea of what your program does without having to load them into a DM42 and you can also include comments in your code. Check out the following link for a decoder/encoder: https://technical.swissmicros.com/decoders/dm42/

You can then copy/paste the listing and post it in "code" tags.
Post Reply
Epidiah
Posts: 21
Joined: Mon Jan 29, 2018 3:08 am

Displaying the Stat Curve Fitting Equations

Post by Epidiah »

Here's a program I threw together. It fills the alpha register with the equation from current curve-fitting model including the current approximate numerical values of B and M. I did my best to make sure that the whole thing fits on the screen when it's displayed, which might mean some swapping of display modes.

But when it's all said and done, you should see the formula, your original display mode should be restored, and your X and Y registers will have shifted to Z and T with the SLOPE and YINT in their place.

Probably not a terribly useful program, but I had a lot of fun making it and learned a thing or two about the DM42 along the way.

Enjoy,
Eppy

Code: Select all

00 { 462-Byte Prgm }
01▸LBL "CFITEQ"
02 STO "cfX"
03 X<>Y
04 STO "cfY"
05 LASTX
06 STO "cfL"
07 0
08 ENTER
09 ENTER
10 ENTER
11 FS? 39
12 1
13 +
14 FS? 38
15 2
16 +
17 FS? 37
18 4
19 +
20 FS? 36
21 8
22 +
23 STO "cfDGTS"
24 STO "tmpDGTS"
25 CLX
26 FS? 41
27 1
28 +
29 FS? 40
30 2
31 +
32 STO "cfDISP"
33 STO "tmpDISP"
34 3
35 X≠Y?
36 GTO 10
37 STO "tmpDGTS"
38 SF 03
39▸LBL 10
40 FC? 03
41 XEQ IND "tmpDISP"
42 CLA
43 YINT
44 ARCL ST X
45 ALENG
46 STO "YLENG"
47 CLA
48 SLOPE
49 ARCL ST X
50 ALENG
51 STO "XLENG"
52 RCL+ "YLENG"
53 FS? 57
54 14
55 FC? 57
56 18
57 X>Y?
58 GTO 11
59 0
60 FS?C 03
61 STO "tmpDISP"
62 DSE "tmpDGTS"
63 GTO 10
64▸LBL 11
65 CLA
66 RCL "cfDGTS"
67 STO "tmpDGTS"
68 RCL "cfL"
69 STO ST L
70 RCL "cfY"
71 RCL "cfX"
72 YINT
73 SLOPE
74 FS? 57
75 GTO 57
76 FS? 58
77 GTO 58
78 FS? 59
79 GTO 59
80 "y="
81 ARCL ST Y
82 ├"+"
83 ARCL ST X
84 ├"x"
85 GTO 99
86▸LBL 57
87 "y="
88 ARCL ST Y
89 ├"+"
90 ARCL ST X
91 ├" ln x"
92 GTO 99
93▸LBL 58
94 ├" "
95 DSE "YLENG"
96 GTO 58
97 ├"   "
98 ARCL ST X
99 ├"x[LF]y="
100 ARCL ST Y
101 ├"e"
102 GTO 99
103▸LBL 59
104 ├" "
105 DSE "YLENG"
106 GTO 59
107 ├"  "
108 ARCL ST X
109 ├"[LF]y="
110 ARCL ST Y
111 ├"x"
112▸LBL 99
113 XEQ IND "cfDISP"
114 CLV "cfX"
115 CLV "cfY"
116 CLV "cfL"
117 CLV "cfDGTS"
118 CLV "tmpDGTS"
119 CLV "cfDISP"
120 CLV "XLENG"
121 CLV "YLENG"
122 AVIEW
123 RTN
124▸LBL 00
125 SCI IND "tmpDGTS"
126 RTN
127▸LBL 01
128 ENG IND "tmpDGTS"
129 RTN
130▸LBL 02
131 FIX IND "tmpDGTS"
132 RTN
133▸LBL 03
134 CF 03
135 ALL
136 RTN
137 END
Download the .raw here: https://1drv.ms/u/s!AgvdxlfEA5-jqULmreDALqDoYHL3
Post Reply