Numerical Methods/Numerical Differentiation

From testwiki
Revision as of 01:12, 4 December 2017 by imported>Pi zero ({{BookCat}})
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Often in Physics or Engineering it is necessary to use a calculus operation known as differentiation. Unlike textbook mathematics, the differentiated functions are data generated by an experiment or a computer code.


Begin with the Taylor series as seen in Equation 1.

f(x+h)=f(x)+f'(x)h+f(2)(x)2!h2+f(3)(x)3!h3+(1)

Next by cutting off the Taylor series after the fourth term and evaluating it at h and -h yields Equations (2) and (3).

f(x+h)=f(x)+f'(x)h+f(2)(x)2!h2+f(3)(c1)3!h3(2)

f(xh)=f(x)f'(x)h+f(2)(x)2!h2f(3)(c2)3!h3(3)

Then by subtracting Equation (2) by Equation (3) yields.

f(x+h)f(xh)=2f'(x)h+f(3)(c1)3!h3+f(3)(c2)3!h3

Central Difference

f'(x)=f(x+h)f(xh)2h+O(h2)

Forward Difference

f'(x)=f(x+h)f(x)h+O(h)

Backward Difference

f'(x)=f(x)f(xh)h+O(h)

Second Derivative

The second order derivatives can be obtained by adding equations (2) and (3) (if properly expanded to include the fourth-derivative-term):

f'(x)=f(x+h)2f(x)+f(xh)h2+O(h2)

High Order Derivatives

Template:BookCat