pybamm-team / liionpack

A battery pack simulation tool that uses the PyBaMM framework
https://liionpack.readthedocs.io/en/latest/
MIT License
83 stars 26 forks source link

Error encountered while using liionpack #258

Closed TomTranter closed 1 year ago

TomTranter commented 1 year ago

Discussed in https://github.com/pybamm-team/liionpack/discussions/257

Originally posted by **xcblovecy** May 18, 2023 The following error occurs when liionpack is used to simulate battery packs: ``` ”RuntimeError: .../casadi/core/slice.cpp:80: Assertion "stop<=len" failed: Slice (start=319, stop=330, step=1) out of bounds with supplied length of 320” ``` Unfortunately, this error occurs in most examples of liionpack. pybamm:23.4.1 liionpack:0.3.5.
TomTranter commented 1 year ago

Need to update liionpack similar to https://github.com/pybamm-team/PyBaMM/pull/2859/files @tinosulzer can you quickly run me through what changed in casadi this afternoon?

TomTranter commented 1 year ago

I think the main issue here is the casadi integrator function used to return the initial condition in the solution and now doesn't. We're manually adding it back in PyBaMM but weren't in liionpack and the shape of the solution in the mapped integrator wasn't as expected so slicing was failing. Long term we want to just handle all solving in PyBaMM and do the circuit setup in liionpack so things like this shouldn't happen in future.