Gauss Elimination Method - Part 2: Partial Pivoting | Numerical Computing with Python

  Рет қаралды 18,333

mechtutor com

mechtutor com

Күн бұрын

Пікірлер: 15
@danielhuynh1817
@danielhuynh1817 Жыл бұрын
Hello good sir. I just wanted to say this has IMMENSELY helped me in my numerical methods course. Not only is it very structure but you go well into detail about the reasoning behind indexing and things like that. It was extremely easy to follow and I hope you liver forever!!
@reliable_tech_innovations
@reliable_tech_innovations 4 жыл бұрын
can't believe somebody makes these videos.. you're a life saver
@AJ-et3vf
@AJ-et3vf 2 жыл бұрын
Awesome video! Thank you! Well explained! I love how partial pivoting isn't actually that long and complicated to code. You're a really great teacher. Thank you!
@paulcollins1447
@paulcollins1447 4 жыл бұрын
Thank you for these 2 excellent videos along with the python code solution. I was stumped with the b[[k,i]] = b[[i,k]] piece until I read your reply to Rafael's comment. Thanks for the explanation.
@morganvoldemort675
@morganvoldemort675 4 жыл бұрын
at the 10 minute mark, you talk about swapping the two array rows. You put: a[[k,i]]=a[[i,k]]. is that a built in convention for arrays? I don't quite understand... what exactly is happening with this command? It has a row and column place which makes me thing specific coordinates are being replaced rather than rows. Edit: also, why do you need the break command? can't you just un-indent? (Basically what I am asking for is what is it's purpose)
@mechtutorcom
@mechtutorcom 4 жыл бұрын
Elements of Numpy arrays, like Python lists, can be accessed by slicing. Slicing uses built-in pre-compiled codes to return or modify elements in the arrays according to their indices. a[[k,i]]=a[[i,k]] is an application of this technique. Both k and i refer to rows not columns. k is the index of the current pivot row in the elimination process. i is index of the row that to be swapped with the k row if the condition is satisfied during the partial pivoting. The break command is used here to stop swapping of rows k and i if the condition is satisfied. If you remove the break command, the partial pivoting will continue to the last row, which will increase the run time of the code. The advantage of removing the break is that the pivot row (k) at the end will have the largest pivot element in its column. The indentation of the break statement should keep it inside the block of the condition. Otherwise, the i-loop will be exited in an uncontrolled way. Thanks for you comment.
@kevinweitgenant5300
@kevinweitgenant5300 4 жыл бұрын
your question helped me. thanks
@bapibasak2842
@bapibasak2842 5 жыл бұрын
How can i program it for any input matrix instead of directly written matrix in the program?
@mechtutorcom
@mechtutorcom 5 жыл бұрын
You can input a matrix or a system (a-matrix & b-vector) in different ways. The simplest way is by using the Python input() function, so the user can define the matrix during the run of the code. The disadvantage of this method is that it is very tedious and error-prone to enter the matrices and vectors manually at each run, especially when they are relatively large (like 10x10 or more). The more practical method is to write the system in a text file, then open and read the file from the Python code. It is recommended for numeric data (numbers) to use CSV (Comma Separated Values) format to avoid reading errors. Since Python has tools to read from an Excel file, this could be another choice if you use Excel to save the systems. I will make a video about this topic soon. I really appreciate your question. Thank you.
@bapibasak2842
@bapibasak2842 5 жыл бұрын
@@mechtutorcom thanks for replying...🙇🙇.I shall definitely try it.Hey...do you not think that you should extend the number of your python tutorials of numerical analysis?I like the way you explain and deserve more related videos.Thank you.
@reliable_tech_innovations
@reliable_tech_innovations 4 жыл бұрын
the line b[[k,i]] = b[[i,k]], how is it possible when b is a vector?
@mechtutorcom
@mechtutorcom 4 жыл бұрын
A good questions! Here, I used the swap formula from Numpy. When I tried to use one dimension for [b] in this code, like b[i] = b[k] or b[[i]] = b[[k]] , it gave me totally wrong results. When I used the same formula for [a], it worked perfectly, as you see in the video. I think it works in a similar way to the swap formula by using Python tuples, like a , b = b , a , but for indexes i and k. Because Numpy uses internal algorithms for such techniques, I had to make some trials and compare them with exact solutions until I got the best working formula. I hope I could answer your question.
@hhss1763
@hhss1763 3 жыл бұрын
Hi, Thanks a lot for this lecture, but how could I use it if I had a matrix with complex solutions, which mean that we are to get a complex number like x=a+bi and so on.
@danielececca4096
@danielececca4096 3 жыл бұрын
How this could be work whit an over-dimension or under dimension matrix
@adrien3995
@adrien3995 3 жыл бұрын
this code did not work can you send it
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
Scaled Partial Pivoting in Gauss Elimination with MATLAB code
20:15
Partial Pivoting in Gauss Elimination with MATLAB code
15:32
ATTIQ IQBAL
Рет қаралды 27 М.
🟢02b - Gaussian Elimination with Partial Pivoting : Example 2
18:47
SkanCity Academy
Рет қаралды 10 М.
Gaussian Elimination In Python | Numerical Methods
12:01
StudySession
Рет қаралды 26 М.
Newton-Raphson Method | Numerical Computing in Python
17:31
mechtutor com
Рет қаралды 61 М.
🟢02a - Gaussian Elimination with Partial Pivoting : Example 1
13:19
SkanCity Academy
Рет қаралды 21 М.
Naive Gaussian Elimination in python
14:49
Jordan Barry
Рет қаралды 11 М.