T5 - Errors
Errors
Types of errors:
Edge of grid errors
Finite difference discretization error
Floating point round-off error
Finite difference truncation error
Schwarzschild Example
Plot Energy Tensors
All 4 types of errors can be seen on this one plot.
The Schwarzschild metric acts well to highlight the different types of numerical error of the code since, Schwarzschild radius, the evaluated energy density should be 0. Therefore, any computed non-zero energy density is due to some type of error.
Edge of Grid Error
The first, and perhaps most important error from a practical standpoint is edge of grid error. The energy tensor is returned in the same grid size as the input metric. At the edges of the world, a full finite difference cannot be taken as the points needed to evaluate to derivatives at the edges are outside of the world. This can be seen in the edges of the plot where, all three evaluations have considerable energy density spikes at the very bounds of the space.
For energy tensor and energy condition plotting, it is recommended to exclude a boundary of 2 grid points at the edges of the space.
Finite Difference Discretization Error
This type of error occurs when the rate of change of the metric components nears or exceeds the grid resolution. The error is a direct function of grid resolution. As can be seen in the plot, the blue low resolution line has more error over a wider area than the higher resolution orange line. Even with high resolution though, the orange line does exhibit this type of error as it nears the center of the Schwarzschild metric. Metrics with sharp transitions can lead to these finite difference edge effects and may give energy/violation that wouldn't actually exist at those boundaries.
Floating Point Round Off Error
For double value precision, there is a maximum dynamic range of numbers that can be stored. As can be seen in the plot, the errors become very noisy around 10^32. The double precision limit prohibits storing more discrete values. This precision limit is based on the maximum value that exists in the array that is storing the values.
Finite Difference Truncation Error
This error results from the finite difference not taking a perfect derivative of the function. The order of the finite difference(second, fourth, etc.) dictate how accurately the real derivative is evaluated. As can be seen from the plot, the yellow second order finite difference has higher errors than the orange fourth order finite difference.
Last updated