Implementation of Alternating Direction Implicit P-R Difference Scheme for Solving Parabolic Equations

Resource Overview

MATLAB implementation of the Alternating Direction Implicit Peaceman-Rachford (P-R) difference scheme for solving parabolic equations. This implementation requires the source function f.m and exact solution function uexact.m. Users can easily adapt the code by modifying the exact solution and right-hand side terms to suit their specific PDE problems.

Detailed Documentation

This article explains how to implement the Alternating Direction Implicit Peaceman-Rachford (P-R) difference scheme for solving parabolic equations using MATLAB. The implementation requires two auxiliary functions: the source function f.m and the exact solution function uexact.m. When applying this program, users only need to modify the exact solution and right-hand side terms according to their specific partial differential equation. Below are the detailed implementation steps:

1. Define Initial Conditions and Grid Generation

The first step involves defining initial conditions and generating a computational grid for numerical calculations. MATLAB's meshgrid function can be utilized to create spatial discretization grids, while time discretization requires defining appropriate time steps based on stability criteria.

2. Implement Alternating Direction Implicit P-R Difference Scheme

This core component implements the ADI P-R scheme through matrix operations and tridiagonal system solvers. The algorithm alternates between implicit solutions in x and y directions using Thomas algorithm (tridiagonal matrix algorithm) for efficient computation. The implementation handles boundary conditions through proper matrix modifications and ensures numerical stability through CFL condition checks.

3. Main Program Development

The main program orchestrates the complete solution process by initializing parameters, calling grid generation functions, and implementing the time-stepping loop. It compares numerical results with the exact solution for error analysis and includes visualization commands like surf or contour for result presentation. Users should modify the uexact.m function for their specific exact solution and update the right-hand side term in f.m accordingly.

By following these steps, researchers can successfully implement the Alternating Direction Implicit P-R difference scheme for solving parabolic equations in MATLAB, with flexibility to adapt the code for various boundary conditions and equation parameters.