Solving Heat equation PDE using Explicit method in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ม.ค. 2025

ความคิดเห็น • 42

  • @mathematicslessonsandtutor8006
    @mathematicslessonsandtutor8006 2 ปีที่แล้ว +2

    Thank you very much for this video. I learnt alot.

  • @boy-sb4ef
    @boy-sb4ef 7 หลายเดือนก่อน +1

    Hey, I had a small doubt, what if I want to apply the neumann condition at boundary, how will we apply that method

  • @ТимофейЧерников-щ2х
    @ТимофейЧерников-щ2х 2 ปีที่แล้ว +6

    Nice. But it's more efficient to calculate next timestep using numpy, not for loops. But for a beginner it's easier to understand that way i guess

    • @Shreendg
      @Shreendg ปีที่แล้ว +1

      Using np.vectorize()?

  • @donharrold1375
    @donharrold1375 ปีที่แล้ว

    Nice video Shameel. Looks quite like MatLab? Syntax is a bit more complicated looking but it looks like it does the same stuff?

  • @Kwes09
    @Kwes09 2 ปีที่แล้ว +3

    Could you do a video on solving the 2D heat diffusion equation?
    Thank you.

  • @Yash-zq8zr
    @Yash-zq8zr ปีที่แล้ว

    Thanks Shameel Bhai !!

  • @sumankumarnayak2197
    @sumankumarnayak2197 ปีที่แล้ว

    Thank you so much sir. Great video.😊

  • @dioutoroo
    @dioutoroo 10 หลายเดือนก่อน

    Thank you for the video!

  • @AJ-et3vf
    @AJ-et3vf 2 ปีที่แล้ว

    Great video sir! Thank you!

  • @sachinrajpandey5242
    @sachinrajpandey5242 ปีที่แล้ว

    Is it possible to share your code, mine stuck at some places, also implicit and Crank Nicolson are same but you made separate videos of it? Can you please differentiate between explicit, implicit and Crank Nicolson methods?

  • @CivilCon143
    @CivilCon143 2 ปีที่แล้ว

    Thanks a lot for this wonderful video

  • @suriyaas4877
    @suriyaas4877 2 ปีที่แล้ว

    Very Helpful!! Thank You

  • @st3754
    @st3754 ปีที่แล้ว

    sir, why did you take [-1, : ] for the boundary condition at the last point, it didn't make sense to me, can u please explain.

    • @st3754
      @st3754 ปีที่แล้ว

      at 5:02

  • @tahirdhool6198
    @tahirdhool6198 ปีที่แล้ว

    Brother what editing interface of python you are using in this video? I use IDLE but this looks more practical. Please tell me the name.

    • @AliRaza-p9e9b
      @AliRaza-p9e9b 4 หลายเดือนก่อน

      jupyter notebook

  • @pasha6098
    @pasha6098 ปีที่แล้ว

    Many thanks for this tutorial. I need the presented file. Would you share it, please?

  • @Tommybotham
    @Tommybotham ปีที่แล้ว

    Thank you for the video.

  • @edgarromeroherrera2886
    @edgarromeroherrera2886 ปีที่แล้ว

    Gorgeous, thank man.

  • @compphysgeek
    @compphysgeek 2 ปีที่แล้ว

    nice video. I like your coding style. A lot cleaner than mine :D

  • @nurlybekmardanov5486
    @nurlybekmardanov5486 2 ปีที่แล้ว

    Hello, Thank you for the video. Could you please tell how you write text, formulas and graph in notebook at the begining of the video or make tutorial how to do it?

  • @soumendey1889
    @soumendey1889 ปีที่แล้ว

    Thank you sir 🙏🙂

  • @nicolass3293
    @nicolass3293 2 ปีที่แล้ว

    hi i tried to adapt it in order to solve my own problem, the thing is everything goes right when i have a curve made out of 5 points, but when i change the h step, it starts diverging, cansomeone help me pls? if not it's no problem but i just wanted a smoother curve

    • @shameelabdulla1491
      @shameelabdulla1491  2 ปีที่แล้ว +3

      The ratio of step size in the x direction (h) and in time (k) is important for stability. I didn't mention it clearly in the video. For stability you need to satisfy (1-2*factor)>=0. And the factor is k/h^2. So if you change h, you need to change k to make sure you satisfy the inequality equation mentioned above.

  • @ghufranullahkhan7479
    @ghufranullahkhan7479 2 ปีที่แล้ว

    Kindly make a video on 2D stress analysis of beam using FEM.

  • @luzzyrogue
    @luzzyrogue 2 ปีที่แล้ว

    Hello. I have asked the same fella a question with no response till today. What if the initial condition is different value as boundary condition. Take for example your initial condition function to be np.cos(pi*x), which gives 1 at 0. what would we take in solving?

    • @shameelabdulla1491
      @shameelabdulla1491  2 ปีที่แล้ว

      Then your boundary condition should be 1 at t=0 as well for the problem to be properly defined. The example I show here is for a simple case of constant boundary condition (infinite source or sink). This is called essential boundary conditions. You could also have natural boundary condition such as an end node with convective heat loss.

  • @Ms0a9
    @Ms0a9 2 ปีที่แล้ว

    I keep getting "ValueError: setting an array element with a sequence." when i try to execute de code, what should I do?

    • @shameelabdulla1491
      @shameelabdulla1491  2 ปีที่แล้ว

      This usually means you are trying to fit a list of values into a position that only takes one value. Remember that the loop is only calculating one value at a time, and placing it in the T matrix. Debug your code by printing the calculated value. Make sure it is not a list of values.

  • @sudeephalder8792
    @sudeephalder8792 ปีที่แล้ว

    Can you please have it for two dim. ?????

  • @0xbinarylol
    @0xbinarylol 2 ปีที่แล้ว

    Everything goes wrong when you change boundary condition to non zero value
    boundary value at left goes replaced by initial condition. Is this right or wrong.

    • @shameelabdulla1491
      @shameelabdulla1491  2 ปีที่แล้ว +1

      I think your boundary conditions and initial conditions need to be compatible. You can have non-zero boundary conditions at t=0. But then your initial conditions should reflect the same at x=0, and x=L.

    • @demr04
      @demr04 ปีที่แล้ว +1

      Sines are the solution for periodic condition T(0,t)=T(L,t)=0
      For non-zero boundary condition that are periodic, your function should be a constant plus a sine function.
      If you choose T(0,t)=T(L,t)=2
      Then your initial function should be 2 + sin(x*pi\L) for example

    • @0xbinarylol
      @0xbinarylol ปีที่แล้ว

      @@demr04 je baat

    • @0xbinarylol
      @0xbinarylol ปีที่แล้ว

      @@demr04 and thank you

  • @smegala3815
    @smegala3815 ปีที่แล้ว

    Thank you sir

  • @belfodilfarid4515
    @belfodilfarid4515 2 หลายเดือนก่อน

    g pas compris la 1ere ligne de commande

  • @anjubedwal4065
    @anjubedwal4065 2 ปีที่แล้ว

    Thankyou so much

  • @mathematicslessonsandtutor8006
    @mathematicslessonsandtutor8006 2 ปีที่แล้ว

    What of the case when the heat equation is non homogeneous? That is, the RHS is different from zero

    • @shameelabdulla1491
      @shameelabdulla1491  2 ปีที่แล้ว

      If it is non-homogenous, then the derivation will change. And the additional terms should show up in your index equation T[i,j]. If the boundary conditions are time-dependent, then they must be placed inside the first loop (index j for time) to be recalculated every iteration.

  • @RG-wd2hl
    @RG-wd2hl ปีที่แล้ว

    MERCI