Tampilkan postingan dengan label exponential. Tampilkan semua postingan
Tampilkan postingan dengan label exponential. Tampilkan semua postingan

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. 


Casio fx-CG 50 and fx-9750GIII: Regression Builder

Casio fx-CG 50 and fx-9750GIII:  Regression Builder


Introduction


The program LRBUILD lets the user fit bi-variate data (x,y) to a customized regression equation in the form:


y = C + Σ Cₙ * fₙ(x) 


where:


C = constant term.  This term is automatically calculated for by the program.


Cₙ = coefficient of each subsequent term of fₙ(x)


fₙ(x) = function, where the user can choose any of the following forms:


1.  x^A

2.  ln(A * x)

3.  e^(A * x)

4.  sin(A * x)


where A is a real number.  Angles are assumed to be in radian measure.  


For example, we can fit data by least squares method to this equation:


y = C + C_1 * x^2 + C_2 * e^(0.5 * x) + C_3 * sin(x)


You can add as many fₙ(x) terms as you like.


The program will give you the coefficients in a vertical matrix, starting from C and so forth, and the R^2 goodness of fit:


R^2 = 1 - SS_res / SS_tot


SS_res = Σ( y_observed - y_predicted)^2


SS_tot = Σ(y_observed - mean(y_oberserved))^2



Notes:


The characters _n (lower subscript n) and Σ (sigma symbol) are found on the CHAR (Character Select) on the programming editor menu (almost exit until the soft menu TOP, BOTTOM, SEARCH, ... displays).


The lines:


For 1 → I To 750

Next


are used to create a short pause.


There are two versions:  


Program files with the g3m extension is for the color Casio graphing calculators, such as the fx-CG50.   You can download this file here:

https://drive.google.com/file/d/1YidknrzjU_oRT3KLIzkEogbU_XFBCH0j/view?usp=sharing



Program files with the g1m extension is for the monochrome Casio graphing calculators, such as the fx-9750GIII (United States) and the fx-9860GIII (International).  You can download this file here:

https://drive.google.com/file/d/1GOO6VHGV_JRlNlbZB8ww3hK1qDqZaag_/view?usp=sharing



To transfer between Casio calculators, it is recommended to save them as text files.  Then transfer to the SAVE-F folder and load it on the home calculator.  Some editing may be necessary, such as <-1> with x^-1.


Casio fx-9750gIII and fx-CG50 (and probably most other Casio modern graphing calculators) Program: LRBUILD

(Extra spaces included for readability - this meant to be typed on the calculator)


Rad

ClrText

Locate 1,1,"LIN REG BUILDER"

Locate 1,2,"EWS 2022-01-17"

Locate 1,3,"Y=C+Σ(C_n×F_n(X))"   (n is the lower script n from the CHAR screen)

For 1 → I To 750

Next

"X DATA"? → List 1

"Y DATA"? → List 2

Dim List 1 → N

Dim List 1 → Dim List 3

{0} → List 4

{0} → List 5

Seq(1,X,1,N,1) → List 6

List→Mat(List 6) → Mat A

List→Mat(List 2) → Mat B

"CONSTANT TERM ADDED"

For 1 → I To 750

Next

Lbl 0

Menu "TERM?", "X^A", 1, "ln (AX)", 2, "e^(AX)", 3, "sin (AX)", 4, "CALCULATE", 5

Lbl 1

"A"? → A

Augment(List 4, {1}) → List 4

Got A

Lbl 2

"A"? → A

Augment(List 4, {2}) → List 4

ln(A×List 1) → List 6

Goto A

Lbl 3

"A"? → A

Augment(List 4, {3}) → List 4

e^(A×List 1) → List 6

Goto A

Lbl 4

"A"? → A

Augment(List 4, {4}) → List 4

sin(A×List 1) → List 6

Goto A

Lbl A

Augment(List 5, {A}) → List 5

List→Mat(List 6) → Mat D

Augment(Mat A, Mat D) → Mat A

Goto 0

Lbl 5

Dim List 4 → M

(Trn Mat A × Mat A)^-1 × Trn Mat A × Mat B → Mat C

"COEFFS:" ◢

Mat C ◢  

For 1 → I to N

0 → Y

For 1 → J To M

List 4[ J ] → L

List 5[ J ] → A

Mat C[ J, 1 ] → C

List 1[ I ] → X

L = 0 ⇒  Y + C → Y

L = 1 ⇒ Y + C × X^A → Y

L = 2 ⇒ Y + C × ln(AX) → Y

L = 3 ⇒ Y + C × e^(AX) → Y

L = 4 ⇒ Y + C × sin(AX) → Y

Next

Y = 0 ⇒ 1E-7    (lower case 10 on the fx-CG 50)

Y → List 3[ I ]

Next

1 - (Sum (List 2 - List 3)^2)÷(Sum (List 2 - Mean(List 2))^2) → R

"R^2="

R ◢

List→Mat(List 1, List 2, List 3) → Mat D



Variables:


List 1:  X Data

List 2:  Y Data

List 3:  Expected Y Data (Calculated)

List 4:  Operation Types:  0 - constant, 1 - x^a, 2 - ln(a*x), 3 - e^(a*x), 4 - sin(a*x)

List 5:  A


Mat A:  X data matrix 

Mat B:  Y data matrix

Mat C:  matrix of calculated coefficients



Examples


Example 1:

Fit the following data:


x data = {10, 25, 34, 46, 65}

y data = {39.7, 100, 135.9, 183.9, 260}


to the curve y = C + C1 * x + C2 / x


Remember the constant term is automatic.   

On the TERM? menu, select 

1.  X^A with A = 1

1.  X^A (again), this time with A = -1

5.  CALCULATE


Calculated coefficients:

[[ 0.1012904425 ]

[ 3.99874051 ]

[ -3.775351133 ]]


y = 0.012904425 + 3.99874051x - 3.775351133/x


R^2 = 0.9999994909


y' predicted data: 

{39.71116043, 99.91878916, 135.947281, 183.9612811, 259.9613413}


Example 2:

Fit the following data:


x data = {-0.35, -0.16, 0.27, 0.84}

y data = {-0.64, -0.31, 0.58, 2.06}


to the curve y = C + C1 * sin x  + C2 * e^x


Remember the constant term is automatic.   

On the TERM? menu, select 

4.  sin(A*X) with A = 1

3.  e^(A*X) with A = 1

5.  CALCULATE


Calculated coefficients:

[[ -0.9847711767 ]

[ 1.023495272 ]

[  0.9854914931 ]]


y = -0.9847711767 + 1.023495272 * sin x + 0.9854914931 * e^x


R^2 = 0.9999986129


y' predicted data:

{-0.6412613439, -0.3080521531, 0.5791860102, 2.060127487}


Example 3:

Fit the following data:


x data = {2, 3, 4, 5, 6}

y data = {22.5, 34, 45.5, 57.5, 69.75}


to the curve y = C + C1 * x^1.2 + C2 * ln(3*x)


Remember the constant term is automatic.   

On the TERM? menu, select 

1.  X^A with A = 1.2

2.  ln(A*X) with A = 3

5.  CALCULATE


Calculated coefficients:

[[ -0.08646217016 ] 

[ 6.83429695 ]

[ 3.855357541 ]]


y = -0.08646217016 + 6.83429695 * x^1.2 + 3.855357541 * ln(3* x)


R^2 = 0.9999924407


y' predicted data:

{22.52250254, 33.92570965, 45.56537698, 57.50145068, 69.73496014}


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. 


Backlink 9999 Traffic Super

Order Now...!!!!