Title: Numerical differentiation
1Numerical differentiation Recall finite
differences from first week
Derived from Taylor series
2Neglecting all tersms higher than first order
Thats the forward difference - also backwards
and centered difference
3Why is centered finite difference O(h2)?
Subtract second equation from first
4We can combine Taylor series expansions in many
different ways to get estimates of
derivatives Example backwards second derivative,
O(h2) Start with
5Multiply first equation by -5, second equation by
4 and add together
6Multiply third equation by -1 and add to above
result
Rearrange
7Where did I get -5, 4,-1?
We multiply 1st equation by a, second by b, third
by c
8Now sum all equations and collect terms
Decide what derivatives we want to make disappear
- want a second derivative only - eliminate first
and third
9Three unknowns - 2 equations - make an assumption
Let c-1
Can solve by hand
10If we have more derivatives to get rid of, use
matrix methods - always one assumption
11More Richardson extrapolation Recall
Can do the same thing with derivatives
12Use same approach as Romberg integration with
halving the step size Example Formula for active
lateral pressure coefficient Ka with internal
angle of friction f and wall with slope b and
flat top is
Use Richardson/Romberg approach to estimate
at b10 degrees and f15 degrees
13Use O(h2) estimates to get O(h6) estimate
14Now do Richardson/Romberg trick
15Derivatives of unequally spaced data Can use
matrix approach with different amounts of
h Example given values of f at x(1,2,5.5,9)
determine f at 2
16Let h1, x2 (values at 1,2,5.5,9)
Equations to get rid of f and f are
and assume a value for c
17Let c1, then a-22.8667, b-8.5333 then
or
18Derivatives of unequally spaced data Another way
is to take derivative of interpolating
polynomial Lagrange polynomial - second order in
this case
19Derivatives and integrals with errors in
data Errors in data points can cause
problems esp. with differentiation Example
with and without noise True
derivative is 2x-6
20Look at ratio of noise in y to noise in dy/dx
For differentiation, fit a smooth line to the
data, then take derivative