(12C Platinum) Two Linear Equations in Two Unknowns - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (12C Platinum) Two Linear Equations in Two Unknowns (/thread-11864.html) |
(12C Platinum) Two Linear Equations in Two Unknowns - Gamo - 11-28-2018 08:15 AM Here is my first attempt to program in ALG mode. This program solve for Simultaneous Equation in Two Unknowns. ----------------------------------------------- Formula using Cramer's Rule Equations: Ax + By = e Cx + Dy = f If AD - BC = 0 there is No Solution. ------------------------------------------- Procedure: Input: A [R/S] B [R/S] e [R/S] C [R/S] D [R/S] f [R/S] [R/S] Display: X [R/S] Y ------------------------------------------ Example: 2X - Y = 15 X + 2Y = 30 2 [R/S] 1 [CHS] [R/S] 15 [R/S] 1 [R/S] 2 [R/S] 30 [R/S] [R/S] display 12 [R/S] 9 Answer: X=12 and Y=9 ------------------------------------------- X + Y = -1 2X + 2Y = -2 1 [R/S] 1 [R/S] 1 [CHS] [R/S] 2 [R/S] 2 [R/S] 2 [CHS] [R/S] [R/S] Display 0.000000000 briefly then 0.00 Answer: No Solution ------------------------------------------- Program: Linear Equation in Two Unknowns (ALG Mode) Code:
Gamo RE: (12C Platinum) Two Linear Equations in Two Unknowns - Gamo - 01-16-2019 04:46 AM ALG Mode Program Version II Procedure: Same as above except when result is no solution Display "Error 0" ----------------------------------------------------- Program: ALG Mode Code:
Gamo RE: (12C Platinum) Two Linear Equations in Two Unknowns - Albert Chan - 01-16-2019 01:36 PM (11-28-2018 08:15 AM)Gamo Wrote: Example: Answer should be infinite number of solutions, the line X + Y = -1 |