Linear Equations — Solve by CREMER RULE

How To Use Python to Solve Linear System #PySeries#Episode 33

J3
Jungletronics
3 min readAug 20, 2021

--

To solve a system of linear equations we going to use this methods:

Cramer’s rule is an explicit formula for the solution of a system of linear equations with as many equations as unknowns, valid whenever the system has a unique solution. It expresses the solution in terms of the determinants of the (square) coefficient matrix and of matrices obtained from it by replacing one column by the column vector of right-hand-sides of the equations. (from https://en.wikipedia.org/wiki/Cramer%27s_rule)

Here is the problem to solve:

THE PROBLEM EQUATIONS SYSTEMS

Fig 1. The System equation to solve here with Cremer

The system equation to solve in this methods: CREMER RULE

HOW TO SOLVE THIS PROBLEM USING CREMER RULE?

LET’S GET IT ON !!!

Click to GOTO colab’s notebook solution BELOW :)

01#Step —# cremer rule method initialization (libs):

02#Step — creating the matrices (printing the logic used):

matrix_A

matrix_B

03#Step — Calculating the determinant of the matrix_A:

Is it possible TO USE cremer rule?

04#Step — Fetching matrix_B’s elements:

05#Step —Fetching each element in matrix_A:

06#Step —Redefining each matrices, A1, A2 and A3:

07#Step — Calculating the determinants:

08#Step — The Solution:

That’s it:

👉Colab notebook: link

Credits & References

Based on: Uninter Course Computer Engeneer Graduation — Date Aug/2021

Thanks to:

Fernanda Fonseca — Doctoral Student in Education, Master in Science and Mathematics Education and Degree in Physics and Philosophy — UNINTER — Brazil — PR

Related Posts:

32#PySeries#Episode — Linear Equations — GAUSS JORDAN — How To Use Python to Solve Linear System

33#PySeries#Episode — Linear Equations — CREMER RULE — How To Use Python to Solve Linear System (this one:)

34#PySeries#Episode — Linear Equations — Linear Equations — GAUSS SEIDEL — How To Use Python to Solve Linear System

01#Episode — #ElectricSeries — Electricity — Classroom Notes — Electricity — Working Out A Solution! — How to Calculate Circuits Efficiently Online. (look for https://matrixcalc.org/en/)

Fig 1. The Secret of Gauss-Jordan method: The Inverse Matrix! (image from here)

Jungletronics

J of Jungle + 3 Plats Arduino/RPi/Pic = J3

Following

--

--

J3
Jungletronics

😎 Gilberto Oliveira Jr | 🖥️ Computer Engineer | 🐍 Python | 🧩 C | 💎 Rails | 🤖 AI & IoT | ✍️