add perturbation to initial conditions in casadi solver - #2356
Conversation
Codecov ReportBase: 99.66% // Head: 99.66% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #2356 +/- ##
========================================
Coverage 99.66% 99.66%
========================================
Files 269 269
Lines 20190 20201 +11
========================================
+ Hits 20123 20134 +11
Misses 67 67
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. |
| # For some reason this helps with convergence | ||
| # The actual value of the initial conditions for the algebraic variables | ||
| # doesn't matter | ||
| y0_alg = y0_alg * (1 + 1e-6 * casadi.DM(np.random.rand(len_alg))) |
There was a problem hiding this comment.
Do we want to allow users to fiddle with this value or is it very sensitive?
There was a problem hiding this comment.
It's not that sensitive. It's just the first thing I tried and it worked for the specific case I was testing. We can see if other cases come up whether changing that number makes a difference
|
Benchmarks are fine but this makes the tests much slower |
…yBaMM into casadi-solver-perturbation
Description
For some reason this fixed a bug in the casadi solver for one particular case I was looking at. Opening PR to check tests and benchmarks.
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: