No video

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

  Рет қаралды 17,971

mechtutor com

mechtutor com

Күн бұрын

Here's my NumPy mini-course for an 80% discount. Use coupon code: NUMPY80 at rb.gy/pk99l ... I hope you'll find it useful.
The concept and algorithm of partial pivoting for Gaussian elimination method is explained and the routine is added to the code created in the last video, • Gauss Elimination Meth...
*** For my online course: Programming Numerical Methods in Python, visit:www.udemy.com/course/programm...
Visit my new Python course webpage: mechtutor.thinkific.com/cours...

Пікірлер: 15
@danielhuynh1817
@danielhuynh1817 10 ай бұрын
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 3 жыл бұрын
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 3 жыл бұрын
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.
@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
@reliable_tech_innovations
@reliable_tech_innovations 3 жыл бұрын
the line b[[k,i]] = b[[i,k]], how is it possible when b is a vector?
@mechtutorcom
@mechtutorcom 3 жыл бұрын
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.
@bapibasak2842
@bapibasak2842 4 жыл бұрын
How can i program it for any input matrix instead of directly written matrix in the program?
@mechtutorcom
@mechtutorcom 4 жыл бұрын
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 4 жыл бұрын
@@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.
@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
@adrien3995
@adrien3995 3 жыл бұрын
this code did not work can you send it
UNO!
00:18
БРУНО
Рет қаралды 3,5 МЛН
Inside Out 2: Who is the strongest? Joy vs Envy vs Anger #shorts #animation
00:22
哈莉奎因以为小丑不爱她了#joker #cosplay #Harriet Quinn
00:22
佐助与鸣人
Рет қаралды 9 МЛН
AES: How to Design Secure Encryption
15:37
Spanning Tree
Рет қаралды 156 М.
Operating System Basics
23:16
Brian Will
Рет қаралды 657 М.
Genetic Algorithms Explained By Example
11:52
Kie Codes
Рет қаралды 319 М.
Gaussian elimination | Lecture 10 | Matrix Algebra for Engineers
14:00
Jeffrey Chasnov
Рет қаралды 358 М.
1st Year Calculus, But in PYTHON
32:13
Mr. P Solver
Рет қаралды 123 М.
UNO!
00:18
БРУНО
Рет қаралды 3,5 МЛН