1

To analyze a numerical method for an ODE, we can create a loglog plot of the error versus the stepsize, and the slope of that curve is the order of the method. The error is is the norm of the difference between the exact and approximate solution.

Suppose the ODE does not have an exact solution, for example the Van der Pol oscillator. How do you create a convergence plot in that case. Specifically how do you compute the error without an exact solution?

  • You use several different stepsizes and when your numerical solution stops changing at any significant level (it is you who should decide what significant is) then you consider it as a "correct" solution. In addition you can try to use different methods. – Artem Jun 26 '22 at 22:36
  • @Artem Thanks. I don't see though how that would help me investigate the order of convergence – Rudinberry Jun 26 '22 at 23:01
  • See also https://math.stackexchange.com/questions/3058387/empirical-error-proof-runge-kutta-algorithm-when-not-knowing-exact-solution for a different (in the sense of additional) view. – Lutz Lehmann Jun 27 '22 at 04:20

1 Answers1

0

Artem's comment is correct. Let me expand their point.

Let $u$ be the true solution. Let $x\mapsto v(x;h)$ be an approximate solution with step size $h$. Suppose the error at $x$ is polynomial in $h$: $$ v(x;h)=u(x)+ch^{p}+o(h^{p}). $$ Let $$ w(x;h)\equiv\frac{v(x;\frac{h}{1})-v(x;\frac{h}{2})}{v(x;\frac{h}{2})-v(x;\frac{h}{4})}. $$ By ordinary calculus, $$ \lim_{h\downarrow0}w(x;h)=2^{p}. $$ Assuming $h\mapsto w(x;h)$ is continuous in a (punctured) neighborhood of zero and using the fact that continuous functions and limits commute, $$ \lim_{h\downarrow0}\lg w(x;h)=p. $$ This gives you a very simple way to approximate the rate of convergence: fix $h$ and compute $\lg w(x;h)$. Note that computing $w(x;h)$ requires the approximate solution at three different step sizes ($h / 2^d$ for $d = 0, 1, 2$). Note, in particular, that $w(x;h)$ does not depend on the exact solution.

parsiad
  • 25,154
  • The problem is that if you halve the stepsize h, the timescale of the solution is going to change (i.e. the dimension of the discrete solution with h/2 is larger than the one obtained with h). So you can't subtract them. Right? – Rudinberry Jun 28 '22 at 22:42
  • The approximate solution at $x$ should have a limit as the step size $h$ goes to zero, otherwise your numerical method is divergent. So no, the time-scale of the solution does not change. – parsiad Jun 29 '22 at 00:27