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

Поделиться
HTML-код
  • Опубликовано: 10 окт 2020
  • ***** 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.com/file/d/1mlqS...
    -----------------------------------------------------------------------------------------------------------------------------------------------------------

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

  • @J-Stew_64
    @J-Stew_64 2 месяца назад +1

    Best video on the subject good job man

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

    Good job 👍. Your script is perfect

  • @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.

  • @AnandSingh-rz5sv
    @AnandSingh-rz5sv 3 года назад

    Good keep it up

  • @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

  • @mobinnurzad3592
    @mobinnurzad3592 Год назад

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

  • @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.

  • @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

  • @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 2 года назад

    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 RUclips.

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

    how do I update the time step?

  • @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.

  • @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 ?