I am currently applying the finite difference method to the solution of the diffusion equation.

I think that a problem has occurred, and is as follows, my explicit method is the most accurate when analyzing the error to the analytic solution, and the Crank-Nicolson method is the least accurate, the implicit method is somewhere in between. So, is this possible or most there be an error somewhere in my Python code?

PS: the errors for all 3 methods are really small, ie.: $\pm 10^{-10}$.


This is exactly the case when the lack of information in the question allows to answer it pretty certainly: it is certainly possible.

The error would depend on many factors, including the conditioning of the original problem, particular details of the numerical implementation, and chosen simulation parameters. I do not see any contradiction yet.

However, I would certainly perform the convergence study of all three methods. It would allow you to see the solution behavior with mesh refinement and confirm if your numerical implementation corroborates the expected result. The convergence study usually allows being much more certain about the numerical implementation as opposed to comparing result at one instance.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.