Skip to content

CSpline - Fix segment function and add utils to constrain parameter calculations #3593

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

eslickj
Copy link
Contributor

@eslickj eslickj commented May 3, 2025

Fixes

There was a bug in the segment function in the parameter class. The function is just used for testing and plotting cubic splines, so it is not likely to have affected anything. It's fixed and tests are added that would catch similar future issues.

Summary/Motivation:

This fixes a bug and adds parameter calculation options that allow you to impose certain properties on the cubic spline.

Changes proposed in this PR:

  • Fix bug in segments method in CsplineParameters class (use for plotting and testing)
  • Add option to extend the curve to extrapolate linearly from the endpoints using endpoint slope
  • Add function to add constraints to parameter calculation problem to encourage the cspline to be increasing
  • Add function to add constraints to parameter calculation problem to encourage the cspline to be decreasing
  • Add function to add constraints to parameter calculation problem to require the function to be convex
  • Add function to add constraints to parameter calculation problem to require the function to be concave

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

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

Successfully merging this pull request may close these issues.

1 participant