Skip to content

Conversation

@c-randall
Copy link
Collaborator

Description

Rather than averaging charge and discharge curves in voltage space, OCV curves can be constructed by averaging in the derivative dQdV space by aligning peaks. This helps locate states of charge, and reduces accidentally smoothing over derivative features when averaging in the voltage space.

This PR adds a new ocv module that will host functions useful in processing and analyzing data for open-circuit voltages. To start we now have a match_peaks function that takes in low-rate charge and discharge curves and averages them in dQdV space to return an approximate OCV. To support this, a new DqdvSpline class was added to the dqdv module. The spline class helps construct smooth, callable functions for voltage, dqdv, and dvdq. This will also be tied into the DqdvFitter at a later date.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that improves speed/readability/etc.)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • No style issues: $ nox -s linter [-- format]
  • Code is free of misspellings: $ nox -s codespell [-- write]
  • All tests pass: $ nox -s tests
  • Badges are updated: $ nox -s badges

Further checks:

  • The documentation builds: $ nox -s docs.
  • Code is commented, particularly in hard-to-understand areas.
  • Tests are added that prove fix is effective or that feature works.

@c-randall c-randall marked this pull request as ready for review December 11, 2025 17:28
@c-randall c-randall merged commit ae14caf into main Dec 11, 2025
10 checks passed
@c-randall c-randall deleted the feature/ocv branch December 11, 2025 17:31
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.

2 participants