Higher order derivatives of unequally spaced data

07062021, 08:48 PM
(This post was last modified: 07062021 08:50 PM by Namir.)
Post: #1




Higher order derivatives of unequally spaced data
Hi All,
I found on the Internet several documents and power points that describe how to estimate the first and second derivatives of unequally spaced points based on quadratic Lagrangian polynomials. I posted on my web site (click here to download) a short paper that presents first, second, third, and fourth derivatives based on cubic and quartic Lagrange polynomials. I used some free online tools to help me formulate the equations for these derivative estimates. The paper includes the pseudocode for these methods along with source code in Excel VBA, Matlab, and Python. These derivatives are helpful in estimating the rate of changes in physical of chemical process where the physical/chemical property is measured at irregular intervals. Namir 

07072021, 05:45 PM
Post: #2




RE: Higher order derivatives of unequally spaced data
For derivatives, we may remove 1 term of Lagrange polynomial.
(f(x))' = (f(x)  c)', for constant c Example, with 3 points: \( f(x) ≈ f(x_1)\left({(xx_2)(xx_3) \over (x_1x_2)(x_1x_3)}\right) + f(x_2)\left({(xx_1)(xx_3) \over (x_2x_1)(x_2x_3)}\right) + f(x_3)\left({(xx_1)(xx_2) \over (x_3x_1)(x_3x_2)}\right) \) Let \(c = f(x_2)\), we eliminated middle term: \( f'(x) ≈ \Big(f(x_1)  f(x_2)\Big) \left({(xx_2)+(xx_3) \over (x_1x_2)(x_1x_3)}\right) + \Big(f(x_3)  f(x_2)\Big) \left({(xx_1)+(xx_2) \over (x_3x_1)(x_3x_2)}\right) \) Simplify with Divided Differences Notation: \(\begin{align} f'(x) &≈ {f[x_1,x_2] \over x_3x_1} (x_2+x_32x) + {f[x_2,x_3] \over x_3x_1} (2xx_1x_2) \\ &= {f[x_1,x_2] \over x_3x_1} (x_2+x_32x) + \left(f[x_1,x_2,x_3] + {f[x_1,x_2] \over x_3x_1}\right) (2xx_1x_2) \\ &= f[x_1,x_2] + f[x_1,x_2,x_3] \, (2xx_1x_2) \end{align}\) We can confirm above, with 3points Divideddifference formula \(f(x) ≈ f(x_1) + (xx_1) \Big(f[x_1,x_2] + (xx_2)\,f[x_1,x_2,x_3] \Big) \) Differentiate with respect to x, we get back the same f'(x) 

07102021, 11:05 PM
Post: #3




RE: Higher order derivatives of unequally spaced data
Thanks Albert! I may updated my paper to include a version of algorithms and source codes that are based on Newton divideddifference polynomials.
Namir 

07172021, 12:45 PM
Post: #4




RE: Higher order derivatives of unequally spaced data
Hi All,
I have updated my original paper to include higher order derivatives of unequally spaced data using Newton's divideddifference interpolation polynomials. The update also includes source code functions in Excel VBA, Matlab, and Python. To access the updated paper click here. Enjoy! Namir 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)