15 Solving PDEs with time stepping
18 Apr 2016Partial differential equations (PDEs) may depend on both space and time derivatives such as the parabolic heat equation
which describes how temperature changes over time in a material with thermal conductivity , heat capacity , and density . Importantly, in order to solve such PDEs, we need to know both the initial values at all positions in space at and the boundary conditions at all later times .
Leap frog algorithm for solving the heat equation
We can then transform the PDE into a finite difference equation on a lattice. The difference equation can be solved with a time stepping scheme where we start from the initial values and solve the spatial component for increasing times using either an explicit method such as the Leapfrog algorithm or an implicit method such as the Crank-Nicholson method.
Von Neumann stability analysis
Not all combinations of and lead to stable solutions. Using Von Neumann stability analysis one can determine analytically the relationship between the discretizations in space and time that lead to stable solutions. The analysis is based on determining the stable eigenmodes of the finite difference equation, i.e., we determine the conditions under which no modes grow in time. This then implies that solutions, which can be written as linear superpositions of these eigenmodes, will also not grow in time and are therefore stable.
Class material
- Student notebooks
- Leap-frog method for the heat equation and von Neumann stability analysis: 15_PDEs-Students.ipynb
- Crank-Nicholson method applied to the heat equation: 15_CrankNicholson-Students.ipynb
- Lecture notebooks (correspond to the student notebooks):
Additional resources
- Computational Physics, Ch 20
- Numerical Recipes in C, WH Press, SA Teukolsky, WT Vetterling, BP Flannery. 2nd ed, 2002. Cambridge University Press. Chapter 19.