-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
Explicitly integrate variables which appear nowhere else on the rhs #2348
Explicitly integrate variables which appear nowhere else on the rhs #2348
Conversation
…o issue-2240-explicit becasue I forgot to flake8 on the test
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.
Code changes look good, some style comments. Let's see what the tests say. Could maybe do with a couple more tests (e.g. testing the output of an explicit integration - unless that is now done somewhere else by one of the existing tests?)
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, looks good (once tests pass)
Just had a thought, it might be worth special-casing the case where the rhs is |
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.
A few more comments from looking more closely ...
…o issue-2240-explicit style
Codecov ReportBase: 99.65% // Head: 99.66% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #2348 +/- ##
===========================================
+ Coverage 99.65% 99.66% +0.01%
===========================================
Files 361 269 -92
Lines 19948 20190 +242
===========================================
+ Hits 19879 20123 +244
+ Misses 69 67 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
…o issue-2240-explicit style prob
@all-contributors add @abillscmu for code |
@tinosulzer I've put up a pull request to add @abillscmu! 🎉 |
Description
This change moves variables from the model which do not appear on the right hand side to the variables dictionary with a
pybamm.ExplicitTimeIntegral
wrapper. When called by the solution object, thepybamm.ExplicitTimeIntegral
integrates the variable (which can be easily explicitly calculated from the solution object).Variables are only moved if all of the following is true
y_slices
(needed for experiments in the case that the variable is used in one experiment step and not others).len(var.domains)==0
)Issue #2240 provides a brief overview of the impetus for the PR, but the main point is that in the case where the model has a rest step, not doing this results in a singular Jacobian matrix (due to
Discharge capacity [A.h]
, which can cause slowdowns and failures in some solvers.Fixes #2240
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.
Key checklist:
$ flake8
$ python run-tests.py --unit
$ cd docs
and then$ make clean; make html
You can run all three at once, using
$ python run-tests.py --quick
.Further checks: