Finite differences and spectral methods
Two ways to differentiate a function you only know at grid points. A central difference uses the two neighbors; a spectral derivative uses every point. On a smooth periodic function the spectral one reaches rounding error with a few dozen points. Put a jump in the function and, away from the jump, the central difference is the accurate one.
10 paragraphs · 8 functions · 2 min
Look inside this program
- Atlas
The program’s map: every function and which calls which.
There’s no recorded run of this program yet.