next up previous index
Next: Algebraic Models Up: Taylor Series Previous: Taylor Series   Index

Click for printer friendely version of this HowTo

Reverse Engineering

Sometimes you are faced with an equation that appears to be a guess by someone. Is there a way to figure out what it approximates? This is particularly true with difference equations when someone is approximating an ordinary differential equation or a partial differential equation and they state a bunch of difference equations and one looks a bit spooky. So here is a way to reverse engineer what is happening. Typically, the equations involve a function and a couple of points, say $ V_{i-1}, V_{i}, V_{i+1}$ Now lets expand the function, V, around point i as

$\displaystyle V_{i-1} = V_{i} - \Delta x * V'_i + \Delta x^2 V''/2 + ...$    

$\displaystyle V_{i+1} = V_{i} + \Delta x * V'_i + \Delta x^2 V''/2 + ...$    

Now some preliminaries. Suppose we use $ \Delta V / \Delta x $ to approximate a derivative. We see immediately form above that

$\displaystyle \frac{V_{i-1} - V_{i}}{\Delta x} = -\frac{dV_{i-1}}{dx} + \Delta x V''/2 + ...$    

which shows that we estimate the left derivative with an error that is proportional to the 2nd derivative. To get a sort of unbiased estimator of the derivative - subtract equation 4 from 5 and you see:

$\displaystyle V_{i+1} - V_{i-1} = 2\Delta x \frac{dV}{dx}$    

or

$\displaystyle \frac{V_{i+1} - V_{i-1}}{2 \Delta x} = \frac{dV}{dx}$    

Now this is a nice estimator - Note that dividing each side by $ 2\Delta x$ gives a perfect approximation of the derivative - i.e. the higher order terms disappear!

Now let's say that someone uses the difference equation $ V_{i-1} - 3V_{i} + 2V_{i+1} / \Delta^2$ and we would like to know what it estimates. So we multiply equation 5 by 2 and add them getting

$\displaystyle V_{i-1} + 2V_{i+1} = 3V_i + \Delta x\frac{dV}{dx} + 3 \Delta x^2\frac{d^2V}{dx^2}$    

so moving the $ 3 V_i$ to the left we have

$\displaystyle \frac{V_{i-1} -3V_i + 2V_{i+1}}{\Delta x} = \frac{dV}{dx} + 3 \Delta x\frac{d^2V}{dx^2}$    

The paper where this appeared stated that the above difference equation approximated the first derivative - and its obvious that it approximates a bit more than the simple first derivative.


next up previous index
Next: Algebraic Models Up: Taylor Series Previous: Taylor Series   Index

Click for printer friendely version of this HowTo

Frank Starmer 2004-05-19
>