Sie sind auf Seite 1von 1

error

10

10

10

10

-5

-10

-15

first order
second order
fourth order

-20

10

-5

10

-4

10

-3

10

-2

10

-1

10

delta x

Figure 1 - Numerical error of the finite difference method with different orders of accuracy

The chart above shows how the error of the first derivative of the given function is affected by the x size
and the order of the finite difference used. As we can see the fourth order always presented the small error,
but it has some fluctuations for small x due the fact that calculations performed to compute the
approximation for the derivative requires more algorisms than the actual numerical precision. For x
relatively large the first order scheme is actually better than the second order; mainly because the point
being analyzed (as shown in the figure below) information of the function in the x = 2 and x = 3 is taken to
calculate the derivative when using 2nd order accurate method, this introduce a considerable error in the
calculations, because the derivative at x = 2 is quite different that x = 4. On the other side, in the first order
scheme only the information in the nodes at x = 3 and x = 5 is taken in account, and in this range the
derivative is not so different than x = 4. For x between 103 and 101 the results are like expected, the
first order has the larger error, followed by the second order scheme and the fourth order discretization.

Figure 2 - Plot of the analyzed function

Das könnte Ihnen auch gefallen