Solving the Heat Diffusion Equation (1D PDE) in Matlab

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024
  • In this video, we solve the heat diffusion (or heat conduction) equation in one dimension in Matlab using the forward Euler method. For the derivation of equations used, watch this video ( • Derivation of the Heat... ).

Комментарии • 56

  • @kedarshete3131
    @kedarshete3131 Год назад +2

    Thank you Kody for this video. Very clearly shows how a finite difference method works, and is different from other techniques like finite volume. Conservation is not imposed in finite difference, as the video shows, Temperature at previous timestep is used to predict fluxes.

  • @anjalibhattarai2812
    @anjalibhattarai2812 6 лет назад +7

    Great tutoring!! You saved me in graduate project

  • @johangoethe2472
    @johangoethe2472 4 месяца назад

    Thank you very much. It was so , so useful !!!

  • @baacademy1166
    @baacademy1166 5 лет назад +2

    quite educative, thanks. please further with 2D HEAT DIFFUSION.

  • @jeppelarsen7862
    @jeppelarsen7862 4 года назад

    Hey this is a fantastic Video!! You just simply helped me solving a PDE without ever having to touch Fourier series!!! Thank you!!!
    But what if your starting condition at x=0 is a heat input of q_convek = 400W, and you know the temperatur far away from the surface T(x=-0.5*L, t=0) = 2000K, but you don't know T(0, 0).
    Basicly I want to simulate wall temperture in a combustion engine cylinder, and I know T(L,0)=0, T(-0.5*L, 0)~2000, qdot(0, t=0:t_final) = 400W

    • @e-skills2120
      @e-skills2120 4 года назад

      @jeppe larsen if oyu still have a doubt I can help you out

  • @tapasbhattacharya9590
    @tapasbhattacharya9590 6 лет назад +1

    Wonderful tutorial. Very nicely presented.

  • @chucknorris9511
    @chucknorris9511 3 года назад +1

    Kody, excellent video. How would the equations change if we were to look at a triangular section? It has been years since I took this course.

  • @chapkovichdima
    @chapkovichdima 6 лет назад +6

    what kind of sorcery is that?

  • @mariadelafuenteruiz4628
    @mariadelafuenteruiz4628 3 года назад +1

    How does the analytical solution looks like when having a flux in the east boundary condition?

  • @sarahgayot4393
    @sarahgayot4393 5 лет назад

    Thanks a lot for this, a colleague forwarded it to me and it is really great :)

  • @Twolf-gaming
    @Twolf-gaming 3 года назад

    thankyou so much sir..love from india

  • @farukkilic6010
    @farukkilic6010 5 лет назад +2

    super

  • @stefanbailie3126
    @stefanbailie3126 5 лет назад +1

    So cool!

  • @nodddyyyy
    @nodddyyyy 6 лет назад +1

    Is it possible to have T2s not be set as constant with these equations? Also can this be modified to use a non constant specific heat value ie varying with temperature?

  • @luciagerman6389
    @luciagerman6389 3 года назад

    great video!!! thank you. i wrote figure instead of figure(1) and ended with Matlab making 5001 plots though lmao

  • @saeedrastegar9436
    @saeedrastegar9436 3 года назад

    thx a lot. it was perfect. i have a question. when we have three insulations layers, how we should write the code?

  • @sohaibkhan779
    @sohaibkhan779 5 лет назад

    great tutorial... very helpful... thankyou

  • @AXEGAMINGHDH
    @AXEGAMINGHDH 6 лет назад +2

    you have not used the j loop at the end for the final temp why ????
    at the last u just multiplied with dt which is 0.1 could u please explain that to me
    thanks

    • @chucknorris9511
      @chucknorris9511 3 года назад

      I was about to ask him the same question. The reason he is multiplying by the dt is to cancel the times so it's adding temperature over each loop. Looks like you commented two years ago so I am sure you figured it out. :)

  • @abdel-gq9po
    @abdel-gq9po 4 года назад +2

    in lines 26 and 27, I think the first derivative near the walls should be divided by dx*(dx/2) and not dx^2. the distance between each wall and its adjacent node is dx/2.

    • @PollonPollow
      @PollonPollow 3 года назад

      no it's correct because delta x it's the space over we make the derivative. Each node is at delta x/2 from the boundary of each control area, but we make the derivative over the entire delta x

  • @shadankazempoursabahi7329
    @shadankazempoursabahi7329 3 года назад

    Thanks for the video. I want to use this code for concentration diffusion in a film is that possible? Because when i put my values for concentrations instead of Temparatures is starts to explode and its not working as nice as here.

  • @krishnendupaul9592
    @krishnendupaul9592 6 лет назад +1

    can we plot t vs T here? if possible then please tell me how. thank you

  • @hellsing48
    @hellsing48 3 года назад

    How would you include heat exchange with environment? Have a bar at constant temperature (e.g. 400C) and and instead of surface temperature give outside temperature (20C). How would you calculate heat exchange with environment in this case?

  • @pedrovinicius3621
    @pedrovinicius3621 3 года назад +1

    Hey, Im trying to do the same process but with two different materials any advise?

    • @onionking1523
      @onionking1523 3 года назад

      Im not an expert, but you could try solving the first material, with the aim of finding T2_material1. Then solve for the second material using T1_material2 = T2_material1 and repeat the process.

    • @felipeanime1999
      @felipeanime1999 3 года назад

      caramba, to tentando fazer a mesma coisa!

    • @onionking1523
      @onionking1523 3 года назад +1

      @@felipeanime1999 I've been giving it some thought. You could try making the alpha term into a matrix equal in size to your grid, then assign the material specific value to that matrix, then iterate through your alpha matrix within your loop.

  • @AJ-et3vf
    @AJ-et3vf 3 года назад

    Thank you

  • @naziabinte5091
    @naziabinte5091 2 года назад

    In line 7, dx should be l/(n-1), no?

  • @manishkala6292
    @manishkala6292 3 года назад

    Thank you sir. In this code wanted to plot surface plot of x,t and T. But it is showing error. Can anyone give suggestion.

  • @nicholassimeon2279
    @nicholassimeon2279 3 года назад

    What unit is alpha in?

  • @baacademy1166
    @baacademy1166 4 года назад +1

    Good day sir, I will like to show my appreciation for your efforts. My question please how can I plot Temperature against time thanks

    • @e-skills2120
      @e-skills2120 4 года назад

      @BA ACADEMY Do you still have a doubt

    • @baacademy1166
      @baacademy1166 4 года назад

      No longer, thanks for the reply

    • @alip6001
      @alip6001 4 года назад

      @@e-skills2120 i need

    • @alip6001
      @alip6001 4 года назад

      @@baacademy1166 can you help?

    • @e-skills2120
      @e-skills2120 4 года назад

      @@alip6001 okay kindly mail me you can find my email id on my channel about section.

  • @dashti.behrouz
    @dashti.behrouz 5 лет назад

    can you tell me how to plot the iteration vs error in a figure? thank you .

  • @Fariskov
    @Fariskov 6 лет назад

    How we can check the convergence?

  • @yem.t.3930
    @yem.t.3930 6 лет назад

    thanks so much! nice tutorial

    • @sarkiskazandjian8886
      @sarkiskazandjian8886 5 лет назад +1

      Hey, Yemane! I just watched this video too!

    • @ruturajshinde9175
      @ruturajshinde9175 5 лет назад

      hey @Yemanebirhan Tadesse, can you help me to solve the problem in which i have to find heat distribution in a tapered cylinder.cylinder is trapezoidal; with small diameter 4 cm and large diameter 8 cm; length of cylinder is 20 cm. temperature at the right hand side is 200 degrees and temp at LHS is 100 degree. Temp of the bar itself is 25 degrees. and i want to find out heat distribution after 10 seconds. I want to do it on matlab. If you could guide me that will be great.

  • @gohteikwei1289
    @gohteikwei1289 4 года назад

    Hi do u have 1D elliptic matlab code?

  • @jiunyeek2606
    @jiunyeek2606 6 лет назад

    hello,Kody. Can i have the coding?

    • @yem.t.3930
      @yem.t.3930 6 лет назад

      so easy, you can just pause the video and write it down, I just did and it runs well.

  • @utaritokn
    @utaritokn 6 лет назад

    implicit solutıon do you have?

  • @natasharodriguez2279
    @natasharodriguez2279 2 года назад

    Creo que es exacto lo que necesito pero en español 😭

  • @Roberto70ism
    @Roberto70ism 6 лет назад

    Hi Kody, is possible to have a code, for example in ".m" form? Thanks

    • @yem.t.3930
      @yem.t.3930 6 лет назад

      so easy, you can just pause the video and write it down, I just did and it runs well.

  • @JamesVestal-dz5qm
    @JamesVestal-dz5qm 5 месяцев назад

    I have more coding experience in Matlab than python. Fouriers law says q=-kAdT/dx. Donald trump set a boundary condition on the southern border! Zero flux boundary condition! Sophisticated code like paul smiths laboratory!