Issue 1219 smooth approximations#1223
Merged
Merged
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.
|
brosaplanella
requested changes
Nov 4, 2020
brosaplanella
left a comment
Member
There was a problem hiding this comment.
Looks good, only two minor comments (the one on the CHANGELOG might not require any action).
|
|
||
| ## Optimizations | ||
|
|
||
| - Add (optional) smooth approximations for the `minimum`, `maximum`, `Heaviside`, and `AbsoluteValue` operators ([#1223](https://github.com/pybamm-team/PyBaMM/pull/1223)) |
Member
There was a problem hiding this comment.
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?
|
|
||
| # load model | ||
| model = pybamm.lithium_ion.DFN() | ||
| model = pybamm.lithium_ion.SPM() |
brosaplanella
approved these changes
Nov 4, 2020
brosaplanella
left a comment
Member
There was a problem hiding this comment.
Looks great, thanks Tino!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_parametercan 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 docsand then$ make clean; make htmlYou can run all three at once, using
$ python run-tests.py --quick.Further checks: