Showing posts with label HP 35S. Show all posts
Showing posts with label HP 35S. Show all posts

Saturday, October 11, 2025

RPN Calculators: INPUT vs PROMPT

RPN Calculators: INPUT vs PROMPT


Later RPN keystroke programming calculators are able to display alphabetic messages and store to variables for alphabetic names.


HP 32S, HP 32SII, HP 33S, HP 35S, DM32

HP 41C (all variants), DM41X

HP 42S, DM42, DM42n, Free 42

Single letter variable names

Numeric-named variables only

Both numeric-named variables and alphabetic (and alphanumeric) variable names. Alphabetic and alphanumeric named variables are enclosed in quotes (alpha strings) well stored and recalled and take additional memory.

Can display messages by setting Flag 10 and using the equation feature to type messages

Can display messages and prompts

Can display messages and prompts


Two common ways to cue the user to enter values are the INPUT and PROMPT commands.


The INPUT Command: HP 32 and HP 42S (and Swiss Micros/emulator equivalents)


Note: The INPUT command is not available in the HP 41C’s command set.


General syntax: INPUT var


When an INPUT command is encountered, the screen will display [var]?= on the X stack.


Example:

INPUT R displays R? [previous value stored in R]


HP 32 Family: The variable is a single-letter name or the indirect variable i.

HP 42S Family: A custom alpha variable, a numeric-named variable (i.e. 00, 01, 02, etc.), indirect variables, or the stack levels X, Y, T, Z, or L (last argument).


The INPUT has the double benefit of storing whatever is entered into the variable asked for. INPUT will also show the previously stored value, so we can just accept it by pressing R/S to keep the old value.


Example: Volume of a Cone


HP 32 family

HP 42S family

V01 LBL V

V02 INPUT R

V03 INPUT H

V04 π

V05 RCL R

V06 x^2

V07 ×

V08 RCL H

V09 ×

V10 3

V11 ÷

V12 RTN


No quotes are needed for alphabetic variables.



00 {30-Byte Prgm }

01 LBL “VCONE1”

02 INPUT “R”

03 INPUT “H”

04 PI

05 RCL “R”

06 x↑2

07 ×

08 RCL “H”

09 ×

10 3

11 ÷

12 RTN


We could use variables 00 and 01 (for example) for radius and height, respectively, except the input command prompt will show “R00?” or “R01?” which may not be user-friendly.


The INPUT does not replace the contents of the alpha register.


If we want the alphanumeric/alphanumeric variables (“R”, “H”) to be erased, we could have inserted CLV “R” and CLV “H” at the end, but that will erase the value associated with them.



The PROMPT Command: HP 41C and HP 42S (and Swiss Micros/emulator equivalents)


Note: The PROMPT command is not available on the HP 32S family.


General Syntax:

alpha string”

PROMPT

STO var


The alpha string is displayed until something, usually a numeric value, is entered. Unlike the INPUT command, the PROMPT does not automatically store the entered value into a variable. Therefore, if you want to use the value for future use, a STO (store) command must be used following the prompt.


Let’s take our volume of the cone example again:


HP 41C family

HP 42S family

01 LBL “VCONE2”

02 ^T RADIUS?

03 PROMPT

04 STO 00

05 ^T HEIGHT?

06 PROMPT

07 STO 01

08 PI

09 RCL 00

10 X↗2

11 *

12 RCL 01

13 *

14 3

15 /

16 RTN



R00 = radius

R01 = volume

00 { 40-Byte Prgm }

01 LBL “VCONE2”

02 “RADIUS?”

03 PROMPT

04 STO 00

05 “HEIGHT?”

06 PROMPT

07 STO 01

08 PI

09 RCL 00

10 X↑2

11 ×

12 RCL 01

13 ×

14 3

15 ÷

16 RTN



R00 = radius

R01 = volume


With PROMPT, I like to use the numeric-named memory registers, but we can use alphabetic or alphanumeric registers as well.


HP 32SII/DM32: Simulating PROMPT with Flag 10


Even though the HP 32SII does not have a PROMPT command, we can kind of simulate it by using the equation message feature.


To set flag 10: [ |→ ] [ × ]* (FLAGS), { SF }. [ . ] [ 0 ]

To clear flag 10: [ |→ ] [ × ]* (FLAGS), { CF }. [ . ] [ 0 ]

We have to use the decimal point key in order to access flags beyond 9.

(*HP 35S: [ ←| ] [ ↑ ] (FLAGS))


HP 32SII/33S/35S/DM32


W01 LBL W

W02 SF 10

W03 “=RADIUS”

W04 STO R

W05 “=HEIGHT”

W06 STO H

W07 CF 10


W08 π

W09 RCL R

W10 x^2

W11 ×

W12 RCL H

W13 ×

W14 3

W15 ÷

W16 RTN


Turn message mode on

Enter as an equation =RADIUS

Enter radius and press [R/S]

Enter as an equation =HEIGHT

Enter height and press [R/S]

Turn message mode off, so equations can operate normally



Note: Equations are NOT on the original HP 32S.



I hope you find this helpful.


Eddie


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


The author does not use AI engines and never will.

Sunday, April 7, 2024

Swiss Micros SM32: Simulating a Choose Menu

Swiss Micros SM32: Simulating a Choose Menu


The following technique should work for the HP 33S and HP 35S, but most likely HP 32S/32SII due to the lack of memory (you could shorten or eliminate the messages, I suppose.).


What Is Needed


  • We will need at least two labels.
  • The user flags as needed. For the DM32, the user flags are from Flag 0 to Flag 4. This allows for up to five choices.
  • A choice variable. This variable holds the user’s choice from the menu. The algorithm presumes that the user will always enter a valid choice.
  • Clever calculation, as we start with the reference value in the X stack.
  • Flag 10, which allows us to display the choices and messages.



General Algorithm Format


LBL 1 (run the algorithm here)

CF 0 through CF 4 (as needed)

SF 10 ( [ |→ ] {FLAGS} {SF} [ . ] 0 )

“introduction message” (if desired)

PSE (follow each string with a pause)



LBL 2 (menu and main calculation)

“#a (description)”

PSE

“#b (description)”

PSE

INPUT CV (choice variable)


RCL CV

#a

x=y?

Value_a


RCL CV

#b

x=y?

INPUT α


STO α (store a reference value for future use)


(calculation)


CF 0, CF 1, CF 2, CF 3, CF 4 (clear all flags used)

CF 10

“RESULT =“ (if desired)

PSE (if desired)

VIEW (variable with result)

GTO (Lbl 1) or RTN


Notes: 

  • #a, #b, … corresponding flags, 0 – 4.
  • CV: choice variables (i.e. C, H, etc.)
  • α: reference value used
  • Choice #b demonstrates how we can allow the user to input their own value.


Entering Strings


Setting Flag 10 turns equation evaluation off. Now each typed “equation” now acts as a string. Enter strings by:


1. Pressing the right shift key [ |→ ], or the blue shift key on the DM32, then [ ST0 ] { EQN }.

2. Letters are entered by pressing [ RCL ] { letter }. Numbers can be entered as well. The equals key is entered by pressing [ |→ ]/[ blue shift ] [ ← ] { = }. The screen is 12 characters long before it scrolls. Note: We do not have the period or the question mark as available characters.

3. Press [ ENTER ] to go on to the next line.



Choice Variable


The choice variable is a pointer to the reference value. There is a one-on-one correspondence between the choice value and the reference value.


For example, say H is the choice variable and reference values are assigned as follows:


H = Choice Variable

Reference Value

1

13.5

2

14.7

3

16.1

If the user selects option 1, then 13.5 is placed on the X stack ready for calculation.

If the user selects option 2, then 14.7 is placed on the X stack ready for calculation.

If the user selects option 3, then 16.1 is placed on the X stack ready for calculation.



Example: Impedance of Transmission Lines


The characteristic impedance of transmission lines of a coaxial line is:


Z = K / √ε × log( D / L ) where:


K = √μ0 / (2 × π × √ε0 × log e) ≈ 138.059528959

D = inner diameter of outer conductor

L = outer diameter of inner conductor

ε = relative permittivity of dielectric medium (E)


The program give us three choices for the dielectric medium:


Material/Choice Variable ( C )

ε

1: Polythene (Flag 1)

2.3

2: Plexiglass (Flag 2)

3.2

3: Your Own (Flag 3)

Enter the ε of the material of your choice at the E? prompt


K is a constant that consists of the following scientific constants:


Vacuum Permeability

μ0 = 1.566370614 × 10^-6 H/m


Vacuum Permittivity

ε0 = 8.854187817 × 10^-12 F/m


Values are taken from the HP Prime, Software Version 2.1.14730 (2023 04 13).


SM32 Code

(Note: This should work on both the HP 33S and HP 35S; and the HP 35S can contain all the code in one label with the correct GTO commands)


// comment


// main program and initialization

T01 LBL T

T02 CF 1

T03 CF 2

T04 CF 3

T05 SF 10

T06 “TRANS-LINE IMP”

T07 PSE


// menu and calculation

M01 LBL M

M02 “REL PERMIT”

M03 PSE

M04 “1 POLYTHENE”

M05 PSE

M06 “2 PLEXIGLASS”

M07 PSE

M08 “3 YOUR OWN”

M09 PSE

M10 INPUT C


// set the flag based on the choice variable

M11 RCL C

M12 1

M13 x=y?

M14 SF 1


M15 RCL C

M16 2

M17 x=y?

M18 SF 2


M19 RCL C

M20 3

M21 x=y?

M22 SF 3


// enter reference value based on choice variable

M23 FS? 1

M24 2.3


M25 FS? 2

M26 3.2


M27 FS? 3

M28 INPUT E

M29 STO E


// calculation

M30 SQRT

M31 1/x

M32 138.059528959

M33 ×

M34 INNER DIAM

M35 PSE

M36 INPUT D

M37 OUTER DIAM

M38 PSE

M39 INPUT L

M40 ÷

M41 LOG

M42 ×

M43 STO Z


// clean up: clear all the flags for the next calculation

M44 CF 1

M45 CF 2

M46 CF 3

M47 CF 10

M48 VIEW Z

M49 STOP

// press R/S to do another problem

M50 GTO T




Examples

Let D = 0.68 in and L = 0.195 in.


Choice 1: Polythene. Resistance: 49.3835 Ω

Choice 2: Plexiglass. Resistance: 41.8669 Ω

Choice 3: ε = 1.95. Resistance: 53.6325 Ω



Source

Hewlett-Packard Company. HP-46 sample applications. Loveland, CO. February 1,1975. Part No. 00046-90018. pg. 26



Hope you find this useful,

Eddie


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


Sunday, October 30, 2022

Paco Arjonilla: HP 35S Program Suite

 Paco Arjonilla:  HP 35S Program Suite



On today's blog post, I am going to highlight a recent suite of programs, written by Paco Arjonilla, is designed to compliment the rich function set of the HP 35S calculator.


Each category will have a set of programs of functions.  Stack diagrams are provided in the documentation.  Each category belongs to a single label.


Label P:  vector functions (includes norm, cross product, 3 x 3 determinant) - 149 steps


Label G:  complex numbers (conjugate, polar/rectangular conversions, construct and break down complex numbers) - 48 steps


Label Q:  quaternions (construction, angle, rotation) - 80 steps


Label K:  quadratic equation solver - 28 steps


Label H:  save stack data to variables - 55 steps


Label I:  recall saved stack - 55 steps


Label J:  stack operations (push and pop the x stack, delete the x stack, clear reserved memory registers, copy memory registers) - 159 steps


Paco's website also has a cheat sheet which can be downloaded as a PDF file.


For the programs and for license information, click here:  


http://www.pacoarjonilla.es/HP-35s.html



Special thanks to Paco Arjonilla.


Eddie 



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


Saturday, June 25, 2022

Retro Review: Hewlett Packard HP 33S

Retro Review:   Hewlett Packard HP 33S








The calculator with the Chevron Keyboard!

Quick Facts

Model:  HP 33S
Company:  Hewlett Packard
Years:  2003-2007
Type:  Scientific
Batteries: 2 x CR-2032
Operating Modes:  RPN, ALG
Memory:  31,277 bytes
Number of Registers: 27, A-Z, i
Display:  2 stack levels

Features

*  standard scientific calculator functions: trig, logs, power, absolute value, integer and fractional part, combinations, permutations, random numbers, hyperbolic functions, and more
*  factorial function that allows real numbers;  Γ(x) = (x - 1)!
*  polar and rectangular conversion functions,  very popular (for good reason) 
*  40 scientific constants
*  8 sets of SI-US conversions
*  base conversions 
*  algebraic mode (which I don't know anyone who would use this calculator in algebraic mode, but it's there)
*  linear regression  (y = mx + b)
*  fraction display mode ( [ ←| ] [ . ] (FDISP))
*  storage and recall arithmetic

We can store equations for evaluation, solving, and integration.  

Full list of conversions:

Polar (→θ,r) - Rectangular (→y,x)
Hours (→HR) - Hours-Minutes-Seconds (→HMS)
Degrees - Radians
Kilograms - Pounds
Degrees Celsius - Degrees Fahrenheit
Centimeters - Inches
Liters - Gallons

Programming

The HP 33S has keystroke programming and the set of commands similar from the HP 32SII:  

*  INPUT var
*  VIEW var  (views the variable without putting the variable's value on the stack)
*  Subroutines and Return
*  Comparison tests between x and 0, x and y.  If the test is true, execute the next step, otherwise skip the next step
*  ISG:  Increment and skip if greater
*  DSE:  Decrement and skip if equal or less than

The HP 33S designates one register, lower case i, for indirect addressing.  The absolute integer value of i determines where storage, recall, label, subroutine, integration variable, exchange, and function designation.  Use (i) to use indirect addressing.  Indirect registers can also access statistical sums:

(i) = 27,  i 
(i) = 28,  n
(i) = 29,  Σx
(i) = 30,  Σy
(i) = 31,  Σx^2
(i) = 32,  Σy^2
(i) = 33,  Σxy

The HP 33S has 26 labels, which restrict programs to 26.  Hence, LBL A instead of LBL A0001.   At first, I didn't like the restriction, but I learned to live with it and don't mind it as much.  

Let's Talk About the Chevron Keyboard

The HP 33S is a unique calculator it's keyboard style:  the keys take a slanted quadrilateral shape, with the center column of keys taking a chevron style shape.   At the top there is a directional pad.  Hewlett Packard took a chance with the design from the standard calculator shape, and it was not a homerun.   

The beginning production of the HP 33S was not successful. Keys had bad responses, the display was not up to par, and some keys are hard to press.   It took Hewlett Packard several production runs to get the keyboard working right, which unfortunately killed the reputation of the HP 33S.  Towards the end of its run, the keyboards were fixed.

I don't mind the unique keyboard, my biggest issue was the spacing the keys where sometimes the shifted functions and alpha characters did not have much space.  This made the keyboard busy.  I also do not like the black arrows on the green and purple backgrounds on the shift keys, I use HP used a lighter font for those arrows.  

A Phoenix of Calculators  

When the HP 33S first hit the market, the calculator was disliked.  Now, it is a sought after calculator.   The original price for the 33S was about $50 US dollars, now if you want one, be prepared to pay at least $75 US dollars, sometimes triple digits.  Make sure you are buying the HP 33S from later in the run (towards 2007).  

Another factor of why the HP 33S is becoming a collector's calculator, the successor, the HP 35S, had several shortcomings such as the number of mathematical bugs and the lack of the rectangular and polar conversion functions.   The HP 33S is closer to the classic style, like the HP 32S and HP 32SII.  

I don't expect to ever be an anniversary edition of the HP 33S but it was an underrated calculator and has its place in calculator history.

Tomorrow I have a list of programs and an integer demonstration.  

Eddie

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



Saturday, November 9, 2019

HP 35S: Determinant and Cramers Rule - 3 x 3 Matrices

HP 35S: Determinant and Cramers Rule - 3 x 3 Matrices

Determinant of a 3 x 3 Matrix

The following program calculates a determinant of a matrix:

[ [ K, N, Q ]
[ L, O, R ]
[ M, P, S ] ]

The determinant is  K*O*S + N*R*M + Q*L*P - M*O*Q - P*R*K - S*L*N.

Enter the elements in columns. 

Program HP 35S:  Determinant

D001 LBL D
D002 SF 10
D003 "DET 3x3"
D004 CF 10
D005 INPUT K
D006 INPUT L
D007 INPUT M
D008 INPUT N
D009 INPUT O
D010 INPUT P
D011 INPUT Q
D012 INPUT R
D013 INPUT S
D014 RCL K
D015 RCL* O
D016 RCL* S
D017 RCL N
D018 RCL* R
D019 RCL* M
D020 +
D021 RCL Q
D022 RCL* L
D023 RCL* P
D024 +
D025 RCL M
D026 RCL* O
D027 RCL* Q
D028 -
D029 RCL P
D030 RCL* R
D031 RCL* K
D032 -
D033 RCL S
D034 RCL* L
D035 RCL* N
D036 -
D037 RTN

Examples:

[ [ -3, 3, 2 ]
[ 5, 4, -1 ]
[ 2, 1, 4 ] ]
Determinant:  -123

[ [ 5, 0, 7 ]
[ -2, 4, -1 ]
[ -3, 11, 6 ] ]
Determinant:  105

Cramer's Rule

Cramer's Rule solves the linear system:

[[ A, D, G ]   [[ x ]  = [[ X ]
[ B, E, H ]     [ y ]  = [ Y ]
[ C, F, I ]]      [ z ]] = [ Z ]]

x = U, y = V, z = W,  T = determinant of the coefficients

Program HP 35S: Cramer's Rule

C001 LBL C
C002 GTO C027
C003 RCL K     // determinant calculation
C004 RCL* O
C005 RCL* S
C006 RCL N
C007 RCL* R
C008 RCL* M
C009 +
C010 RCL Q
C011 RCL* L
C012 RCL* P
C013 +
C014 RCL M
C015 RCL* O
C016 RCL* Q
C017 -
C018 RCL P
C019 RCL* R
C020 RCL* K
C021 - 
C022 RCL S
C023 RCL* L
C024 RCL* N
C025 - 
C026 RTN
C027 SF10  // input numbers into the system
C028 "COL 1"
C029 INPUT A
C030 STO K
C031 INPUT B
C032 STO L
C033 INPUT C
C034 STO M
C035 "COL 2"
C036 INPUT D
C037 STO N
C038 INPUT E
C039 STO O
C040 INPUT F
C041 STO P
C042 "COL 3"
C043 INPUT G
C044 STO Q
C045 INPUT H
C046 STO R
C047 INPUT I
C048 STO S
C049 "VECTOR" 
C050 INPUT X
C051 INPUT Y
C052 INPUT Z
C053 XEQ C003
C054 STO T
C055 "DET="
C056 VIEW T
C057 RCL X
C058 STO K
C059 RCL Y
C060 STO L
C061 RCL Z
C062 STO M
C063 XEQ C003
C064 RCL÷ T
C065 STO U
C066 "X="
C067 STOP
C068 RCL A
C069 STO K
C070 RCL B
C071 STO L
C072 RCL C
C073 STO M
C074 RCL X
C075 STO N
C076 RCL Y
C077 STO O
C078 RCL Z
C079 STO P
C080 XEQ C003
C081 RCL÷ T
C082 STO V
C083 "Y="
C084 STOP
C085 RCL D
C086 STO N
C087 RCL E
C088 STO O
C089 RCL F
C090 STO P
C091 RCL X
C092 STO Q
C093 RCL Y
C094 STO R
C095 RCL Z
C096 STO S
C097 XEQ C003
C098 RCL÷ T
C099 STO W
C100 "Z="
C101 CF 10
C102 TOP
C103 RTN

Examples:

[[ -3, 2, -4 ]   [[ x ]  = [[ 0 ]
[ 6, 1, 2 ]       [ y ]  = [ 2 ]
[ 3, 3, 7 ]]      [ z ]] = [ 6 ]]
T:  -135
x ≈ 0.0296
y ≈ 0.9333
z ≈ 0.4444

[[ 0, 10, 6 ]  [[ x ] = [[ 3 ]
[ 5, 3, 8 ]     [ y ]  = [ 6.5 ]
[ -5, 8, 2 ]]    [ z ]] = [ 7 ]]
T:  -830
x ≈ -0.0843
y ≈ 0.6687
z ≈ 0.6145

Source:

Pike, Scott.  "Using Cramer's Rule to Solve Three Equations with Three Unknowns"  Mesa Community College.  http://www.mesacc.edu/~scotz47781/mat150/notes/cramers_rule/Cramers_Rule_3_by_3_Notes.pdf  Retrieved September 24, 2019

Eddie

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

HP 32SII and TI-66: Curve Fitting

HP 32SII and TI-66:  Curve Fitting

Introduction

The curve fitting program uses the linear regression module to determine the parameters b ("intercept") and m ("slope") in non-linear curves using following transformations:

Logarithmic Regression:  y = b + m * ln x
Transformations:  ( ln x, y, b, m )

Inverse Regression:  y = b + m / x
Transformations:  ( 1/x, y, b, m )

Exponential Regression:  y = b * e^(m * x)
Transformation:  ( x, ln y, e^b, m )

Power Regression:  y = b * x^m
Transformation:  ( ln x, ln y, e^b, m )

Geometric (Exponent) Regression:  y = b * m^x
Transformation:  ( x, ln y, e^b, e^m )

Simple Logistic Regression:  y = 1 / (b + m * e^(-x))
Transformation:  ( e^(-x), 1/y, b, m )

HP 32SII Program:  Curve Fitting

Note:
1.  This can be adapted into the HP 35S under one label.  Just take note of the where the label points are.
2.  The total amount of bytes used is 90.
3.  Flags 1 and 2 are used.  If flag 1 is set, e^m is calculated as slope.  If flag 2 is set, e^b is calculated as intercept.

Program:
// Initialize - LBL X
LBL X
CF 1
CF 2
CLΣ
0
RTN

// Calculation - LBL Y
LBL Y

FS? 2
e^x
STO B
VIEW B
m
FS? 1
e^x
STO M
VIEW M

STO R
VIEW R
RTN

// Logarithmic Regression - LBL L
LBL L
LN 
R/S
GTO L

// Inverse Regression - LBL I
LBL I
1/x
R/S
GTO I

// Exponential Regression - LBL E
LBL E
SF 2
x<>y
LN 
x<>y
R/S
GTO E

// Power Regression - LBL P
LBL P
SF 2
LN 
x<>y
LN 
x<>y
R/S
GTO P

// Geometric/Exponent Regression - LBL G
LBL G
SF 1
SF 2
x<>y
LN
x<>y
R/S 
GTO G

// Simple Logistic Regression - LBL S
LBL S
+/-
e^x
x<>y
1/x 
x<>y
STOP 
GTO S

Instructions:
1.  Clear the statistics data and flags by pressing [XEQ] X.
2.  Enter data points, run the proper label, and press [ Σ+ ] or [ Σ- ].

For example, for Logarithmic fit:
y_data [ENTER] x_data [XEQ] L [ Σ+ ]

Subsequent Data:
y_data [ENTER] x_data [R/S] [ Σ+ ]

This scheme allows for undoing data:
y_data [ENTER] x_data [XEQ] L [ Σ- ]

3.  Calculate intercept (B), slope (M), and correlation (R), press [XEQ] Y.

TI-66 Program:  Curve Fitting

Notes:
1.  This program should be able to entered on a TI-58, TI-58C, or TI-59.  At the time of the posting, I have not done it, so I don't have the key codes.
2.  94 steps are used.  [INV] [SBR] is merged into the RTN step.
3.  Flags 1 and 2 are used.  If flag 1 is set, e^m is calculated as slope.  If flag 2 is set, e^b is calculated as intercept.

Program:
// Initialize - key [ A ]
000 LBL
001 A
002 INV
003 ST.F
004 01
005 INV
006 ST.F
007 02
008 CSR
009 0
010 RTN

// Calculation - key [ A' ]
011 LBL
012 A'
013 OP
014 12
015 INV
016 IF.F
017 02
018 (   // left parenthesis
019 INV
020 LN X
021 LBL
022 (  // left parenthesis
023 STO
024 08
025 R/S
026 X<>T
027 INV
028 IF.F
029 01
030 )  // right parenthesis
031 INV
032 LN X
033 LBL
034 )  // right parenthesis
035 STO 
036 07
037 R/S
038 OP
039 13
040 STO
041 09
042 RTN

// Logarithmic Regression - key [ B ]
043 LBL
044 B
045 LN X
046 X<>T
047 R/S
048 RTN

// Inverse Regression - key [ C ]
049 LBL 
050 C
051 1/X
052 X<>T
053 R/S
054 RTN

// Exponential Regression - [ D ]
055 LBL 
056 D
057 ST.F
058 02
059 X<>T
060 R/S
061 LN X
062 R/S
063 RTN

// Power Regression - [ B' ]
064 LBL
065 B'
066 ST.F
067 02
068 LN X
069 X<>T
070 R/S
071 LN X
072 R/S
073 RTN

// Geometric/Exponent Regression - [ C' ]
074 LBL
075 C'
076 ST.F
077 01
078 ST.F
079 02
080 X<>T
081 R/S
082 LN X
083 R/S
084 RTN

// Simple Logistic Regression - [ D' ]
085 LBL
086 D'
087 +/-
088 INV
089 LN X
090 X<>T
091 R/S
092 1/X
093 R/S
094 RTN

Instructions:
1.  Clear the statistics data and flags by pressing [  ].
2.  Enter data points: enter x, run the proper label, enter y, press [R/S] and press [2nd] ( Σ+ ) or [INV] [2nd] ( Σ+ )  (for  Σ- ).

For example, for Logarithmic fit:
x_data [ B ] y_data [R/S]  [2nd] (Σ+)

This scheme allows for undoing data:
x_data [B] y_data [R/S] [INV] [2nd] (Σ+)

3.  Calculate intercept (B), slope (M), and correlation (R), press [2nd] [ A' ].

Examples

All results are rounded.

Example 1: Logarithmic Regression
Data (x,y):
(33.8, 102.4)
(34.6, 103.8)
(36.1, 105.1)
(37.8, 106.9)

Results:
B:  -33.4580
M:  38.6498
R:  0.9941

y ≈ -33.4580 + 38.6498 ln x

Example 2:  Inverse Regression
Data (x,y):
(100, 425)
(105, 429)
(110, 444)
(115, 480)

B:  823.80396
M:  -40664.72143
R:  -0.91195

y ≈ 823.80396 - 40664.72143/x

Example 3: Simple Logistic Regression
Data (x,y):
(1, 11)
(1.3, 9.615)
(1.6, 8.75)
(1.9, 8.158)
(2.6, 7.308)

B: 0.14675
M: -0.15487
R:  -0.99733

y ≈ 1 / (0.14675 - 0.15487*e^(-x))


Eddie

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


Python – Earth’s Radius and Gravity in US Units

Python – Earth’s Radius and Gravity in US Units Introduction The following script, gravus2.py, estimates the Earth’s gravity i...