2025-05-09 08:28:08
This post is part of a series of Finite Difference Method Articles. Other posts in the series concentrate on Derivative Approximation, the Crank-Nicolson Implicit Method and the Tridiagonal Matrix Solver/Thomas Algorithm:
In Part 1 of the series on Finite Difference Methods, it was shown that continuous derivatives could be approximated and applied to a discrete domain. The next step is to apply these derivatives to a parabolic PDE. The heat equation is the canonical example of a parabolic PDE, and this will now be discretised.
The heat equation with initial condition g is given below:
This is discretised by applying a forward difference to the time derivative and a centered second difference for the diffusion term to give:
This equation can be rearranged for
For
This formula will allow calculation of
This will allow a solution to be generated by progressing from the initial condition in a temporal manner. This is referred to as a time marched solution:
For
It turns out that the issue is with the choice of time step size
It is beyond the scope of this article to prove this result, but note that it puts a significant restriction on the time step - a problem which will be remedied in the next article.
Applying this new stability criterion, with
The calculation for this formulae provides:
This is an accurate approximation to the true solution. There are no negative values and the physical interpretation of the heat diffusing through a 1D bar fits with the solution.
The choice of time step is very restrictive. In practice, with a refined spatial mesh, the time step would be proihibitively small. The next article will introduce another method to overcome the small timestep issue.
Reference: Solving the Diffusion Equation Explicitly
From https://www.quantstart.com/articles/Solving-the-Diffusion-Equation-Explicitly/
2025-01-10 10:12:01
2024-05-31 03:06:49
2024-05-28 03:09:25
There are many other interesting articles, try selecting them from below.
2023-11-22 11:10:42
2023-11-22 01:58:55
2025-04-30 04:52:47
2023-10-30 04:35:37
2025-03-05 10:17:38
2024-06-06 02:05:04
2024-04-12 11:25:15
2023-09-07 10:30:37