Difference between revisions of "Numerical Differentiation"

From Sutherland_wiki
Jump to: navigation, search
m (Lagrange Polynomials)
m (Lagrange Polynomials)
Line 14: Line 14:
 
<center><math>f^{\prime}(x) = \sum_{k=0}^n y_k L_{k}^{\prime}(x),</math></center>
 
<center><math>f^{\prime}(x) = \sum_{k=0}^n y_k L_{k}^{\prime}(x),</math></center>
 
where <math>L_{k}^{\prime}(x)</math> is given as
 
where <math>L_{k}^{\prime}(x)</math> is given as
<center><math>L_{k}^{\prime}(x) = \left[ \sum_{{i=0} \atop {i\ne k}}^{n} (x-x_i) \right] \left[ \prod_{{i=0}\atop{i\ne k}}^{n} (x_i-x_k) \right]^{-1}. </math></center>
+
<center><math>L_{k}^{\prime}(x) = \left[ \sum_{j=0}^{n} \left( \prod_{ {i=0}\atop{i \ne j,k} }^n (x-x_i) \right) \right] \left[ \prod_{{i=0}\atop{i\ne k}}^{n} (x_i-x_k) \right]^{-1}. </math></center>
 
Here <math>n</math> is the order of the polynomial and we require <math>n_p=n+1</math> points to form the Lagrange polynomial.
 
Here <math>n</math> is the order of the polynomial and we require <math>n_p=n+1</math> points to form the Lagrange polynomial.
  

Revision as of 11:25, 15 July 2008

Introduction

Taylor Series

Lagrange Polynomials

Lagrange polynomials, which are commonly used for interpolation, can also be used for differentiation. The formula is

f^{\prime}(x) = \sum_{k=0}^n y_k L_{k}^{\prime}(x),

where L_{k}^{\prime}(x) is given as

L_{k}^{\prime}(x) = \left[ \sum_{j=0}^{n} \left( \prod_{ {i=0}\atop{i \ne j,k} }^n (x-x_i) \right) \right] \left[ \prod_{{i=0}\atop{i\ne k}}^{n} (x_i-x_k) \right]^{-1}.

Here n is the order of the polynomial and we require n_p=n+1 points to form the Lagrange polynomial.

Tables for Derivatives on Uniform Grids

Some First Derivative Expressions for a Uniform Mesh
Derivative at point i Discrete Representation (uniform mesh) Order
Forward Difference  \left. \frac{\mathrm{d}\phi}{\mathrm{d}x} \right|_{i} \approx \frac{\phi_{i+1}-\phi_{i}}{\Delta x} \mathcal{O}\left(\Delta x \right)
Backward Difference  \left. \frac{\mathrm{d}\phi}{\mathrm{d}x} \right|_{i} \approx \frac{\phi_{i}-\phi_{i-1}}{\Delta x} \mathcal{O}\left(\Delta x \right)
Central Difference  \left. \frac{\mathrm{d\phi}}{\mathrm{d}x} \right|_{i} \approx \frac{\phi_{i+1}-\phi_{i-1}}{2\Delta x} \mathcal{O}\left(\Delta x^2 \right)


Some Second Derivative Expressions for a Uniform Mesh
Derivative at point i Discrete Representation (uniform mesh) Order