Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider ways to improve accuracy/performance of 3D axial derivative interpolation #39

Closed
leon-vv opened this issue Mar 2, 2023 · 3 comments
Labels
long term Nice to have but not immediately relevant

Comments

@leon-vv
Copy link
Owner

leon-vv commented Mar 2, 2023

Ideas to improve the method:

  • $A^{\nu+1}_m$ should be the second derivative (in z direction) of coefficient $A^{\nu}_m$. We could use this to improve the accuracy of the cubic spline interpolation along the z axis.
  • The current theta interpolation uses values computed using numerical integration in Python using 64 bit floating point numbers. Therefore they can be expected to be accurate to at most a small multiple of the 64 bit float machine epsilon. Since for the pre-computation we can expend an arbitrary amount of computing power, we need to make sure these values are correct down to the max precision achievable with 64 bit floating point numbers. We can achieve this using arbitrary precision floating point number numerical integration.
  • The current theta interpolation uses a cubic spline interpolation. We can consider other interpolation types, also we can make the cubic spline interpolation more accurate by explicitly providing the derivatives, which we can compute to arbitrary precision ourselves.
@leon-vv leon-vv added the long term Nice to have but not immediately relevant label Mar 2, 2023
@leon-vv
Copy link
Owner Author

leon-vv commented Mar 22, 2023

Regarding point two, I made an implementation of computing the coefficients using arbitrary precision floating point numbers (Python's mpmath ). It was extremely slow, taking hours for the computation of a thousand theta values. Anyway, I checked that the current fast computations using Numba give results accurate to better than 100 epsilon, usually down to a few epsilon. The gain in using arbitrary precision math is therefore likely to be small..

@leon-vv
Copy link
Owner Author

leon-vv commented Mar 22, 2023

See also #24

@leon-vv
Copy link
Owner Author

leon-vv commented Mar 27, 2023

Closing for now, as #24 already tracks the implementation of improved axial interpolation of the coefficients, while the 64 bit floating point arithmetic has been shown not to be a great source of error (compared with arbitrary precision floating point math)

@leon-vv leon-vv closed this as completed Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
long term Nice to have but not immediately relevant
Projects
None yet
Development

No branches or pull requests

1 participant