-
-
Notifications
You must be signed in to change notification settings - Fork 563
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
Issue 1219 smooth approximations #1223
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1223 +/- ##
===========================================
+ Coverage 97.92% 97.98% +0.05%
===========================================
Files 249 250 +1
Lines 14184 14576 +392
===========================================
+ Hits 13890 14282 +392
Misses 294 294
Continue to review full report at Codecov.
|
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, only two minor comments (the one on the CHANGELOG might not require any action).
CHANGELOG.md
Outdated
- Added parameter set for an A123 LFP cell ([#1209](https://github.com/pybamm-team/PyBaMM/pull/1209)) | ||
- Added variables related to equivalent circuit models ([#1204](https://github.com/pybamm-team/PyBaMM/pull/1204)) | ||
- Added an example script to check conservation of lithium ([#1186](https://github.com/pybamm-team/PyBaMM/pull/1186)) | ||
- Added `erf` and `erfc` functions ([#1184](https://github.com/pybamm-team/PyBaMM/pull/1184)) | ||
|
||
## Optimizations | ||
|
||
- Add (optional) smooth approximations for the `minimum`, `maximum`, `Heaviside`, and `AbsoluteValue` operators ([#1223](https://github.com/pybamm-team/PyBaMM/pull/1223)) |
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.
Very minor thing: should minimum
and maximum
be capitalised or is it because the smooth approximation is for the method but not for the class?
examples/scripts/DFN.py
Outdated
@@ -9,7 +9,7 @@ | |||
|
|||
|
|||
# load model | |||
model = pybamm.lithium_ion.DFN() | |||
model = pybamm.lithium_ion.SPM() |
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.
This should be DFN
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 great, thanks Tino!
Description
Add smooth versions of the heaviside, minimum, and maximum operators, which can all have discontinuous values and/or derivatives. This clearly improves the performance of the solver, when applicable. A new setting
min_max_heaviside_smoothing_parameter
can be set to choose the degree of smoothing (or "exact" for no smoothing).Fixes #1219
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: