Hi Sasireka,
When solving partial differential equations (PDEs), different numerical methods can yield similar results, but there are nuances that might lead to differences in the solutions obtained from “pdepe" and the “Crank-Nicolson” method.
“Pdepe" solver uses a finite element method whereas “Crank-Nicholson" algorithm uses a finite difference method that is implicit and is stable for linear problems. The general differences between the 2 methods are:
- Pdepe abstracts away many of the details, while Crank-Nicholson requires more hands-on implementation.
- Pdepe may be easier to solve complex problems with varying boundary conditions, whereas “Crank-Nicholson” might require more manual adjustments.
- Pdepe uses adaptive time-stepping and spatial discretization, which can lead to different time step sizes and grid resolutions compared to a fixed grid and time step in Crank-Nicolson.
In theory, both methods should converge to the same solution as the grid is refined. However, due to differences in numerical schemes, discretization, and handling of boundary conditions, there might be slight differences in solutions, in cases with larger time steps. For practical purposes, if both methods are implemented correctly and with sufficiently fine discretization, they should provide similar results.
For more information regarding the methods, refer the following documentations:
Hope this helps!