Crank-Nicolson is much less accurate than implicit FTCS.

296 Views Asked by At

I am worried about this. I am solving the heat equation with α=1 and homogeneous Dirichlet boundary conditions. I use dt=0.00001, dx=0.01, nx=101 in the interval [0,1]. I found that the implicit FTCS gives me an error (difference between the analytic solution and the numerically computed solution) between 0 and 0.006. The C-N method for exactly the same problem gives me an error between 0 and 0.14. That is about two orders of magnitude larger in C-N. I expected higer precision in C-N. Any idea why is this happening? I evaluated the error in times 0.1,0.2,0.3,0.4,0.5. I have graphs for this with $x \in [0,1]$ with $dx=0.01$. All is done in Python.

I appreciate any suggestion about this (other than telling me I have a bug in my code. I seriously consider this as an option and I am looking into this, but I cannot yet find a bug).

When I use $dt=0.1$ C-N is more accurate than FTCS. Errors in C-N in $[-0.12,0.3]$ and FTCS $[0,0.8]$.

Thanks.