Monday, July 4, 2016

TI-65 Programs Part III: Impedance and Phase Angle of a Series RLC Circuit, 2 x 2 Linear System Solution, Prime Factorization (from TI-65 Manual)

TI-65 Programs Part III:  Impedance and Phase Angle of a Series RLC Circuit, 2 x 2 Linear System Solution, Prime Factorization (from TI-65 Manual)


This is the third and final part of programs I will post today, this Fourth of July.




TI-65 Impedance and Phase Angle of a Series RLC Circuit

Formulas:

Impedance: Z = √(R^2 + (XL –XC)^2)

Phase Angle:  Φ = atan ((XL – XC)/R)

Where:
R = resistance of the resistor in ohms (Ω)
L = inductance of the inductor in Henrys (H)
C = capacitance of the capacitor in Farads (F)
f = resonance frequency in Hertz (Hz)
XL = 2*π*f*L
XC = 1/(2*π*f*C)

Program:
CODE
STEP
KEY
COMMENT
38
00
*
Start with f
2
01
2

38
02
*

2nd 17
03
π

39
04
=
Calculate 2*π*f
12.0
05
STO 0

12.1
06
STO 1

38
07
*

51
08
R/S
Prompt for L
39
09
=

12.0
10
STO 0
Calculate XL
13.1
11
RCL 1

38
12
*

51
13
R/S
Prompt for C
39
14
=

34
15
1/x

12.1
16
STO 1
Calculate XC
51
17
R/S
Prompt for R
12.2
18
STO 2

2nd 33
19
x^2

59
20
+

16
21
(

13.0
22
RCL 0

49
23
-

13.1
24
RCL 1

17
25
)

2nd 33
26
x^2

39
27
=

33
28

-2nd 16
29
INV 2nd ENG
Remove ENG Notation
51
30
R/S
Display Z
16
31
(

13.0
32
RCL 0

49
33
-

13.1
34
RCL 1

17
35
)

28
36
÷

13.2
37
RCL 2

39
38
=

-24
39
INV TAN
arctangent
51
40
R/S
Display Φ

Input:  f [RST] [R/S], L [R/S], C [R/S], R [R/S]
Result:  Z [R/S] Φ

Test: f = 60 Hz, L = 0.25 H, C = 16 * 10^-6 F, R = 150 Ω
Result (in degrees mode):  Z ≈ 166.18600 Ω,  Φ ≈ -25.49760°

Source:  Browne Ph. D, Michael.  “Schaum’s Outlines:  Physics for Engineering and Science”  2nd Ed.  McGraw Hill: New York, 2010


TI-65 2 x 2 Linear System Solution

Let M = [ [a, b], [c, d] ],  S =  [ [ f ], [ g ] ]

Determinant:  E = a*d – b*c

If E ≠ 0, the solutions to the system Mx = S:
x1 = d/E * f – b/E * g
x2 = -c/E * f + a/E * g

Memory Registers:
R0 = a
R1 = b
R2 = c
R3 = d
R4 = f
R5 = g

Hence [ [R0, R1], [R2, R3] ] * [ [x1], [x2] ] = [ [R4], [R5] ].  The determinant is stored in R6.  Since so many storage registers are used, and storage registers eat up programming memory, the program will need to be short.

Program:
CODE
STEP
KEY
COMMENT
13.0
00
RCL 0
Calculate det(M)
38
01
*

13.3
02
RCL 3

49
03
-

13.1
04
RCL 1

38
05
*

13.2
06
RCL 2

39
07
=

12.6
08
STO 6

13.3
09
RCL 3
Calculate x1
38
10
*

13.4
11
RCL 4

49
12
-

13.1
13
RCL 1

38
14
*

13.5
15
RCL 5

39
16
=

28
17
÷

13.6
18
RCL 6

39
19
=

51
20
R/S
Display x1
13.0
21
RCL 0
Calculate x2
38
22
*

13.5
23
RCL 5

49
24
-

13.2
25
RCL 2

38
26
*

13.4
27
RCL 4

39
28
=

28
29
÷

13.6
30
RCL 6

39
31
=

51
32
R/S
Display x2


Input:
Store values:
a [STO] 0, b [STO] 1, c [STO] 2, d [STO] 3; f [STO] 4, g [STO] 5
Press [RST] [R/S]
If det(M) ≠ 0, x1 will be calculated.  Press [R/S] to get x2.
Press [RCL] 6 to get the determinant of M.

Test:  Solve
2*x1 + 3*x2 = 3.45
-6*x1 + x2 = 4.26

R0 = 2, R1 = 3, R2 = -6, R3 = 1, R4 = 3.45, R5 = 4.26

Results:  x1 = -0.4665, x2 = 1.461.    Determinant = 20 (stored in R6)


TI-65 Prime Factorization

This prime factorization comes straight from the Texas Instruments TI-65 Manual.

Program:
CODE
STEP
KEY
COMMENT
12.1
00
STO 1
Store n in R1
0
01
0

12.0
02
STO 0
Store 0 for comparisons
3
03
3

12.2
04
STO 2
Trail factor of 3
2nd 53.0
05
LBL 0
Test 2 as a factor
13.1
06
RCL 1

28
07
÷

2
08
2

39
09
=

2nd 28
10
FRAC
Is frac(R1/2)≠0?
-3rd 43
11
INV x=m
x≠m
0
12
0
R1≠R0?
2nd 54.1
13
GTO 1
Go to odd factors
2
14
2

12.28
15
STO÷

1
16
1
STO÷ 1
51
17
R/S
Display 2 if it is a factor
2nd 54.0
18
GTO 0
GTO 0, test 2 again
2nd 53.1
19
LBL 1
Odd factors loop begins here
13.1
20
RCL 1

-3rd 42
21
INV x<m
x≥m
2
22
2
Is R1≥R2?
2nd 54.2
23
GTO 2
All factors found? No: GTO LBL 2
13.1
24
RCL 1
If complete, display 1
51
25
R/S
(program execution ends here)
2nd 54.1
26
GTO 1

2nd 53.2
27
LBL 2
Label 2 starts here
13.1
28
RCL 1

28
29
÷

13.2
30
RCL 2

39
31
=

2nd 28
32
FRAC
Is frac(R1/R2)≠0?
-3rd 43
33
INV 3rd x=m
x≠m
0
34
0

2nd 54.3
35
GTO 3

13.2
36
RCL 2
Display odd factor
51
37
R/S

12.28
38
STO÷

1
39
1
STO÷ 1
2nd 54.1
40
GTO 1

2nd 53.3
41
LBL 3
Test next odd factor
2
42
2

12.59
43
STO+

2
44
2
STO+ 2
2nd 54.1
45
GTO 1


Input:  Enter n, press [RST] [R/S].  Each prime factor is displayed, keep on pressing [R/S] until you get 1 displayed.

Test 1:  Factorize 102
Input:  102 [RST] [R/S]
Result: 2, press [R/S]
Result: 3, press [R/S]
Result: 17, press [R/S]
Result: 1
Final result:  102 = 2 * 3 * 17

Test 2:  Factorize 168
Input: 168 [RST] [R/S]
Repeated presses of [R/S] gives: 2, 2, 2, 3, 7, 1
Final result:  168 = 2 * 2 * 2 * 3 * 7 = 2^3 * 3 * 7

Resource:  Texas Instruments.  “Texas Instruments Professional TI-65 Guidebook”  1986

This blog is property of Edward Shore, 2016.


Casio fx-CG50 and TI-84 Plus CE: Multiple Linear Regression

Casio fx-CG50 and TI-84 Plus CE: Multiple Linear Regression We have arrived at the last month of 2024. What a crazy year. I hope for...