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

Cubic interpolation #24

Closed
ajwheeler opened this issue Apr 11, 2021 · 2 comments
Closed

Cubic interpolation #24

ajwheeler opened this issue Apr 11, 2021 · 2 comments

Comments

@ajwheeler
Copy link
Owner

ajwheeler commented Apr 11, 2021

We are currently linearly interpolating partition functions and equilibrium constants. I recently went to change this, but quickly realized that Interpolations.jl does not support cubic interpolation over a non-regular grid, even in 1D. At one point there was some effort to fix this, but it seems to have stagnated. I tested CubicSplines.jl and can verify that it works and plugs easily into SSSynth, but it's not a popular package and I worry that it might have undiscovered bugs or go unmaintained. I see a few options:

  • Try to get what we need into Interpolations.jl by doing it ourselves (probably not worth it)
  • Using CubicSplines.jl
  • Writing our own cubic spline into SSSynth. This is probably easier than getting it into interpolations, and it would reduce our dependencies.
  • Wait. Maybe the problem will solve itself? Maybe linear interpolation is fine? I believe the Barklem & Collet data is intended to be interpolated with a cubic spline, but I'm not sure if we need that level of precision.
@ajwheeler ajwheeler mentioned this issue Apr 13, 2021
25 tasks
@ajwheeler
Copy link
Owner Author

ajwheeler commented Jan 6, 2022

Another option: DataInterpolations.jl supports 1D cubic splines, and supports derivatives via ChainRules.jl (it would still be autodiff-able if it didn't but this is faster and more accurate).

edit: Unfortunately, DataInterpolations has very heavy dependencies.

@ajwheeler
Copy link
Owner Author

This is partially addressed by #104 , but only for partition functions and equilibrium constants. (There are now lots of other instances of interpolation in the code.)

A differentiable cubic spline implementation and a 2D implementation would be very useful to have still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant