-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@ejfdickinson would appreciate your feedback on this |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4893 +/- ##
===========================================
- Coverage 99.12% 99.09% -0.03%
===========================================
Files 305 306 +1
Lines 23604 23659 +55
===========================================
+ Hits 23397 23446 +49
- Misses 207 213 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@rtimms I'll look over it. Relating to #4884 incomplete items currently excluded from the PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to specific comments on the docs, one additional comment:
- Should we use this as an opportunity to move from arbitrary author-name definitions to more descriptive inputs options, e.g.
"Axen"
-> "one-state"
"Wycisk"
-> "one-state differential capacity"
and similarly for module names? Although they may be the original reports, I don't think that "Axen" or "Wycisk" are really that intuitively descriptive for what are actually quite general hysteresis descriptions.
docs/source/examples/notebooks/models/hysteresis-state-models.ipynb
Outdated
Show resolved
Hide resolved
docs/source/examples/notebooks/models/hysteresis-state-models.ipynb
Outdated
Show resolved
Hide resolved
docs/source/examples/notebooks/models/hysteresis-state-models.ipynb
Outdated
Show resolved
Hide resolved
docs/source/examples/notebooks/models/hysteresis-state-models.ipynb
Outdated
Show resolved
Hide resolved
docs/source/examples/notebooks/models/hysteresis-state-models.ipynb
Outdated
Show resolved
Hide resolved
To do: Fix #5038 and
|
src/pybamm/models/submodels/interface/open_circuit_potential/wycisk_ocp.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks fine. Forgive my ignorance, but Wycisk/Axen are specific cases of the "new models" right? In that case, should they be kept as options to make this a non-breaking change? In any case, I don't think they should be both kept as subclasses and deleted as options -- I'd be surprised if there are any users that use submodels directly rather than going through the options, so this effectively just creates non-accessible code.
src/pybamm/models/submodels/interface/open_circuit_potential/single_ocp.py
Show resolved
Hide resolved
...submodels/interface/open_circuit_potential/one_state_differential_capacity_hysteresis_ocp.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, a couple of minor comments for the notebook.
I also prefer the previous names (Axen/Wycisk) over the new names which are a real mouthful, but not a strong opinion
I am looking into the docs failure now, probably something pretty minor |
I pushed a temporary fix for the failing citation so that review could continue, I will push a in a real fix once I get it working again |
Docs are fixed now. I also updated the description to make sure all tickets get closed |
The argument for them is that they at least infer what the model is from the option. I don't think the option names are so much of a mouthful ("one-state hysteresis"), but I agree the classes could be shortened. |
@aabills I removed the factor of 2 so that the model implementation is non-breaking. Passing the old option names now logs a warning and renames them to the new names. "Axen"-->"one-state hysteresis" and "Wycisk"->"one-state differential capacity hysteresis". The models are the same equations, just expressed in a more unified way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description
Fixes #5038
Fixes #5081
Fixes #5021
Unifies the hysteresis models in PyBaMM and adds heat generation due to hysteresis. In particular:
BaseHysteresisOpenCircuitPotential
class that sets variables for the lithiation and delithiation OCP, as well as the average (simply the mean), and the hysteresis voltage (H = U_lith - U_delith
).CurrentSigmoidOpenCircuitPotential
, are expressed in terms of a hysteresis state variable-1<h<1
Q_hys = i_vol * (U - U_eq)
wherei_vol
is the volumetric interfacial current density,U
is the OCP (i.e. includes hysteresis), andU_eq
is the "equilibrium OCP"differential-capacity-hysteresis-state.ipynb
tohysteresis-state-models.ipynb
and extends it to include a comparison of all of the existing hysteresis modelsRelated #4884
What this doesn't do from #4884:
\gamma
in the subclasses. This would be an easy change to make, but I'm not sure it is much harder to just specify the wholerhs
in the base class and it makes the code more readable (even if there is some repetition). The way it currently is, you see the whole ODE in theset_rhs
method and don't need to chase back to the base class. Happy to take input on this.Breaking
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #)
Important checks:
Please confirm the following before marking the PR as ready for review:
nox -s pre-commit
nox -s tests
nox -s doctests