Skip to content

Fix spline extrapolation - #81

Merged
toastedcrumpets merged 4 commits into
dynamomd:masterfrom
kcooley-cvd:fix-spline-extrapolation
Aug 22, 2026
Merged

Fix spline extrapolation#81
toastedcrumpets merged 4 commits into
dynamomd:masterfrom
kcooley-cvd:fix-spline-extrapolation

Conversation

@kcooley-cvd

@kcooley-cvd kcooley-cvd commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Fixed several mathematical errors related to spline extrapolation:

  • Wrong endpoint value used for low extrapolation with linear splines
  • Incorrect first derivative computations for low and high extrapolations
  • Missing coefficients for quadratic terms in low and high extrapolations

Closes #80

Previously the high BC value was used, which would give incorrect
results unless both BCs had the same value.

See dynamomd#80
The difference formula for the first derivative at the left endpoint
was incorrect. Instead, use the linear coefficient of the spline
polynomial over the first interval, since that is the first derivative
at the low endpoint.

See dynamomd#80
The formula for the first derivative at the high endpoint was incorrect,
having an erroneous factor of 2 on the first term.

See dynamomd#80
Extrapolations using the second derivative were missing coefficients of 0.5,
resulting in incorrect values.

See dynamomd#80
@toastedcrumpets toastedcrumpets self-assigned this Aug 22, 2026
@toastedcrumpets
toastedcrumpets merged commit 613d002 into dynamomd:master Aug 22, 2026
6 of 8 checks passed
@toastedcrumpets

Copy link
Copy Markdown
Collaborator

LGTM, CI fails but its the constant moving target of the wheel building, so I'm happy to merge

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spline extrapolation bugs

2 participants