(45) Calc program simplifies simulataneous equations - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (45) Calc program simplifies simulataneous equations (/thread-14435.html) (45) Calc program simplifies simulataneous equations - SlideRule - 01-29-2020 09:07 PM   PROBLEM: Solve four simultaneous differential equations in less than four minutes   SOLUTION: Use a minicalculator and the program given here. The program was developed for the HP-45, but can be adapted to other calculators with similar storage capacity. An equivalent program could be written for a calculator with less storage capacity, but execution time would be longer.   The program is based on the Gauss algorithm for linear equations and solves a set of simultaneous equations of the form: ┏                   ┓ ┃ a₁₁ a₁₂ a₁₃ a₁₄ ┃ ┃x₁┃  ┃c₁┃ ┃ a₂₁ a₂₂ a₂₃ a₂₄ ┃ ┃x₂┃  ┃c₂┃ ┃ a₃₁ a₃₂ a₃₃ a₃₄ ┃ ┃x₃┃=┃c₃┃ ┃ a₄₁ a₄₂ a₄₃ a₄₄ ┃ ┃x₄┃  ┃c₄┃ ┗                   ┛ where the aij and ci terms are known. The xi terms are the unknowns. The four answers are displayed in the last four steps of the program: RCL 1 displays x1, RCL 2 displays x2, RCL 3 displays x3, RCL 4 displays x4. The only possible problem for an independent set of equations is that division by zero may occur (this is indicated by a blinking display on the HP-45). If this happens, simply switch order of the equations and try again. Code: ``` a₁₂ STO 9 a₁₃ STO 8 a₁₄ STO 7 c₁ STO 1 a₁₁ STO÷9 STO÷8 STO÷7 STO÷1 a₂₁ STO 3 RCL×8 RCL 7 RCL×3 RCL 1 RCL×3 c₂ - STO 2 R↓ a₂₄ - STO 6 R↓ a₂₃ - RCL 3 RCL×9 a₂₂ - STO÷6 STO÷2 ÷ STO 5 a₃₁ STO 3 RCL×9 a₃₂ - STO 4 RCL×6 RCL 3 RCL×7 - a₃₄ + RCL 4 RCL×2 RCL 3 RCL×1 - c₃ + RCL 4 RCL×5 RCL 3 RCL×8 - a₃₃ + ENTER↑ R↓ ÷ STO 3 R↓ x⇄y ÷ STO 4 a₄₁ ENTER↑ RCL×9 a₁₂ - ENTER↑ RCL×5 a₄₃ + R↓ R↓ RCL×8 x⇄y R↓ - RCL×4 LAST X RCL×3 R↓ R↓ R↓ RCL×1 + x⇄y R↓ x⇄y RCL×2 - c₄ - R↓ RCL×6 - a₄₁ RCL×7 + a₄₄ - x⇄y R↓ ÷ ENTER↑ RCL×4 STO-3 x⇄y STO 4 RCL×6 RCL 3 RCL×5 + STO-2 RCL 4 RCL×7 RCL 3 RCL×8 + RCL 2 RCL×9 + STO-1 RCL 1 RCL 2 RCL 3 RCL 4``` source: tech briefs, C.Rubin, May 1 1975, pg. 89 BEST! SlideRule