Тёмный

Solving The 1D & 2D Heat Equation Numerically in Python || FDM Simulation - Python Tutorial #4 

Подписаться
Просмотров 20 тыс.
% 843

In this video, you will learn how to solve the 1D & 2D Heat Equation with the finite difference method using Python.
[🖥️] GitHub Link: github.com/Younes-Toumi
[💼] LinkedIn Link: www.linkedin.com/in/younes-abdeldjalil-toumi-334b29207/
[🐍] Check out my Python Simulation Playlist: ru-vid.com/group/PLuhnI_TPaiGDuTuoxqkG4ayAXIf7mV7Sm
Enjoy ~ 🐍
Script found on my -never used- github : github.com/Younes-Toumi/RU-vidChannel/tree/main/Simulation%20with%20Python/Heat%20Equation
Outline of the video :
0:00 - Introduction
1:10 - Solving the 1D Heat Equation
4:51 - Visualizing the solution
6:29 - Solving the 2D Heat Equation
10:27 - Surprise ?

Опубликовано:

 

11 сен 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 24   
@nonato7853
@nonato7853 6 месяцев назад
Incrível, mano! Recentemente fiz um trabalho sobre a equação de calor e seu vídeo me deu uma nova perspectiva do que eu havia feito. Parabéns!
@v4dl45
@v4dl45 7 месяцев назад
Awesome tutorial! I recommend you use libraries like manim for 3d visualizations as well!
@EdwardHe-jr9vg
@EdwardHe-jr9vg 3 дня назад
Hi! It's very awesome video and very straight forward! A quick question, do you know if there's any chance to speed up the process with cuda?
@saamirjassim2108
@saamirjassim2108 6 месяцев назад
Stability of solution also accuracy comparing with another solutions .. Thanks alot .
@YounesLab
@YounesLab 6 месяцев назад
This might be the subject of the next video, Thank you for you suggestion!
@vikonja121
@vikonja121 6 месяцев назад
As straightforward as this solution is, I believe it needs to be mentioned: this approach is extremely inefficient. It has time complexity O(N^2), which renders the method practically useless when applied to models/systems with a large number of cells (which ultimately is what one will have when doing serious work). A much more efficient code can be made by adjusting to use scipy's sparse module and solvers for sparce matrices. A good video nonetheless, if you want to get a preview of how the finite-difference method works ;) just mentioning a relevant computational aspect
@jawadmansoor2456
@jawadmansoor2456 5 месяцев назад
Using a pre built library/code will render a math video useless. I, like many others, have come here to learn math not a fancy python library. Good work younes!
@vikonja121
@vikonja121 5 месяцев назад
No need for the cheeky answer, I was just trying to mention the info for people who are more interested in the performance aspect and are maybe looking for such implementations. @@jawadmansoor2456
@ssrini2002
@ssrini2002 4 месяца назад
Could you recommend a video that uses that library please?
@vikonja121
@vikonja121 2 месяца назад
@@ssrini2002 I couldn't find any videos actually, there are a couple of websites with code examples, just google "python diffusion sparse matrix" and you'll find them quickly. Although, seeing as there's no videos about this, I might make one myself :)
@YounesLab
@YounesLab 2 месяца назад
Thank you for your comment @vikinja121 and for the clarification
@omaramdyaze
@omaramdyaze 7 месяцев назад
keep going bro , we need more solving physics problem using python , I hope if you have a vid about heat diffusion resolution for rectangular section fins and temperature profiles and thanks in advance bro
@YounesLab
@YounesLab 7 месяцев назад
I will be sure to make these in the future, thank you for your feedback!
@hakankosebas2085
@hakankosebas2085 7 дней назад
could you do code of "Tutorial: How to simulate the wave equation" video by Nils Berglung
@johnkevinpadro7819
@johnkevinpadro7819 5 месяцев назад
What software do you use @Younes
@YounesLab
@YounesLab 5 месяцев назад
If you mean for making the simulation i only used Visual Studio Code (for python IDLE)
@madly1nl0v3
@madly1nl0v3 9 месяцев назад
Thank you for this tutorial. Please show me how to plot 3D graph of Riemann Zeta function where we can see the pole at s = 1 + j0, and trivial as well as nontrivial zeroes; the vertical axis shows the magnitude of the output and the color codes the phase angle. Thank you very much beforehand.
@YounesLab
@YounesLab 9 месяцев назад
Thank you for your Comment. Very Interesting function and Idea, I will look forward into making it.
@oskarmakala
@oskarmakala Месяц назад
Could anyone explain why is it necessary to use a copy of array u in the scheme equation? I know that it gives slightly different results if we just rewrite u array in each loop, thanks
@YounesLab
@YounesLab Месяц назад
Hello! We use a separate copy of the array `u` because it represents the temperature distribution at a specific time, `t`. When we discretize our equation in time and space, we get: u[t+1, i] = (dt * a / dx^2) * (u[t, i-1] - 2 * u[t, i] + u[t, i+1]) + u[t, i] In this equation, `u[t, ...]` represents the temperature distribution at time `t`. By updating `u` using a while loop, we ensure that the computation of the distribution at all nodes is accurate for time `t`. If we don't use a copy of `u`, we end up computing the solution at `t+1` using a mixture of data from both `t` and `t+1`. For example, without a copy, `u` is updated dynamically, and when computing each node [i], the left node [i-1] is used from time `t+1` while the right node [i+1] is still from time `t`. This leads to: u[t+1, i] = (dt * a / dx^2) * (u[t+1, i-1] - 2 * u[t, i] + u[t, i+1]) + u[t, i] This does not conform to the established numerical scheme. I hope this clarifies why it's necessary to use a copy of the array `u` in the scheme equation. Let me know if you have any other questions! :)
@RameezRaja-qc9fi
@RameezRaja-qc9fi 7 месяцев назад
Please make more videos of coding on heat transfer and fluid mechanics. Thank you very much!
@nick45be
@nick45be 4 месяца назад
in line 52 (5:49) it says "IndentationError: unexpected indent" after having copied and pasted the code from your github
@YounesLab
@YounesLab 4 месяца назад
If you are getting an "IndentationError: unexpected indent" this means there is a problem with the indentation (tabbing) of the line, make sure to delete the tabs and manually re do it.
@KrishnaGupta-pn8ee
@KrishnaGupta-pn8ee 7 месяцев назад
Bro kindly make more videos in hindi
Далее
СПРАВКА ДЛЯ УНИВЕРА
00:44
Просмотров 206 тыс.
Едим ЕДУ на ЗАПРАВКАХ 24 Часа !
28:51
I Built a SECRET Soccer Field in My Room!
24:15
Просмотров 12 млн
Penalty: Portugali - Slloveni
02:03
Просмотров 1,2 млн
СПРАВКА ДЛЯ УНИВЕРА
00:44
Просмотров 206 тыс.