Skip to content

Issue 4884 unify hysteresis #4893

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 33 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6279bcc
#4884 use hysteresis state for all models
rtimms Mar 3, 2025
66474e8
#4884 base single state hysteresis class
rtimms Mar 3, 2025
8e4bc2c
#4884 allow hysteresis decay rate to depend on sto and T
rtimms Mar 3, 2025
39258dc
#4884 add thermal model and update notebook
rtimms Mar 4, 2025
59a4399
Merge branch 'develop' into issue-4884-unify-hysteresis
rtimms Mar 5, 2025
81f1058
style: pre-commit fixes
pre-commit-ci[bot] Mar 5, 2025
79a0673
#4884 merge develop
rtimms Jun 10, 2025
07d7fb9
style: pre-commit fixes
pre-commit-ci[bot] Jun 10, 2025
80de5c4
Merge branch 'develop' into issue-4884-unify-hysteresis
rtimms Jun 22, 2025
969868d
style: pre-commit fixes
pre-commit-ci[bot] Jun 22, 2025
e3a1082
#4884 update docs
rtimms Jun 22, 2025
fef8688
#4884 fix x-average issue
rtimms Jun 23, 2025
0e1fcca
#5038 fix dUdQ bug
rtimms Jun 26, 2025
89c742c
#4884 fix domain bug
rtimms Jun 26, 2025
ce48144
#4884 thermal U_eq
rtimms Jun 26, 2025
437ced7
#4884 av U_eq to Chen2020_composite
rtimms Jun 26, 2025
871c968
#4884 fix docs
rtimms Jun 26, 2025
288995b
Fixing docs errors
kratman Jun 26, 2025
07b3586
Merge branch 'develop' into issue-4884-unify-hysteresis
rtimms Jun 26, 2025
fa5dc24
#4884 fix factor of 2
rtimms Jun 27, 2025
a27fffa
#4884 merge|
rtimms Jun 27, 2025
24bb743
#4884 rename options
rtimms Jun 27, 2025
c02f9fe
style: pre-commit fixes
pre-commit-ci[bot] Jun 27, 2025
c641f6f
#4884 reapply doc fix
rtimms Jun 27, 2025
7bfc1cb
Merge branch 'develop' into issue-4884-unify-hysteresis
kratman Jul 2, 2025
953dad3
Merge branch 'develop' of github.com:pybamm-team/PyBaMM into issue-48…
kratman Jul 2, 2025
494ef22
Fix makefile
kratman Jul 2, 2025
e36247b
Latex fixes
kratman Jul 2, 2025
4d716d7
Real fix for latex
kratman Jul 2, 2025
9b2d566
#4884 update notebook
rtimms Jul 4, 2025
2b1fcf2
#4884 make non-breaking
rtimms Jul 7, 2025
2f33667
Merge branch 'develop' into issue-4884-unify-hysteresis
rtimms Jul 7, 2025
5ca727a
#4884 hysteresis heating citation
rtimms Jul 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
- Added a `Constant` symbol for named constants. This is a subclass of `Scalar` and is used to represent named constants such as the gas constant. This avoids constants being simplified out when constructing expressions. ([#5070](https://github.com/pybamm-team/PyBaMM/pull/5070))
- Generalise `pybamm.DiscreteTimeSum` to allow it to be embedded in other expressions ([#5044](https://github.com/pybamm-team/PyBaMM/pull/5044))
- Adds `all` key-value pair to `output_variables` sensitivity dictionaries, accessible through `solution[var].sensitivities['all']`. Aligns shape with conventional solution sensitivities object. ([#5067](https://github.com/pybamm-team/PyBaMM/pull/5067))
- Added a new `BaseHysteresisOpenCircuitPotential` class that sets variables for the lithiation and delithiation OCP and the hysteresis voltage (`H = U_lith - U_delith`). Allow the initial hysteresis state to be a function of position through the electrode. Allow the hysteresis decay rates of the Axen and Wycisk models to be a function of stoichiometry and temperature. Added a heat source term in each active material phase `Q_hys = i_vol * (U - U_eq)` where `i_vol` is the volumetric interfacial current density, `U` is the OCP (i.e. includes hysteresis), and `U_eq` is the "equilibrium OCP". Renamed the open-circuit potential models to be more descriptive. The options "Axen" and "Wycisk" are now "one-state hysteresis" and "one-state differential capacity hysteresis". The old option names still work but will raise a warning. ([#4893](https://github.com/pybamm-team/PyBaMM/pull/4893))
- Add support for `output_variables` to `pybamm.DiscreteTimeSum` and `pybamm.ExplicitTimeIntegral` expressions. ([#5071](https://github.com/pybamm-team/PyBaMM/pull/5071))

## Bug fixes

- Fixed a bug that ignored the default duration of drive cycles for `CRate` steps and a bug that overwrote custom `period` arguments for drive cycles. ([#5090](https://github.com/pybamm-team/PyBaMM/pull/5090))
- Converts sensitivities to numpy objects, fixing bug in `DiscreteTimeSum` sensitivity calculation ([#5037](https://github.com/pybamm-team/PyBaMM/pull/5037))
- Raises error if `pybamm.Interpolant` given 1D x values that are not strictly increasing ([#5061](https://github.com/pybamm-team/PyBaMM/pull/5061))
- Fixed a bug where simplifications cause heavisides to evaluate as booleans ([#4893](https://github.com/pybamm-team/PyBaMM/pull/4893))
- Fixed a bug in the `WyciskOpenCircuitPotential` model where the differential capacity was not being evaluated correctly. ([#4893](https://github.com/pybamm-team/PyBaMM/pull/4893))

## Breaking changes

- Removed the IREE code from the IDAKLU solver ([#5080](https://github.com/pybamm-team/PyBaMM/pull/5080))
- Removed support for Python 3.9 ([#5052](https://github.com/pybamm-team/PyBaMM/pull/5052))
- In OCP hysteresis models, users need to explicitly give the equilibrium, delithiation, and lithiation OCPs when using a hysteresis model. E.g., you must provide all three of "Negative electrode OCP [V]", "Negative electrode delithiation OCP [V]", and "Negative electrode lithiation OCP [V]". ([#4893](https://github.com/pybamm-team/PyBaMM/pull/4893))


# [v25.6.0](https://github.com/pybamm-team/PyBaMM/tree/v25.6.0) - 2025-05-27

Expand Down
9 changes: 5 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS = -j auto
SPHINXBUILD = sphinx-build
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

Expand All @@ -16,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ Base Open Circuit Potential

.. autoclass:: pybamm.open_circuit_potential.BaseOpenCircuitPotential
:members:

.. autoclass:: pybamm.open_circuit_potential.BaseHysteresisOpenCircuitPotential
:members:
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Open-circuit potential models
.. toctree::

base_ocp
current_sigmoid_ocp
single_ocp
msmr_ocp
wycisk_ocp
axen_ocp
one_state_hysteresis_ocp
one_state_differential_capacity_hysteresis_ocp
current_sigmoid_ocp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
One State Differential Capacity Hysteresis Open Circuit Potential
=================================================================

.. autoclass:: pybamm.open_circuit_potential.OneStateDifferentialCapacityHysteresisOpenCircuitPotential
:members:

.. footbibliography::
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
One-state hysteresis open-circuit potential
===========================================

.. autoclass:: pybamm.open_circuit_potential.OneStateHysteresisOpenCircuitPotential
:members:

.. footbibliography::

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ The notebooks are organised into subfolders, and can be viewed in the galleries
notebooks/models/compare-particle-diffusion-models.ipynb
notebooks/models/composite_particle.ipynb
notebooks/models/coupled-degradation.ipynb
notebooks/models/differential-capacity-hysteresis-state.ipynb
notebooks/models/DFN-with-particle-size-distributions.ipynb
notebooks/models/DFN.ipynb
notebooks/models/electrode-state-of-health.ipynb
notebooks/models/graded-electrodes.ipynb
notebooks/models/half-cell.ipynb
notebooks/models/hysteresis-state-models.ipynb
notebooks/models/jelly-roll-model.ipynb
notebooks/models/latexify.ipynb
notebooks/models/lead-acid.ipynb
Expand Down
335 changes: 34 additions & 301 deletions docs/source/examples/notebooks/models/composite_particle.ipynb

Large diffs are not rendered by default.

This file was deleted.

Loading