Crank-Nicolson VS pdepe MATLAB partial-differential equation solver

The Crank-Nicolson method is a popular finite difference numerical method for solving partial differential equations (PDEs) – which are equations with two or more independent variables. The 1-D heat equation below has two independent variables, the time variable, t, and the spatial dimension, x. The question becomes, how does the Crank-Nicolson method to solve PDEs …

What is the Crank-Nicolson method?

Solving partial differential equations is hard, luckily we have numerical methods to help us break apart abstract mathematical concepts into the most simplest elements – the Crank-Nicolson method allows for a simple way to solve parabolic PDEs. Let’s look at the classic example of a one-dimensional rod that is subjected to two opposing temperatures on …