Accuracy of the Crank-Nicolson method for non-linear, inhomogeneous heat equation

64 Views Asked by At

I am currently coding a solution to the following PDE:

$\frac{\partial T }{\partial t} =\frac{\partial}{\partial \theta}(A(\theta ,\phi )\frac{\partial T }{\partial \theta}) +\frac{\partial }{\partial \phi}(B(\theta ,\phi )\frac{\partial T}{\partial \phi}) + F(\theta ,\phi)T$ with periodic boundary conditions in polar coordinates.

I have been able to get some code which solves the PDE via the Crank-Nicolson method and matrix inversion, the only problem that I have is with the accuracy of the method, according to Wikipedia, the Crank-Nicolson method is unconditionally stable but ''the approximate solutions can still contain (decaying) spurious oscillations if the ratio of time step $\Delta t$ times the thermal diffusivity to the square of space step, $\Delta x^2 $, is large (typically, larger than 1/2 per Von Neumann stability analysis).''.

How can I check the accuracy of my method in a similar way that Wikipedia has done? Obviously taking a small timestep would improve the method, but would also increase runtime, so I'd rather only increase it if my method's accuracy is worse than say 1% from the actual answer. I am also unsure whether the periodic boundary conditions aid or detriment to the accuracy of my solution as a whole.

I hope someone can point me in the right direction.