maroba / findiff

Python package for numerical derivatives and partial differential equations in any number of dimensions.
MIT License
411 stars 59 forks source link

How are the higher order derivatives computed in your code? #71

Closed argha004 closed 7 months ago

argha004 commented 1 year ago

Hello, I'm interested in understanding how your code implements higher order derivatives in 3D. I wasn't able to find a white paper or documentation explaining the details of your implementation, so I was hoping you could provide some insight before I use your code.

In my own code, I've been implementing finite differences recursively to compute fourth order derivatives of a scalar function in 3D. However, I've been experiencing significant errors due to the recursive nature of the implementation. So, I'm curious if you've a similar approach to compute the higher order derivatives.

maroba commented 1 year ago

Hi,

in the 1D-case the standard stencils are computed from a Taylor expansion, and in multiple dimensions, the standard stencils are superpositions of the 1D stencils extended to several axes. The theory is described on this page. Does that help you?

Best regards, Matthias