Sunday, April 9, 2023

Casio fx-9750GIII: Drawing the Unit Circle with an Angle

Casio fx-9750GIII:  Drawing the Unit Circle with an Angle


Introduction


The program TRIGCIRC draws a unit circle on the left side of the screen with any angle entered.  This program is an approximate simulation to the trigonometric circle application that is set to appear on future Casio non-graphing calculators in Europe, such as Belgium version of the fx-92.  Link:  https://tiplanet.org/forum/viewtopic.php?p=271049#p271049  


The program uses the full unit circle only.  



Casio fx-9750GIII Program: TRIGCIRC

(316 bytes)


Code:


Lbl 5

ClrText

Menu "ANGLE","DEG",1,"RAD",2,"GRAD",3

Lbl 1:Deg:Goto 4

Lbl 2:Rad:Goto 4

Lbl 3:Gra:Goto 4

Lbl 4

ClrGraph

ViewWindow -1.5,5,1,-1.5,1.5,1

"ANGLE"?→A

SketchThick Circle 0,0,1

SketchThick F-Line 0,0,cos A,sin A

Text 5,70,"sin θ:"

Text 12,70,sin A

Text 19,70,"cos θ:"

Text 26,70,cos A

If cos A≠0

Then

Text 33,70,"tan θ:"

Text 40,70,tan A

IfEnd

Text 47,70,"θ:"

Text 54,70,A◢

Menu "AGAIN?","YES",5,"NO",6

Lbl 6

"END - 2023 EWS"



Program Notes:


1.  Adding a display command, ◢, after a draw command like Text freezes the draw screen.  Program execution continues by pressing [ EXE ].


2.  The Text command works with pixels rather than Cartesian points.   Line numbers range from 0 to 63, top to down.  Column numbers range from 0 to 127, right to left.


3.  Syntax of Text:  Text line number, column number, text.   Text may have a string or a variable, but not both.


4.  I have a wrap-around label (Lbl 5) to let the user enter multiple angles.


5.  Due to the linear output of the programming mode, results are shown in floating point decimal approximations.  


6.  tan x = sin x / cos x.  If cos x = 0, then tan x is undefined.   This is why the If condition is present.  



Example Screenshots






I hope you find this useful and educational.  Have an excellent day,


Eddie 



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

New OS Update for Casio Classpad II

New OS Update for Casio Classpad II


Per TIPlanet:  Casio has released a new OS version (2.01.7002).   Among the changes includes the new off-screen when the Classpad is turned off with Casio's new logo "Boost Your Curiosity".  

The updates do not include the Python programming language (I don't think).

The calculators included are the fx-CP400 and fx-CP500.


TIPlanet's News Link with Downloads (in French):

https://tiplanet.org/forum/viewtopic.php?p=271577#p271577


Casio's Download Resources Page:

https://edu.casio.com/download_service/en/download/index.html


For those of you who celebrate, Happy Easter!


Eddie 

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


HP 21S: Gompertz Curve

HP 21S:  Gompertz Curve



Introduction


This program fits sequential data to the Gompertz Curve:


y = c * a ^ (b ^ x)


where:


b = ( (S3 - S1) / (S2 - S1) ) ^ 1/m

a = e^( (S2 - S1) / b * (b - 1) / (b^m - 1)^2 )

c = e^( 1 / m * (S1 * S3 - S2^2) / (S1 + S3 - 2 * S2) )


where:


m = number of data points / 3

S1 = Σ ln x_i of the first tier 

S2 = Σ ln x_i of the second tier

S3 = Σ ln x_i of the third tier



HP 21S Program Code: Gompertz Curve


Labels:


A:  initialize the program

B:  enter data

C:  calculate b, a, c


Registers:


R1 = natural log of the sum of the first-third of data points

R2 = natural log of the sum of the second-third of data points

R3 = natural log of the sum of the third-third of data points

R4 = n = number of data points ÷ 3

R5 = a

R6 = b

R7 = c


Program Code:


step #: key code; key


01:  61, 41, A;  LBL A

02:  51, 75; CLRG

03:  61, 26;  RTN


04:  61, 41, b; LBL B

05:  13;  LN

06:  21, 75, 1; STO+ 1

07:  26;  R/S

08:  13;  LN

09:  21, 75, 2; STO+ 2

10:  26; R/S

11:  13; LN

12:  21, 75, 3; STO+ 3

13:  1;  1

14:  21, 75, 4; STO+ 4

15:  22, 4;  RCL 4

16:  61, 26;  RTN


17:  61, 41, C;  LBL C

18:  33;  (

19:  22, 3;  RCL 3

20:  65;  ×

21:  22, 2;  RCL 2

22:  34;  )

23:  45;  ÷

24:  33;  (

25:  22, 2;  RCL 2

26:  65;  -

27:  22, 1; RCL 1

28:  34;  )

29:  74;  =

30:  14;  y^x

31:  22, 4; RCL 4

32:  15;  1/x

33:  74;  =

34:  21, 6;  STO 6

35:  26;  R/S

36:  33;  (

37:  22, 2; RCL 2

38:  65;  -

39:  22, 1; RCL 1

40:  34;  )

41:  55;  ×

42:  33;  (

43:  22, 6;  RCL 6

44:  65;  -

45:  1;  1

46:  34;  )

47:  45;  ÷

48:  22, 6;  RCL 6

49:  45;  ÷

50:  33; (

51:  22, 6;  RCL 6

52:  14;  y^x

53:  22, 4;  RCL 4

54:  65;  -

55:  1;  1

56:  34;  )

57:  51, 11;  x^2

58:  74;  =

59:  12;  e^x

60:  21, 5;  STO 5

61:  26;  R/S

62:  33;  (

63:  22, 1; RCL 1

64:  55;  ×

65:  22, 3; RCL 3

66:  65;  -

67:  22, 2;  RCL 2

68:  51, 11;  x^2

69:  34;  )

70:  45;  ÷

71:  33;  (

72:  22, 4; RCL 4

73:  55;  ×

74:  33;  (

75:  22, 1;  RCL 1

76:  75;  +

77:  22, 3;  RCL 3

78:  65;  -

79:  2;  2

80:  55;  ×

81:  22, 2;  RCL 2

82:  34;  )

83:  34;  )

84:  74;  =

85:  12;  e^x

86:  21, 7;  STO 7

87:  61, 26;  RTN



Example


Fit the following data into a Gompertz curve:

(1, 16)

(2, 18)

(3, 19)

(4, 25)

(5, 28)

(6, 29)

(7, 32)

(8, 36)

(9, 37)


First, order the data points. Second, divide the data into three equal parts.  For this example, we have 9 data points.  From our example:


16, 18, 19, 25, 28, 29, 32, 36, 37


is divided into:


Group I:  16, 18, 19

Group II: 25, 28, 29

Group III: 32, 36, 37


Initialize the program:  XEQ A


Enter the data:

16 XEQ B, 25 R/S, 32 R/S

18 XEQ B, 28 R/S, 36 R/S

19 XEQ B, 29 R/S, 37 R/S


Calculate the parameters:  XEQ C

b:  0.82711002676, R/S

a:  2.33690515E-1, R/S

c:  48.2137954914


The Gompertz Curve is 

y = 48.2137954914  * 2.33690515E-1 ^ (0.82711002676 ^ x)


Predict the 10th point:

Key strokes:  RCL 6, y^x ,10, =, RCL 5, y^x, LAST, ×, RCL 7 

Result:  38.776391586




Source


HP-37E & HP-38E/38C:  Marketing and Forecasting Applications  Hewlett Packard.  May 1979.




Until next time,


Eddie


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

April Haul

 The mathematical tools purchased in April so far...


From the Pasadena City College Swap Meet:


A 27-slot soroban abacus, the longest abacus that I have ever seen..



A 5 inch Frederick Post Co. No. 1444K slide rule.



Online:

Sharp EL-506TS (review to come soon)


Casio fx-991CW: (See review here:  http://edspi31415.blogspot.com/2023/04/review-casio-fx-991cw.html




Eddie


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

Swiss Micros DM41X: Cash Register

Swiss Micros DM41X: Cash Register


Ready to Check Out? 


Download the program here (raw file):  https://drive.google.com/file/d/102ekvHr4c3shBY6RvAuAZzjj1g1ctD7L/view?usp=share_link


This program simulates a cash register.  If you have an HP infrared printer like the HP 82240B (from the 1980s and 1990s), the program is set to print the results. The printer is enabled by setting flag 21.   When a printer is present, flag 55 is set internally.   


When the printer flag is turned on (21):


AVIEW:   print what ever is in the alpha register

VIEW:  print the contents of a numeric register

ADV:  advances the paper


A printer is not required to run the program, unplug the Infrared Printer Module.  This way the program stops when an AVIEW, VIEW, and ADV instruction displays.  Press [ R/S ] to continue.


This program assumes every item entered is subject to a sales tax, which is set within the program, line 03.   



DM41X/HP41CX Program:  CASHREG


When you are done entering the costs for items checked out, enter zero.


01  LBL^T CASHREG

02  FIX 2

03  8.75    ← set your sales tax rate here 

04  STO 02

05  0

06  STO 01

07  SF 21   ← allows the calculator to print/display

08  ^T THE STORE

09  33

10  XTOA  ← ammends an exclamation point (!)

11  AVIEW

12  CLA

13  FIX 8

14  DATE

15  ADATE

16  AVIEW  ← prints the date

17  CLA

18  FIX 2

19  ADV

20  LBL 00   ← main loop

21  ^T COST?

22  PROMPT

23  X=0?

24  GTO 01

25  ARCL X

26  AVIEW

27  ST+ 01

28  GTO 00

29  LBL 01

30  ^T SUBTOTAL

31  ARCL 01

32  AVIEW

33  CLA

34  ARCL 02

35  ^T |- % TAX:

36  RCL 01

37  RCL 02

38  %

39  ARCL X

40  AVIEW

41  +

42  ^T TOTAL:

43  ARCL X

44  AVIEW

45  ^T PAID:

46  PROMPT

47  ARCL X

48  AVIEW

49  X<>Y

50  -

51  ^T CHANGE:

52  ARCL X

53  AVIEW

54  END



Example


Checkout:

$19.99

$27.95

$28.94

Sales Tax Rate:  8.75%

Paid: $100.00


XEQ CASHREG



THE STORE

01/29/2023   ←  the current date is shown here

COST?  19.99 R/S

COST?  27.95 R/S

COST?  28.94 R/S

COST?  0

SUBTOTAL: 76.88

8.75% TAX:  6.73

TOTAL:  83.61

PAID:  100 R/S

PAID:  100.00

CHANGE:  16.39



Eddie 



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

TI-84 Plus CE and Numworks: System of Linear Differential Equations (Simple System)

TI-84 Plus CE and Numworks: System of Linear Differential Equations (Simple System) 



Solving  The System


The program presented today will solve the following system of equations:


dx/dt = A * x(t) + B * y(t)

dy/dt = C * x(t) + D * y(t)

with initial conditions x(0) = x0 and y(0) = y0


The formulas used in the program are derived using the Laplace Transform.


dx/dt = A * x(t) + B * y(t)

dy/dt = C * x(t) + D * y(t)


Laplace Transforms to be used:

ℒ{f(t)} = F(s)

ℒ{df/dt} = s * F(s) - f(0)


Apply the Laplace Transform transform:


s * X(s)  - x0 = A * X(s) + B * Y(s)

s * Y(s) - y0 = C * X (s) + B * Y(s)


(s - A) * X(s) + (-B) * Y(s) = x0

(-C) * X(s) + (s - D) * Y(s) = y0


Define three matrices:


Md = [ [ s - A, -B ], [ -C, s - D ] ]


where

det(Md) = s^2 - (A + D) * s + (A * D - B * C)


which can be factored into:

(s - P) * (s - Q)


where:

P = (( A + D ) + √(( A + D)^2 - 4 * (A * D - B * C)) /2

Q = (( A + D ) - √(( A + D)^2 - 4 * (A * D - B * C)) /2


Mx = [ [ x0, -B ], [ y0, s - D ] ] 


where

det(Mx) = x0 * (s - D) + B * y0



My = [ [ s - A, x0 ], [ - C, y0 ] ]


where 

det(My) = (s - A) * y0 + C * x0


Per Cramer's Rule, the solution to X(s) and Y(s) are:


X(s) = det(Mx) / det(Md)


Y(s) = det(My) / det(Md)


What happens next depends of the roots P and Q.  We're assuming that P and Q are real here but the situation applies if P and Q are complex. 



If P ≠ Q:


If P ≠ Q, then after simplifying and finding partial fractions:


X(s) = ( x0 * (s - D) + B * y0 ) / ((s - P) * (s - Q)) = α / (s - P) + β / (s - Q)


where

α = ( B * y0 + (P - D) *x0) / (P - Q)

β = x0 - α


Y(s) = ( (s - A) * y0 + C * x0 ) / ((s - P) * (s - Q)) = γ / (s - P) + δ / (s - Q)


where

γ =(C * x0 + y0 * (P - A)) / (P - Q)

δ = y0 - γ


Applying the inverse Laplace transform:


x(t) = α * e^(P * t) + β * e^(Q * t)

y(t) = γ * e^(P * t) + δ * e^(Q * t)



If P = Q:


If P = Q, then after simplifying and finding partial fractions:


X(s) = ( x0 * (s - D) + B * y0 ) / (s - P)^2 = α / (s - P)^2 + β / (s - Q)


where

α = B * y0 + (P - D) * x0 

β = x0


Y(s) = ( (s - A) * y0 + C * x0 ) / (s - P)^2 = γ / (s - P)^2 + δ / (s - Q)


where

γ =C * x0 + y0 * (P - A)

δ = y0


Applying the inverse Laplace transform:


x(t) = α * t * e^(P * t) + β * e^(Q * t)

y(t) = γ * t * e^(P * t) + δ * e^(Q * t)




TI-84 Plus CE Program:  LINSYS1


Download the program here:  https://drive.google.com/file/d/14zYpT4xhLRGVvBNriOacIOGBpqXLWswR/view?usp=share_link


Program Listing:


Radian

a+bi

ClrHome

Disp "DX/DT=AX+BY DY/DT=CX+DY"

Prompt A,B,C,D

Input "X0? ",M

Input "Y0? ",N

((A+D)+√((A+D)²-4*(A*D-B*C)))/2→P

((A+D)-√((A+D)²-4*(A*D-B*C)))/2→P


If P≠Q

Then

(B*N-D*M+P*M)/(P-Q)→R

M-R→S

(C*M-A*N+P*N)/(P-Q)→U

N-U→V

ClrHome

Output(2,1,"X=Re^(PT)+Se^(QT)")

Output(3,1,"R= "+toString(R))

Output(4,1,"P= "+toString(P))

Output(5,1,"S= "+toString(S))

Output(6,1,"Q= "+toString(Q))

Pause

ClrHome

Output(2,1,"Y=Ue^(PT)+Ve^(QT)")

Output(3,1,"U= "+toString(U))

Output(4,1,"P= "+toString(P))

Output(5,1,"V= "+toString(V))

Output(6,1,"Q= "+toString(Q))

Pause

Else

B*N-D*M+M*P→P

M→S

C*M-A*N+N*P→U

N→V

ClrHome

Output(2,1,"X=RTe^(PT)+Se^(PT)")

Output(3,1,"R= "+toString(R))

Output(4,1,"P= "+toString(P))

Output(5,1,"S= "+toString(S))

Pause

ClrHome

Output(2,1,"Y=UTe^(PT)+Ve^(PT)")

Output(3,1,"U= "+toString(U))

Output(4,1,"P= "+toString(P))

Output(5,1,"V= "+toString(V))

Pause

End

ClrHome



Python:  dfsys1.py


Link from my Numworks page:  https://my.numworks.com/python/ews31415/dfsys1


Modules: 

cmath:  complex math

mathplotlib.pyplot:  screen plotting and text placement


Script listing:  


from cmath import *

from matplotlib.pyplot import *

# 2023-01-28 EWS


# parameter input

print("systems of differential\nequations")

print("dx/dt=a*x+b*y")

print("dy/dt=c*x+d*y")

a=float(input("a? "))

b=float(input("b? "))

c=float(input("c? "))

d=float(input("d? "))

m=float(input("x0? "))

n=float(input("y0? "))



# characteristic roots

p=((a+d)+sqrt((a+d)**2-4*(a*d-b*c)))/2

q=((a+d)-sqrt((a+d)**2-4*(a*d-b*c)))/2


# set up result screen

axis((0,10,0,10))

axis("off")


# determine solutions

# best used for real solutions

if p!=q:

  r=(b*n+m*(p-d))/(p-q)

  s=m-r

  u=(c*m+n*(p-a))/(p-q)

  v=n-u

  text(0,9,"x=re**(pt)+se**(qt)")

  text(0,8.5,"r="+str(r))

  text(0,8,"p="+str(p))

  text(0,7.5,"s="+str(s))

  text(0,7,"q="+str(q))

  text(0,6,"y=ue**(pt)+se**(vt)")

  text(0,5.5,"u="+str(u))

  text(0,5,"p="+str(p))

  text(0,4.5,"v="+str(v))

  text(0,4,"q="+str(q))

else:

  r=(b*n+m*(p-d))

  s=m

  u=(c*m+n*(p-a))

  v=n

  text(0,9,"x=rte**(pt)+se**(pt)")

  text(0,8.5,"r="+str(r))

  text(0,8,"p="+str(p))

  text(0,7.5,"s="+str(s))

  text(0,6,"y=ute**(pt)+se**(vt)")

  text(0,5.5,"u="+str(u))

  text(0,5,"p="+str(p))

  text(0,4.5,"v="+str(v))


show()



Examples


Example 1


dx/dt = 3 * x(t) - 2 * y(t)

dy/dt = 2 * x(t) - 2 * y(t)

x(0) = 6, y(0) = 9


Solutions:

x(t) = 2 * e^(2*t) + 4 * e^(-t)

y(t) = e^(2*t) + 8 * e^(-t)


Example 2


dx/dt = 3 * x(t) - 4 * y(t)

dy/dt = x(t) - y(t)

x(0) = 1, y(0) = 0


Solutions:

x(t) = 2 * t * e^(t) + e^(t)

y(t) = t * e^(t) 



Eddie 


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

HP 32S II Statistical Formulas

HP 32S II Statistical Formulas



Statistics Formulas


The 32S II can store formulas for evaluations, including formulas involving stat variables.  


Covariance:

C = r × sx × sy


Root Mean Square Based on X Variable Statistics:

R = SQRT( Σx^2 ÷ n )


Z-Score Based on X Variable Statistics:  

Z = (X - x-bar) ÷ sx


Accessing Stat variables:


r:  [ right shift ]  [ LN ] (L.R.) [ y^x ] (r)

sx:  [ right shift ] [ 1/x ] (s, σ), [ √x ] (sx)

sy:  [ right shift ] [ 1/x ] (s, σ), [ LN ] (sy)

Σx^2:  [ right shift ] [ Σ+ ] (SUMS) [ e^x ] (x)

n:  [ right shift ] [ Σ+ ] (SUMS) [ √x ] (n)

x-bar:  [ right shift ] [ y^x ] (x-bar,y-bar) [ √x ] (x-bar)


Example


Data:  (x, y)

(10.4, 20)

(13.5, 18)

(16.8, 15)

(19.1, 13.9)


Enter statistical data:  y [ENTER] x [ Σ+ ]


Some stats:

x-bar = 14.95

y-bar = 16.725

r = -9.9503133E-1


Covariance:  Solve for C

C = -10.555

Result is stored in C


Root Mean Square:  Solve for R

R = 15.3089842903

Result is stored in R


Z-Score Based on X Variable Statistics:   Solve for Z

X?  15,  Z = 1.31382E-2

X?  17,  Z = 5.38666E-1

Result is stored in Z



Formulas vs. Programs


If we are going to evaluate formulas (that is, solve for the variable left of the equals sign), we could also enter and use programs.   The programs for the above three formulas:


Covariance:

C01  LBL C

C02  r

C03  sx

C04  ×

C05  sy

C06  ×

C07  RTN


Root Mean Square:

R01  LBL R

R02  Σx^2

R03  n

R04  ÷

R05  SQRT

R06  RTN


Z Score:  (x is in the X stack)

Z01  LBL Z

Z02  x-bar

Z03  -

Z04  sx

Z05  ÷

Z06  RTN


Byte Consumption Comparison


Covariance

Formula:  12 bytes

Program:  10.5 bytes


Root Mean Square

Formula:  12 bytes

Program:  9 bytes


Z Score

Formula: 15 bytes

Program:  9 bytes


From sample set, programs are shorter than formulas.  Is this true in general?


Eddie



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

HP 10bII+ and Sharp EL-W516T: Normal Distribution Function

HP 10bII+ and Sharp EL-W516T:  Normal Distribution Function








Sometimes scientific calculators and financial calculators have normal distribution functions.   



HP 10bII+  Normal Distribution



On the HP 10bII+ financial calculator, the normal distribution functions are available at any time:


[ blue shift ] ( z<>p ):   lower tail area of normal distribution [ P(x) ]

[ blue shift ] ( INV) ( z<>p ):  given area, get the probability


Example:


P(0.2) returns 0.57926


If the area is 0.6, z is 0.253347



Sharp EL-W516T Normal Distribution



The normal distribution functions offered on the Sharp EL-W516T are:


[ MATH ] menu in SD mode:

0) →t:   convert to z

1)  P(:  lower tail area

2)  Q(:  I do believe it is the area between the mean and z

3)  R(:  upper tail area


The normal distribution functions are available only in the statistics mode.  


Example:


P(0.2) returns 0.57296.



Is Statistical Data Required?



No.  In general, especially the normal distribution functions does not require or depend on any stat data.  


However, you use the stat data points to convert from x-values to convert stats to a z value in the EL-W516T using →t.  Here is an example:


Data set:  -3, -1, 2, 5, 6 

Convert the data point 0 and then find the lower tail area.


0→t=   -0.524890659

P(ANS) = 0.29983




Eddie



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

HP 12C: An Improved Linear Regression Function (from Curvee RPN-45 SD)

HP 12C:  An Improved Linear Regression Function (from Curvee RPN-45 SD)



Curvee RPN-45 Simulator 


The Curvee RPN-45 from Curvee Software is an excellent app.  The RPN-45 SD app is the Super-45.   The Super-45 is a emulator of the classic HP 45 calculator from 1973 with the following enhancements:


*  The gold shift key becomes a double-shift key (gold/purple)

*  Complex Numbers

*  10 additional registers

*  Days between dates

*  Four solvers: 2 x 2 system of linear equations, 3 x 3 system of linear equations, quadratic equation, cubic equation

*  Expanded statistics including full linear regression analysis


I have purchased one on my iPod Touch (that is an iPhone without the "phone" part) for $1.99 (prices may vary).  There are versions for the iPhone and iPad.  


For more information:  http://cuveesoft.ch/rpn45/en/index.html


The enhanced linear regression (L.R.) function on the Super-45 returns the following calculations to the four-level stack:


T:  covariance

Z:  correlation

Y:  slope

X:  intercept


The relationship between correlation (r) and covariance (cov):


cov(x,y) = r * sx * sy

sx = standard deviation of x-data

sy = standard deviation of y-data


The HP 12C mimics the enhanced L.R. function.   Yes, check out this app!



HP 12C Program:  Enhanced Linear Regression



The results are stored in the following registers:


R7 = intercept

R8 = Slope

R9 = correlation

R.0 = covariance


In addition, I added code to calculate population deviation:  σx in the x-stack, σy in the y-stack.


Step #: Code [ key ]


// linear regression function 

01:  1  [ 1 ]

02:  43, 1  [ x^,r ]

03:  34  [ x<>y ]

04:  44, 9 [ STO 9 ]

05:  43, 48  [ s ]

06:  20  [ × ]

07:  20  [ × ]

08:  44, 48, 0   [ STO  .  0  (decimal point, zero) ]

09:  0  [ 0 ]

10:  43, 2  [ y^, r ]

11:  44, 7  [ STO 7 ]

12:  1   [  1 ]

13:  43, 2  [ y^, r ]

14:  34  [ x<>y ]

15:  33  [ R↓ ]

16:  34  [ x<>y ]

17:  30  [ - ]

18:  44, 8 [ STO 8 ]

19:  45, 48, 0 [  RCL . 0  (decimal point, zero) ]

20:  45, 9  [ RCL 9 ]

21:  45, 8  [ RCL 8 ]

22:  45, 7  [ RCL 7 ]

23:  43, 33, 00 [ GTO 00 ]


// population deviation

24:  45, 1 [ RCL 1 ]

25:  36  [ ENTER ]

26:  36  [ ENTER ]

27:  1  [ 1 ]

28:  30  [ - ]

29:  10  [ ÷ ]

30:  43, 21  [ √ ]

31:  44, 0  [ STO 0 ]

32:  43, 48  [ s ]

33:  45, 0  [ RCL 0 ]

34:  10  [ ÷ ]

35:  34  [ x<>y ]

36:  45, 0  [ RCL 0 ]

37:  10  [ ÷ ]

38:  34  [ x<>y ]

39:  43, 33, 00 [ GTO 00 ]



Example


Fix 6 mode is set.  


Data:

(5.35, 10)

(5,70, 11)

(6.18, 12)

(6.55, 13)

(6.97, 14)

(7.36, 15)


After entering the data points:

[ f ] (PRGM) [ R/S ]

-3.162788 (intercept), [ R↓ ]

2.465287 (slope), [ R↓ ]

0.999396 (correlation, r), [ R↓ ]

1.418000 (covariance)  ( [ R↓ ] to return the stack to it's original configuration )


[ g ] (GTO) 24 [ R/S ]

0.692331 ( σx ) [ x<>y ]

1.707825 ( σy )



Eddie


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

TI-84 Plus CE: Tracing Polar Equations

TI-84 Plus CE:  Tracing Polar Equations



Traveling Around the Graphs


The programing BLINKING animates a dot around one of four polar equations:


1.  Ellipse


r = b / √(1 - ε^2 * cos^2 θ), where ε = √(a^2 - b^2)/a, a > b


2.  Cardioid


r = a + (1 + cos θ)


3.  3-Leaf Rose


r = a * cos(3 * θ)


4.  Log Spiral


r = a * e^(b * θ)



Notes:


The point alternates through blue (TI-84 Plus CE color 10), green (14), orange (15), and black (12).   The graph itself is light gray (21).  


r1 is the polar equation r1(θ).


Plotting points (not the polar graph) must be in cartesian coordinates (x,y).   




TI-84 Plus CE Program:  BLINKING


"2023-01-15 EWS"

Radian: Polar: FnOff

ZStandard

{10,14,15,12}→L6

Menu("PLOT","ELLIPSE",10,"CARDIOID",11,"3-LEAF ROSE",12,"LOG SPIRAL",13)


Lbl 10

Disp "A≥B"

Prompt A, B

√(A^2-B^2)/A→E

"B/√(1-E^2*cos(θ)^2)"→r1

Goto 20


Lbl 11

Prompt A

"A*(1+cos(θ))"→r1

Goto 20


Lbl 12

Prompt A

"A*cos(3*θ)"→r1

Goto 20


Lbl 13

Disp "A>0, B>0"

Prompt A,B

"A*e^(B*θ)"→r1

Goto 20


Lbl 20

Input "MAX? ",M

Input "NO. STEPS? ",S

M/S→N

FnOn 1

GraphColor(1,21)

0→P: r1(P)→Q

P>Rx(Q,P)→F: P>Ry(Q,P)→G

Pt-On(F,G,1,12)


For(K,1,S)

Wait 0.25

Pt-On(F,G,1,21)

remainder(K,4)+1→C

K*N→P: r1(P)→Q

P>Rx(Q,P)→F: P>Ry(Q,P)→G

Pt-On(F,G,1,L6(C))

End 


Disp "END"



Examples


In all examples, a = 3, b = 2, maximum = 4 * π, steps = 24


Ellipse





Cardioid




 

3-Leaf Rose





Log Spiral







Source


Harris, John W. and Horst Stocker.  Handbook of Mathematics and Computational Science  Springer:  New York.  2006.  ISBN 0-387-94746-9



Eddie


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


HP 71B Basic and Casio fx-CG 100: Weighted Random Sample

HP 71B Basic and Casio fx-CG 100: Weighted Random Sample Introduction In calculators, it is fairly easy to generate a rand...