How to Numerically Solve a 1D Heat Equation ? ( MATLAB Script in Description)

Поділитися
Вставка
  • Опубліковано 5 жов 2024
  • ***** Correction: At 1:33, In the green box the following text would be more appropriate, "The Divergence of Gradient or the Flow of Gradient of Temeperature" instead of "The spatial Gradient of Temperature".
    This is a tutorial on how to solve a 1D heat equation using Finite Difference Approach for a case of Dirichlet Boundary conditions. 1D Heat equation is a Parabolic Partial Differential Equation. It is an initial value problem solved using FTCS scheme and by time marching technique. Explicit method is used.
    -----------------------------------------------------------------------------------------------------------------------------------------------------------
    Physical undestanding of the Heat Equaiton:
    -----------------------------------------------------------------------------------------------------------------------------------------------------------
    The time rate of change in temperature is proportional to the Laplacian of temperature.
    The Laplacian of temperature is the Divergence of gradient, i.e, how the gradient flows.
    The Gradient of temperature at a given point, is actually a vector which speaks on how the temeperature varies as we move out from that point in different directions.
    Now if the Laplacian is positive at a point, that means the surrounding points are at higher temperature than that particular point. So the heat flows into the point. Hence, we will have the temperature rising with time, at that particular point.
    On the other hand if the Laplacian is negative at a point, that means the surrounding points are at lower temperature than that particular point. So the heat flows out of the point. Hence, We will have the temperature dropping with time, at that particular point.
    This video tries to explain the key concepts and math graphically.
    A MATLAB script is shown, to implement the algorithm.
    An animation of temperature evolution inside an frozen aluminum rod that is heated from ends.
    -----------------------------------------------------------------------------------------------------------------------------------------------------------
    Link to Code:
    -----------------------------------------------------------------------------------------------------------------------------------------------------------
    A detailed code that produces the images for animation is availabe at this link : drive.google.c...
    -----------------------------------------------------------------------------------------------------------------------------------------------------------

КОМЕНТАРІ • 25

  • @J-Stew_64
    @J-Stew_64 4 місяці тому +1

    Best video on the subject good job man

  • @matlabtricks5944
    @matlabtricks5944 2 роки тому +1

    Very good video, the best I've seen on the topic, deserves more views!

  • @and_i_wonder_if_you_kow_wh7114

    Awesome video! I was looking for a more general version with a source function g.

  • @k.l.9743
    @k.l.9743 Рік тому

    Good video! Can you make a video of this problem with a second and third order boundary condition in spherical coordinates? It would be an interesting approach for the heat conduction

  • @arts5852
    @arts5852 3 роки тому

    Good job 👍. Your script is perfect

  • @Zebrox_Editz
    @Zebrox_Editz 2 роки тому

    That's a nice video
    Where we use the 1D diffusion eq on it application or for what purpose?

    • @praveenkumarch4566
      @praveenkumarch4566 2 роки тому

      This equation models the physical phenomenon of diffusion, I mean spreading of a particular parameter (dependent variable) from higher concentration zones to lower concentration zone. Here I took an example of heat Diffusion,the parameter is temperature. We can also model diffusion of ink in water, then the parameter will be concentration of ink.

  • @mobinnurzad3592
    @mobinnurzad3592 2 роки тому

    nice. how can I implement the same problem but on one end with neumann B.C dt/dx=0 at x=o

  • @devendranama9424
    @devendranama9424 Рік тому

    How to solve the equation if it contains the source term as well?

    • @BRunoAWAY
      @BRunoAWAY Рік тому

      The source term add Just one more line in the code

  • @AnandSingh-rz5sv
    @AnandSingh-rz5sv 4 роки тому

    Good keep it up

  • @lailatulmaghfiroh8337
    @lailatulmaghfiroh8337 Рік тому

    Please help me sir
    I don't understand how to change the program, for example, the initial temperature of the rod is 25oC
    I'm working on my final project and need to know about it
    Thank you

    • @altynaym1942
      @altynaym1942 Рік тому

      Hey, did you get how to do it?

    • @TheTechHans
      @TheTechHans  Рік тому

      In the matlab script the Array T is the temperature at nodes. T[0] is temperature at zeroth node...
      Initially temperature at all nodes is zero except at end nodes., Where it is 100. As time progresses the T is updated.
      For giving 25 deg as initial condition put
      T[2:end-1]=25
      The above line should be added after the line, "T=zeros(1,nx) ;" in the script.
      ;

  • @elihunyemah8573
    @elihunyemah8573 3 роки тому

    thanks ever so much it was nice script. but does it work for this du/dt=k, d2u/dx2
    u(x,t=0)=h(1-(x/l)square)
    u(x-l)-u(x=-l)-0

    • @TheTechHans
      @TheTechHans  2 роки тому

      Thank you.
      This equation is a generalized 1D diffusion equation: (du/dt)=k* (d2u/dx2)
      Heat equation is also a Diffusion equation.
      So you can use the same Numerical Strategy as explained in this video.
      You need to modify the Matlab Script so that the initial conditions, Coefficient - "k" , and the end conditions are implemented as per the given data.

    • @elihunyemah8573
      @elihunyemah8573 2 роки тому

      @@TheTechHans I send you an email can you respond pls. I did send it to the email address on UA-cam.

  • @priyeshpandey100
    @priyeshpandey100 2 роки тому

    hello dear..do u paidwork ?

    • @TheTechHans
      @TheTechHans  2 роки тому

      Yes I do work for pay. It depends on the kind of work, pay and time schedules.

  • @johnlesterbagongon8628
    @johnlesterbagongon8628 2 роки тому

    how do I update the time step?

  • @am-bt8xq
    @am-bt8xq 3 роки тому

    Thanks sir, can you send me your mail please ?

    • @am-bt8xq
      @am-bt8xq 3 роки тому

      @@TheTechHans are sure that's the right mail ?