How to give a simple estimation of errors for results obtained from 4th order Runge-Kutta

This question is a follow up of another one I have asked a while ago. I have successfully implemented my problem using odeint library and I get the results I expect.

However I would like to give an estimation of the error for the results, obtained by Runge-Kutta method of 4th order. In addition to results obtained by the RK4 method I also have an analytical method to provide solutions.

I have seen another similar question before asking this one. But the treaty of errors in that question is rather rigorous and I don't have expertise in numerical methods. So for me a simple expression based on theory would work fine, and estimation doesn't have to be a very good one.

• The theoretical error estimates tend to be worst-case bounds. Pathological examples can be constructed that attain these worst-case bounds; however, other examples can also be constructed where the error bounds overestimate the error by forty orders of magnitude. Even for formulas that are simple, obtaining or estimating the quantities required for these formulas aren't simple, and the answer that I gave in the question you linked to still applies. Dec 3 '14 at 22:24
• @GeoffOxberry - Thank you for your comment. I was thinking about another thing.. For the problem that I am solving with RK4 I also have an analytical method that provides solution (which is close to one obtained by RK4 of course). Is it valid to take the absolute difference of the results obtained by analytical method and RK4 and call it the error of RK4 method for this particular case ? Thank you. Dec 3 '14 at 23:43
• Assuming that the analytical method calculates the exact solution of the problem you are trying to solve numerically, then yes, taking the difference of the two solutions calculates the error in your RK4 solution. However, if your analytical solution calculates an approximate solution, then the difference of that and the RK4 solution will yield an approximate error, and the quality of this approximation depends on the accuracy of the approximate solution calculated by your analytical method. Dec 4 '14 at 0:17
• @GeoffOxberry - Excellent, thank you very much. If you want you can combine your two comments into an answer. Dec 4 '14 at 0:22
• Done. (The rest of this message is filler to satisfy a 15 character minimum.) Dec 4 '14 at 0:48