An Efficient Explicit Scheme for Solving the 2D Heat Equation with Stability and Convergence Analysis ()
1. Introduction
Heat is a form of energy that transfers from one medium to another due to a temperature difference. According to the second law of thermodynamics, heat naturally flows from a hotter region to a cooler one, proportional to the temperature gradient and the material’s thermal conductivity [1]. This phenomenon governs many real-world applications, from industrial processes to biological systems.
The mathematical modeling of this process is described by the heat equation, a parabolic, second-order linear partial differential equation (PDE) that captures the temporal and spatial evolution of temperature in a medium. It explains how thermal energy diffuses through a region over time. For example, when a hot object is submerged in cooler water, its temperature gradually decreases, and eventually, thermal equilibrium is reached in the absence of external heat sources.
While analytical methods such as separation of variables [2]-[6], Fourier series [7] [8], and domain decomposition [9]-[11] have been effectively used to solve the heat equation under simplified conditions, they are often impractical for complex geometries or boundary conditions. To overcome these limitations, numerical methods, particularly the Finite Difference Method (FDM) [12]-[15], have become widely adopted. FDM approximates the derivatives in the PDE using finite difference expressions derived from Taylor series expansions [16]-[18], converting the PDE into a system of linear algebraic equations that can be efficiently solved using iterative algorithms.
The Forward Time Centered Space (FTCS) scheme is a classical explicit finite difference method known for its simplicity and ease of implementation. Despite its conditional stability, the FTCS scheme remains popular for short-time simulations where the time step can be carefully controlled.
In this paper, we investigate the two-dimensional heat equation using the FTCS method. We derive the numerical scheme, perform a rigorous von Neumann stability analysis, and validate the method by comparing the numerical solution with the exact analytical solution. The error is evaluated both graphically and numerically using maximum and L2-norms. The numerical experiments are carried out in MATLAB, and the results demonstrate the accuracy and reliability of the method under stable conditions.
The remainder of the paper is organized as follows: Section 2 presents the mathematical model and initial-boundary value problem. Section 3 describes the finite difference discretization and development of the FTCS scheme. The stability analysis using von Neumann’s method is given in Section 4. Section 5 provides a detailed error analysis and discussion of the numerical results. Finally, Section 6 offers concluding remarks.
2. Model Equations
In our model problem, we consider the two-dimensional time dependent heat conduction equation of the form [18],
(1)
with initial condition
(2)
and boundary conditions
(3)
(4)
where,
is the temperature of the substance,
the thermal diffusivity of the substance. Equations (1), (2), (3) and (4) together are called initial boundary-value problems.
3. Finite Difference Discretization
The finite difference method (FDM) is a numerical technique that approximates derivatives by using finite differences at discrete grid points. Through discretization, the continuous domain in space and time is converted into a finite grid, allowing partial diffessrential equations like the heat equation to be solved as systems of algebraic equations [4] [14] [15].
In order to describe the finite difference techniques, let us consider the rectangle
into a finite number of nodes
, where Ω denotes the spatial domain and Γ represents the time domain.
3.1. Approximation of the Derivatives of a Function by Finite Differences
In this section, we derive the finite difference approximations for the partial derivatives in the heat Equations (1)-(4).
Step 1: (Discretization of the domain) We divide the spatial domain
into a uniform grid with step sizes
and
, and we divide the time domain into discrete steps of size
.
Let
denote the temperature at position
at time
. The spatial points are indexed as:
where,
and
are the number of grid intervals in
and
directions, respectively, and the time step size is defined as
, where
is the total number of time steps.
Step 2: (Finite difference approximation): We use a forward difference scheme for the time derivative (explicit in time) and central difference schemes for the spatial derivatives. These approximations are given as follows:
The first-order time derivative is approximated by the forward difference:
(5)
The second-order spatial derivatives are approximated by the central difference scheme:
(6)
(7)
3.2. Forward Time Centered Space (FTCS) Explicit Scheme
To construct the FTCS formula for our Equation (1) [6] [14] [15], we substitute the approximations (5)-(7) in (1). We obtain
Rearranging for
:
Define stability parameters:
The update formula simplifies to:
(8)
Figure 1. FTCS Grid: The node
and its four immediate neighbors used in the Forward Time Centered Space (FTCS) discretization for the 2D heat equation.
Figure 1 illustrates the finite difference stencil used in the Forward Time Centered Space (FTCS) scheme for the two-dimensional heat equation. The central node
corresponds to the grid point where the temperature is being updated. Its four immediate neighbors
,
,
, and
are used to approximate the second-order spatial derivatives in the
and
directions via the central difference method. This five-point stencil structure is fundamental to the explicit FTCS update formula in Equation (8), enabling the computation of the temperature at the next time level using current values at the surrounding nodes.
4. Stability Analysis
In the numerical solution of partial differential equations, such as the two-dimensional heat equation, ensuring the stability of the numerical scheme is essential for obtaining reliable and accurate results. Stability determines whether the numerical errors introduced at each time step will remain bounded or amplify uncontrollably as the simulation progresses. Particularly for explicit schemes like the Forward-Time Central-Space (FTCS) method, stability imposes strict conditions on the relationship between time and spatial discretization parameters. Without satisfying these conditions, the computed solution may diverge from the true behavior of the underlying physical system, rendering the results unreliable. In what follows, we conduct a detailed Von Neumann stability analysis of the FTCS scheme applied to the 2D heat equation to derive the necessary condition for numerical stability [14] [15] [19].
Assume the error (or solution) at grid point
and time step
is a Fourier mode:
where,
is the amplification factor;
are spatial frequencies (wave numbers);
is the imaginary unit.
So each term in FTCS updated formula (8) becomes:
Now substitute these values in (8), and factor out the common term
from the entire right-hand side, we obtain
Using the identity
, we simplify:
Or, more compactly using the identity
, we get
The scheme is stable if
for all wave numbers
. Since
, the maximum dissipation occurs when
Then the worst-case amplification factor is,
To ensure
, the condition is
The most restrictive bound is given by
(9)
The equality case
results in marginal stability, where the amplification factor
in the worst-case scenario. This may result in non-growing but oscillatory behavior, which is why it is treated cautiously in practice. Equation (9) is known as the CFL (Courant-Friedrichs-Lewy) condition for stability of the 2D FTCS scheme [20]. This condition ensures the numerical scheme does not produce oscillations or divergence.
To illustrate the behavior of the FTCS scheme under various stability conditions, we present six numerical solution plots for the two-dimensional heat equation using different values of the stability parameter
. Figure 2 and Figure 3 demonstrate solutions within or at the edge of the theoretical stability limit, while Figure 4 shows the unstable behavior when the CFL condition is violated.
Figure 2(a) and Figure 2(b) display stable solutions for
, simulated over the spatial domains
and
, respectively. Similarly, Figure 3(a) and Figure 3(b) show solutions for
, which lies exactly at the stability threshold. In all four cases, the numerical solutions remain smooth and bounded over time, indicating stable evolution of heat diffusion.
In contrast, Figure 4(a) and Figure 4(b) illustrate the unstable nature of the FTCS scheme for
, which exceeds the stability bound. The numerical solutions exhibit unbounded growth and spurious oscillations, especially near the center of the domain, confirming the breakdown of the method under instability.
Note that, the stability parameter
is computed using
,
, and
, which yields
. Similarly,
results from
, giving
. On the other hand,
corresponds to
, yielding
Figure 2. Stable FTCS solutions of the 2D heat equation for
.
Figure 3. FTCS solutions at the critical stability threshold
.
Figure 4. Unstable FTCS solutions of the 2D heat equation for
.
5. Error Analysis and Results Discussion
To evaluate the accuracy and reliability of the Forward Time Central Space (FTCS) method for solving the two-dimensional heat equation, we perform a quantitative and qualitative error analysis by comparing the numerical solution with the exact analytical solution at a fixed final time
. We chose the final time
to ensure the solution has evolved meaningfully while maintaining numerical stability. This duration is long enough to observe the diffusion process without violating the CFL condition [13] [21]. The governing equation is discretized using a uniform grid of size 21 × 21, with spatial step sizes
, and time step
. The diffusion coefficient
is set to unity.
The key stability parameter for the FTCS method in two dimensions is the sum
, where
In our setup,
,
, and
, giving
, yielding
, which satisfies the theoretical stability criterion (9). This ensures that the scheme remains numerically stable throughout the simulation.
We use the exact solution,
(10)
and the sinusoidal initial condition,
(11)
for comparison. The condition (11) is chosen because it satisfies the homogeneous Dirichlet boundary conditions (3 - 4) and corresponds to the exact analytical solution (10) of the 2D heat Equation (1). This facilitates validation of the numerical method by allowing precise error comparison. The error is assessed both visually and through quantitative norms. The maximum norm error is given by
indicating the largest pointwise deviation across the computational domain.
The discrete
-norm error is computed as
providing a measure of the global error over the entire domain.
The numerical solution obtained using the FTCS scheme (solid blue line) is plotted against the exact analytical solution (dashed red line) in Figure 5(a). Both solutions are evaluated along the horizontal cross-section
. The two curves overlap almost perfectly, demonstrating excellent agreement between the FTCS approximation and the true solution. This alignment confirms that the spatial and temporal discretizations are sufficiently fine to resolve the solution accurately.
The second figure of Figure 5 (i.e., Figure 5(b)) plots the absolute pointwise error
along the same line
. The error curve exhibits a smooth and symmetric profile, peaking near the center of the domain but remaining under 1.5 × 10−10, which is consistent with round-off level errors given the double-precision arithmetic typically used in MATLAB.
Overall, the error analysis confirms that the FTCS method is both stable and highly accurate under the given discretization and time step. The small magnitude of the maximum and L2 errors suggest that the numerical solution is an excellent approximation to the analytical solution, validating the correctness and precision of the implementation.
Figure 5. Comparison of FTCS and Exact Solutions (left) with Corresponding Error (right) at
,
.
6. Conclusions
In this study, we applied the Forward Time Centered Space (FTCS) explicit finite difference scheme to numerically solve the two-dimensional heat conduction equation. Starting from the model formulation, we derived the FTCS update formula through systematic spatial and temporal discretization. A detailed von Neumann stability analysis was performed to obtain the CFL condition, which ensures the boundedness of the numerical solution over time.
The numerical experiments demonstrated that the FTCS method, when applied under stable conditions, yields excellent agreement with the analytical solution. The computed maximum norm and L2-norm errors were both of the order of 10−10, indicating the accuracy and reliability of the method. Graphical comparisons further confirmed the validity of the implementation and the method’s capability to capture the correct behavior of the heat distribution.
A key limitation of FTCS is its conditional stability, requiring very small time steps for fine spatial grids (due to
). This leads to high computational cost and makes the scheme unsuitable for long-time simulations or large-scale domains unless adaptive or implicit methods are used. Nevertheless, for problems where the CFL condition can be satisfied, the FTCS method remains a powerful and educationally valuable tool for approximating solutions to the heat equation.