0

So I'm currently learning numerical methods and I'm curious in which scenarios you can blindly trust the numerical methods? Are there scenarios where you should show suspicion towards the numerical result?

As of right now I'm focused on numerical methods for solving ODE (Euler, Runge-Kutta 4 etc) and I want to understand how I should think while analyzing the result I get from my simulations.

One thing I can think of is that round-off errors could potentially cause the system to become unstable which will give the wrong answer.

Avina
  • 31
  • 4
    You should always evaluate error estimates – Yuriy S Oct 13 '22 at 08:01
  • 2
    This is not what you were asking, but, you should always show suspicion towards the numerical result, if for no other reason than that there might be a bug in your implementation. – littleO Oct 13 '22 at 08:16
  • Fixed-step methods are insensitive to stability issues. Meaning if the step size is too large for the properties of the ODE, even if only on some segment of the integration interval, the numerical result can become wildly different to chaotic. So repeat the integration with half or double the step size and check if the values at common time sample points are the same within the desired error bound. – Lutz Lehmann Oct 13 '22 at 09:46

1 Answers1

0

You should always test if your software delivers results that are as accurate as you have a right to expect and you should perform any test that you can think of.

Consider the trivial problem of computing an average $$\mu = \frac{a+b}{2}.$$ If $a=6.377$ and $b=6.379$, then obviously $$\mu=6.378.$$ However, if your computer is using base-10 arithmetic and has 4 significant figures, then the computed sum is $$\hat{s} = 12.76$$ because the exact sum $$s = a + b = 12.756$$ has to be rounded to 4 significant figures. The computed average is therefore $$\hat{\mu} = 6.380.$$ We observe that the computed average of $a$ and $b$ is larger than either $a$ or $b$. We conclude that the basic definition is not a viable formula for computing an average. A better formula is $$\mu = a + \frac{b-a}{2},$$ but this formula is still vulnerable to overflow.

In the context of solving ordinary differential equations we typically have a powerful machinery that will allow you to test the quality of the numbers that have been produced. As a small illustration of what is possible, I offer you this link to an answer to a related question.

Carl Christian
  • 12,583
  • 1
  • 14
  • 37