Gaussian Elimination In Python | Numerical Methods

preview_player
Показать описание
In this video we are going to be walking through how to implement the Gaussian elimination method in python! We will go through a quick reminder of what Gaussian elimination is and how it works before we begin going through the code side. Gaussian elimination is the process of transforming a square system of linear equations into one of our special matrices, specifically an upper triangular matrix. Meaning we take our square linear systems of equations, we perform gauss elimination on them, which then allows us to easily solve the matrix.

This timeline is meant to help you better understand How to implement Gaussian Elimination In Python:
0:00 Introduction
0:20 Review of Gaussian Elimination
1:45 How to implement Gaussian Elimination In Python
11:39 Outro

Relevant Videos:
Gaussian Elimination With Partial Pivoting In Python: Coming Soon

Relevant Numerical Methods Playlists:

Follow & Support StudySession:

This video is part of our Numerical Methods course. Numerical methods is about solving math problems through approximating the solution of problems that would be difficult or impossible to solve analytically. In this playlist we will cover topics such as solving systems of linear equations, solving systems of non-linear equations, numerical integration, numerical derivatives, etc..
Рекомендации по теме
Комментарии
Автор

You have an error in your code. Namely in the backward substitution. I think it should look like
for k in range(n-2, -1, -1):
x[k] = augmented_matrix[k][n]

for j in range(k+1, n):
x[k] = x[k] - augmented_matrix[k][j] * x[j]
x[k] = x[k] / augmented_matrix[k][k]

АндрейРябцев-дб
Автор

Sir, thanks for your video. By the way, do you want to use C++ for Gaussian Elimination in another video? Thanks

trind
Автор

Your backwards substitution bit is wrong. Please check again

Sidmenon
Автор

i believe you should add a link to copy the code so it is easier to follow and replicate. I am very new to coding and while I understand things, it all moves too fast for me to do it on my own. :)

yashkaushik
Автор

It's sad there's such a big mistake in your code in the backward substitution.

thelindayz
Автор

I think that your code is not inclusive . if the first number in the matrix (matrix[0][0]) is zero, while everything else is ok, your code would stop immediately and get out of the function due to the first condition in the while loop, even though, generally when we do it manually we would simply swap rows and continue with the process . therefore your code does not include the cases when mat[0][0] = 0 .

noorj
Автор

The answer's wrong, also mistakes in the code. That's sad you are misleading people. You must double/triple check before publishing.
A lot of useless variables, => memory loss. For example variable j = I - 1 Is not used at all.

klepachevskyi
welcome to shbcf.ru