Post Reply 
(12C) Solve a system of linear equations of 2 Unknown
03-23-2018, 04:24 AM (This post was last modified: 03-24-2018 03:31 AM by Gamo.)
Post: #1
(12C) Solve a system of linear equations of 2 Unknown
Solve a system of linear equations for two unknown variables.

This program solves for x and y, given the equation
aX + bY = e
cX + dY = f

Remark: If "Error" show that indicate determinant D = 0, where D = ad - bc

Example:
X + Y = 10
X - Y = 4

1 ENTER 1 ENTER 10 R/S > 1,111,111,111 (Display First Equation Input)
1 ENTER 1 CHS ENTER 4 R/S > 2,222,222,222 (Display Second Equation Input)
R/S > -2 D
R/S > 7 (X)
R/S > 3 (Y)

Program:
Code:

01 STO 1
02 Rv
03 STO 2
04 Rv
05 STO 3
06 FIX 9
07  9
08  1/x
09  EEX
10  1
11  0
12  x
13 FIX 4
14 R/S
15 STO 4
16 Rv
17 STO 5
18 Rv
19 STO 6
20 FIX 9
21  4
22  .
23  5
24  1/x
25 EEX
26  1
27  0
28  x
29 FIX 4
30 R/S
31 RCL 3
32 RCL 4
33  x
34 RCL 6
35 RCL 1
36  x
37  -
38 RCL 3
39 RCL 5
40   x
41 RCL 2
42 RCL 6
43  x
44  -
45 R/S
46 STO 7
47  /
48 RCL 1
49 RCL 5
50  x
51 RCL 2
52 RCL 4
53  x
54  -
55 RCL 7
56  /
57 R/S
58 X<>Y
59 GTO 00

Example of the "No Solutions Equation"

x - 2y = -4
-3x + 6y = 0

1 ENTER 2 CHS ENTER 4 CHS R/S > 1,111,111,111
3 CHS ENTER 6 ENTER 0 R/S > 2,222,222,222

R/S > 0
R/S > Error 0

This cause Error because each of the two lines has the same slope, 1/2, so the lines don't intersect.



Gamo
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(12C) Solve a system of linear equations of 2 Unknown - Gamo - 03-23-2018 04:24 AM



User(s) browsing this thread: 1 Guest(s)