Three-point approximation
Hi there,
I would like to use a three point approximation as a boundary conditions, but having an unequal space grid, so far I only found information about the central differences while using those grids. The very known relation is: f'(x) = [ -3f(x) + 4f(x+h) -f(x+2h) ] / (2*h) But how does the relation change for an unequal space grid (instead of h, I have h1 and h2) ? Thank you very much ! |
3 point formula with enequal spacing
Hi Artmis,
The solution is quite simple. Fit a parabola that interpolates f(x), f(x+h1) and f(x+h2) at x, x+h1, and x+h2. Call this interpolated parabola fp(x). Then, fp'(x) is the expression you are looking for. The procedure is the same for higher orders as well. Best, Sam |
All times are GMT -4. The time now is 09:03. |