User Tools

Site Tools


gibson:teaching:fall-2016:math753:finitediff

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

====== Math 753/852 Finite Differencing ====== The main things to know here are a few formulae for approximating derivatives using finite differences: === First derivative df/dx === Given a set of evenly space gridpoints $x_1, x_2, \ldots$, where $x_i = x_1 + (i-1) h$, and a function evaluated at the gridpoints $f(x_1), f(x_2), \ldots$, we can approximate the first derivative of $f$ at the gridpoints several ways **One-sided finite differencing for the first derivative**, rightwards \begin{equation*} \frac{df}{dx}(x_i) = \frac{x_{i+1} - x_{i}}{h} + O(h) \end{equation*} **One-sided finite differencing for the first derivative**, leftwards \begin{equation*} \frac{df}{dx}(x_i) = \frac{x_{i} - x_{i-1}}{h} + O(h) \end{equation*} **Centered finite differencing for the first derivative** \begin{equation*} \frac{df}{dx}(x_i) = \frac{x_{i+1} - x_{i-1}}{2h} + O(h^2) \end{equation*} In practice you use the fraction on the right-hand-side as an approximation of the derivative, knowing that there is an $O(h)$ or $O(h^2)$ error in the approximation. === Second derivative === To approximate the second derivative $d^2f/dx^2$, we use the **Centered finite differencing for the second derivative** \begin{equation*} \frac{d^2f}{dx^2}(x_i) = \frac{x_{i+1} - 2 x_i + x_{i-1}}{h^2} + O(h^2) \end{equation*} === Other formulae === There are many, many other finite-difference formulae, for higher-order derivatives, higher-order accuracy, and different choices of which gridpoint values enter into the formula. As a starting point, see the following Further reading * [[https://en.wikipedia.org/wiki/Finite_difference|Finite Difference]] (wikipedia) * [[http://www.rsmas.miami.edu/personal/miskandarani/Courses/MSC321/lectfiniteDifference.pdf| Finite Differences lecture]] (Mohamed Iskandarani, University of Miami)

gibson/teaching/fall-2016/math753/finitediff.1479393691.txt.gz · Last modified: 2016/11/17 06:41 by gibson