3 ms·
All good stuff, I’d add though that for many numerical routines you end up testing on simple well known systems that have well defined analytic answers. So for
by physicsguy 2y ago
All good stuff, I’d add though that for many numerical routines you end up testing on simple well known systems that have well defined analytic answers.
So for e.g. if you’re writing solvers for ODE systems, then you tend to test it on things like simple harmonic oscillators.
If you’re very lucky, some algorithms have bounded errors. For e.g. the fast multipole method for evaluating long range forces does, so you can check this for very simple systems.
- LeanderK 2y agoyeah that's how I do it. You start simple (known solutions for trivial points), then easy cases with analytic solutions and then just some random stuff where you test that the solutions is reached without errors and makes sense (correct sign etc.), here called the property based tests.