08/12/2009, 02:29 PM
(08/12/2009, 12:37 PM)Gottfried Wrote: Hi Jay,Actually, since I'm trying to find the Taylor series, I don't worry about the factorials. So I work directly with the matrix above, where the first row is [1 -2 4 -8 16].
there is a simple recursion formula, with which you can generate the inverse matrix.
I used the description at wikipedia for the stencils,
Code:f(x-2h)= f(x) -2h f'(x)/1! + 4h^2 f''(x)/2! - 8h^3*f'''(x)/3! + 16h^4*f''''(x)/4!
f(x-h) = f(x) -1h f'(x)/1! + 1h^2 f''(x)/2! - 1h^3*f'''(x)/3! + 1h^4*f''''(x)/4!
f(x) = f(x) 0 0 0 0
f(x+h) = f(x) +1h f'(x)/1! + 1h^2 f''(x)/2! + 1h^3*f'''(x)/3! + 1h^4*f''''(x)/4!
f(x+2h)= f(x) +2h f'(x)/1! + 4h^2 f''(x)/2! + 8h^3*f'''(x)/3! + 16h^4*f''''(x)/4!
To prepare this for matrix-analysis I rewite this as matrix-equation:
Code:ยด
|f(x-2h)|= |1 -2 4 -8 16 | | f(x)/0! |
|f(x-h) |= |1 -1 1 -1 1 | | f'(x)/1! |
|f(x) |= |1 0 0 0 0 |* | f''(x)/2! |
|f(x+h) |= |1 1 1 1 1 | | f'''(x)/3! |
|f(x+2h)|= |1 2 4 8 16 | | f''''(x)/4!|
Inverting this and multiplying by 4!, or (n-1)! in general, I get back a matrix of integer coefficients. For this 5x5 matrix, I get:
Code:
[ 0 0 24 0 0]
[ 2 -16 0 16 -2]
[ -1 16 -30 16 -1]
[ -2 4 0 -4 2]
[ 1 -4 6 -4 1]But as I said, I haven't found a general formula. I'll take a look at Henryk's suggestions about the Stirling numbers, to see if I get any help there.
It may turn out that working with the factorials helps simplify the math, so I'll take a look at your matrices later today, when I'm more awake and can focus on them.
~ Jay Daniel Fox

