Showing posts with label TI-58. Show all posts
Showing posts with label TI-58. Show all posts

Friday, July 15, 2022

TI-58/TI-59 Week: Law of Cosines

TI-58/TI-59 Week:  Law of Cosines


Introduction


[ A ]:  stores either the angle θ or a 

[ B ]:  stores the length of side b

[ C ]:  stores the length of side c


[ D ]:  calculates the length of side a:

a^2 = b^2 + c^2 - 2 * b * c * cos θ


[ E ]:  calculates the angle θ

cos θ = (b^2 + c^2 - a^2) / (2 * b * c)


The angle θ is opposite slot of side a.


Program Listing


000 76 LBL

001 11 A

002 42 STO 

003 01 01

004 92 INV SBR (RTN)


005 76 LBL

006 12 B

007 42 STO

008 02 02

009 92 INV SBR


010 76 LBL

011 13 C

012 42 STO

013 03 03

014 92 INV SBR


015 76 LBL

016 14 D

017 43 RCL

018 02 02

019 33 x^2

020 85 +

021 43 RCL

022 03 03

023 33 x^2

024 75 -

025 02 2

026 65 ×

027 43 RCL

028 02 02

029 65 ×

030 43 RCL

031 03 03

032 65 ×

033 43 RCL

034 01 01

035 39 cos

036 95 =

037 34 √

038 42 STO 

039 04 04

040 INV SBR


041 76 LBL

042 15 E

043 53 (

044 43 RCL

045 02 02

046 33 x^2

047 85 +

048 43 RCL

049 03 03

050 33 x^2

051 75 -

052 43 RCL 

053 01 01

054 33 x^2

055 54 )

056 55 ÷

057 53 (

058 02 2

059 65 ×

060 43 RCL

061 02 02

062 65 ×

063 43 RCL

064 03 03

065 54 )

066 95 =

067 02 INV

068 39 cos  (arccos)

069 42 STO 

070 04 04

071 92 INV SBR


Examples


Calculating a:


Set the TI-58/TI-59 to Degrees mode:


Input:


50° [ A ]

45  [ B ]  (b)

35 [ C ] (c)

[ D ] returns a:  35.00312885


85° [ A ]

100  [ B ]  (b)

70 [ C ] (c)

[ D ] returns a:  116.9607609


Calculating θ:


52 [ A ]  (a)

38 [ B ] (b)

49 [ C ] (c)

[ E ] returns θ:  72.15813198


80 [ A ]  (a)

60 [ B ] (b)

65 [ C ] (c)

[ E ] returns θ:  79.47338145


Note:  The next post will be on July 23, 2022.


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. 


Thursday, July 14, 2022

TI-58/TI-59 Week: Hyperbolic Functions

 TI-58/TI-59 Week:  Hyperbolic Functions


Introduction


The program listing sets up the soft keys as the following:


[ A ] :  calculate sinh


sinh x = (e^x - 1/e^x) / 2


[ 2nd ] ( A' ):  calculate arcsinh (principal branch)


arcsinh x = ln | x + √(x^2 + 1) |


[ B ]:  calculate cosh


cosh x = (e^x + 1/e^x) / 2


[ 2nd ] ( B' ): calculate arccosh (principal branch)


arccosh x = ln | x + √(x^2 - 1) |


[ C ]:  calculate tanh


tanh x = sinh x / cosh x = (e^x - e^(-x)) / (e^x + e^(-x))


[ 2nd ] ( C' ):  calculate arctanh


arctanh x = ln | √((x^2 + 1) / (1 - x)) |


R00 is used in calculation.  Note:  INV ln x, e^x



Program Listing


000 76 LBL   (sinh x)

001 11 A

002 53 (

003 22 INV

004 23 ln x  

005 42 STO

006 00 00

007 75 -

008 43 RCL

009 00 00

010 35 1/x

011 54 )

012 55 ÷

013 02 2

014 95 = 

015 92 INV SBR  (RTN)


016 76 LBL   (arcsinh x)

017 16 A'

018 42 STO

019 00 00

020 85 +

021 53 (

022 43 RCL

023 00 00

024 33 x^2

025 85 -

026 01 1

027 54 )

028 34 √

029 95 =

030 50 |x|

031 23 ln x

032 92 INV SBR


033 76 LBL (cosh x)

034 12 B

035 53 (

036 22 INV

037 23 ln x 

038 42 STO

039 39 00

040 85 +

041 43 RCL

042 00 00

043 35 1/x

044 54 )

045 55 ÷

046 02 2

047 95 =

048 92 INV SBR


049 76 LBL (arccosh x)

050 17 B'

051 42 STO

052 00 00

053 85 +

054 53 (

055 43 RCL

056 00 00

057 33 x^2

058 75 -

059 01 1

060 54 )

061 34 √

062 95 =

063 50 |x|

064 23 ln x

065 92 INV SBR


066 76 LBL (tanh x)

067 13 C

068 53 (

069 22 INV

070 23 ln x

071 42 STO

072 00 00

073 75 -

074 43 RCL

075 00 00

076 35 1/x

077 54 )

078 55 ÷

079 53 (

080 43 RCL

081 00 00

082 85 +

083 43 RCL

084 00 00

085 35 1/x

086 54 )

087 95 =

088 92 INV SBR


089 76 LBL (arctahn x)

090 18 C'

091 53 (

092 42 STO

093 00 00

094 85 +

095 01 1

096 54 )

097 55 ÷

098 53 (

099 01 1

100 75 -

101 43 RCL

102 00 00

103 54 )

104 95 =

105 34 √

106 50 |x|

107 23 ln x

108 92 INV SBR


Examples


sinh 3.96;  3.96 [ A ] returns 26.21913142


arcsinh 40;  40 [ 2nd ] (A') returns 4.382182848


cosh -2.22;  -2.22 [ B ] returns 4.657969987


arccosh 100:  100 [ 2nd ] (B') returns 5.298292366


tanh 0.58:  0.58 [ C ] returns 0.5226654297


arctanh 0.96:  0.96 [ 2nd ] (C') returns 1.94591014906


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. 


Wednesday, July 13, 2022

TI-58/TI-59 Week: Adding Machine

TI-58/TI-59 Week:  Adding Machine


Introduction


Turn your TI-58 and TI-59 into an adding machine, which uses register R00 as the accumulator. 


The soft keys do the following functions:


[ A ]:  Clear the accumulator

[ B ]:  Add [ + ]

[ +/- ] B:  Subtract [ - ]

[ C ]:  Multiply [ × ]

[ 1/x  ] [ C ]:  Divide [ ÷ ]

[ D ]:  Add % 

[ E ]:  Recall the accumulator


Program Listing


000 76 LBL

001 11 A

002 00 0

003 42 STO

004 00 00

005 92 INV SBR (RTN)


006 76 LBL

007 12 B

008 44 SUM

009 00 00

010 61 GTO

011 15 E


012 76 LBL

013 13 C

014 49 Prd

015 00 00

016 61 GTO

017 15 E


018 76 LBL

019 14 D

020 55 ÷

021 01 1

022 00 0

023 00 0

024 65 ×

025 43 RCL

026 00 00

027 95 =

028 44 SUM

029 00 00

030 61 GTO

031 15 E


032 76 LBL

033 15 E

034 43 RCL

035 00 00

036 92 INV SBR (RTN)


Example


Clear the Register:  [ A ]

Add 15:  15 [ B ]   (Result:  15)

Add 30:  30 [ B ]   (Result:  45)

Triple:  3 [ C ]   (Result:  135)

20% Discount:  20 [ +/- ] [ D ]  (Result:  108)

Halve:  2 [ 1/x ] [ C ] (Result:  54)

Subtract 30:  30 [ +/- ] [ B ]  (Result:  24)

Add 50%:  50 [ D ]  (Result: 36)

Recall the register:  [ E ]  (Result:  36)


Enjoy the accumulator.  


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. 

Tuesday, July 12, 2022

TI-58/TI-59 Week: Numerical Derivative

TI-58/TI-59 Week:  Numerical Derivative


Introduction


The program estimates the numeric derivative:


d/dx f(x) = (f(x + h) - f(x)) / h


Registers used:

R01:  x

R02:  h

R03:  d/dx


Labels:

[ A ]:  store x

[ B ]:  store h

[ C ]:  calculate derivative


LBL E:  store f(x), assume x is in the display.  You can use registers R00 and R06 and above for registers.  Use Rad  ( [ 2nd ] [ - ] ) if f(x) contains trigonometric functions.  End each function with the steps =, INV SBR (RTN)


Function Listings


(step number, key code, key)


000 76 LBL

001 11 A

002 42 STO

003 01 01

004 92 INV SBR (RTN)


005 76 LBL

006 12 B

007 42 STO

008 02 02

009 92 INV SBR (RTN)


010 76 LBL

011 13 C

012 43 RCL

013 01 01

014 85 +

016 43 RCL

017 02 02

018 71 SBR

019 15 E

020 42 STO

021 03 03

022 43 RCL

023 01 01

024 71 SBR

025 15 E

026 94 +/-

027 85 +

028 43 RCL

029 03 03

030 95 =

031 55 ÷

032 43 RCL

033 02 02

034 95 =

035 42 STO

036 03 03

037 92 INV SBR (RTN)


038 76 LBL

039 15 E

...      .... ....

n-1 95 =

nnn 92 INV SBR (RTN)


Examples


f(x) = sin x;    Rad, sin


x = 0.5, h = 0.1, [ C ] returns 0.8521693479

x = 0.5, h = 1E-8, [ C ] returns 0.87755


f(x) = (1 + cos x)^1.5;   Rad, cos, +, 1, =, y^x, 1.5


x = 2, h = 0.01, [ C ] returns -1.035743295

x = 2, h = 1E-8, [ C ] returns -1.04206


f(x) = x * e^(x);   STO, 00, e^x * RCL, 00


x = 3, h = 0.01, [ C ] returns 80.84630054

x = 3, h = 1E-5, [ C ] returns 80.342648


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. 


Monday, July 11, 2022

TI-58/TI-59 Week: ML 13 Curve Solution

 TI-58/TI-59 Week:  ML 13 Curve Solution


Introduction


Today's blog entry highlights just one of the wonderful programs offered by Texas Instrument's Master Library.  


When the Master Library ROM program module is in the TI-58, TI-58C (for this week I will say the TI-58 to refer to both the TI-58 and TI-58C), and the TI-59, call up the Curve Solution by pressing [ 2nd ] [ LRN ] (Pgm) 13.  


The user keys are assigned as:


A:  enter the central angle in radians ( θ )

B:  enter the circle's radius ( r )

C:  enter the arc length ( s )

D:  enter the chord length ( c )

E:  solve for the sector area ( A' )


A':  solve for the central angle ( θ' )

B':  solve for the radius ( r' )

C':  solve for arc length ( s' )

D':  solve for the chord length ( c' )

E':  solve for segment area ( a' )


Enter two of the variables θ, r, s, and c and solve for the rest, and at least one of the two variables θ or r must be entered.  


Examples


Example 1:  Known: r and c


r = 10.8

c = 12.0


[ 2nd ] (Pgm) 13

10.8 [ B ]  ( r )

12.0 [ D ]  ( c )

[ 2nd ] (A'):  1.17806194 rad  ( θ )

[ 2nd ] (C'):  12.72306896  (arc length)

[ E ]:  68.70457237 (sector area)

[ 2nd ] (E'):  14.824706 (segment area)


Example 2:  Known: θ and s


[ 2nd ] (Pgm) 13 

30° angle:   30 [ ÷ ] 180 [ × ] [ 2nd ]  ( π ) [ = ] [ A ]   ( θ )

40 [ C ]  ( s )

[ 2nd ] ( B' ):  76.39437268 ( r )

[ 2nd ] ( D' ): 39.54463718 ( c )

[ E ]:  1527.887454 (sector area)

[ 2nd ] (E'):  68.86240923 (segment area)


A little detour from our usually programming the calculator ourselves, but it is sometimes more effective and efficient to take advantage of either advanced built in or mainstream modules.  Alas, we do return to programming next time,


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. 


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.


RPN HP 12C: Fibonacci and Lucas Sequences

  RPN HP 12C: Fibonacci and Lucas Sequences Golden Ratio, Formulas, and Sequences Let φ be the Golden Ratio: φ = (1 + √5) ÷ 2...