Skip to content
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

[Bug]: IDAKLU solver fails with CCCV example #2304

Closed
valentinsulzer opened this issue Sep 15, 2022 · 1 comment · Fixed by #2481
Closed

[Bug]: IDAKLU solver fails with CCCV example #2304

valentinsulzer opened this issue Sep 15, 2022 · 1 comment · Fixed by #2481
Assignees
Labels
bug Something isn't working difficulty: medium Will take a few days

Comments

@valentinsulzer
Copy link
Member

PyBaMM Version

develop (22.8)

Python Version

3.9

Describe the bug

Running DFN with CCCV experiment using IDAKLU solver leads to error at the end of the first cycle

Steps to Reproduce

import pybamm
import matplotlib.pyplot as plt

pybamm.set_logging_level("NOTICE")
experiment = pybamm.Experiment(
    [
        (
            "Discharge at C/5 for 10 hours or until 3.3 V",
            "Rest for 1 hour",
            "Charge at 1 A until 4.1 V",
            "Hold at 4.1 V until 10 mA",
            "Rest for 1 hour",
        ),
    ]
    * 3
)
model = pybamm.lithium_ion.DFN()

sim = pybamm.Simulation(model, experiment=experiment, solver=pybamm.IDAKLUSolver())
sim.solve()

Relevant log output

2022-09-15 15:40:34.360 - [NOTICE] callbacks.on_cycle_start(174): Cycle 1/3 (11.704 ms elapsed) --------------------
2022-09-15 15:40:34.360 - [NOTICE] callbacks.on_step_start(182): Cycle 1/3, step 1/5: Discharge at C/5 for 10 hours or until 3.3 V
2022-09-15 15:40:34.632 - [NOTICE] callbacks.on_step_start(182): Cycle 1/3, step 2/5: Rest for 1 hour
2022-09-15 15:40:34.764 - [NOTICE] callbacks.on_step_start(182): Cycle 1/3, step 3/5: Charge at 1 A until 4.1 V
2022-09-15 15:40:34.955 - [NOTICE] callbacks.on_step_start(182): Cycle 1/3, step 4/5: Hold at 4.1 V until 10 mA
2022-09-15 15:40:35.087 - [NOTICE] callbacks.on_step_start(182): Cycle 1/3, step 5/5: Rest for 1 hour

[IDAS ERROR]  IDACalcIC
  The linear solver setup failed unrecoverably.


[IDAS ERROR]  IDASolve
  At t = 1.18566, the linear solver setup failed unrecoverably.

2022-09-15 15:40:35.103 - [ERROR] callbacks.on_experiment_error(226): Simulation error: idaklu solver failed
@valentinsulzer valentinsulzer added the bug Something isn't working label Sep 15, 2022
@martinjrobins
Copy link
Contributor

As discussed today, we think this might be due to IDAKLU failing if multiple different models are passed into the solver solve method. We will:

  1. add an error to the base solver if this is done
  2. refactor Simulation so that it creates multiple solvers for the multiple models in an experiment

@valentinsulzer valentinsulzer added the difficulty: medium Will take a few days label Oct 11, 2022
@martinjrobins martinjrobins self-assigned this Nov 9, 2022
martinjrobins added a commit that referenced this issue Nov 23, 2022
martinjrobins added a commit that referenced this issue Nov 23, 2022
martinjrobins added a commit that referenced this issue Nov 23, 2022
martinjrobins added a commit that referenced this issue Nov 23, 2022
martinjrobins added a commit that referenced this issue Nov 23, 2022
martinjrobins added a commit that referenced this issue Dec 9, 2022
martinjrobins added a commit that referenced this issue Dec 9, 2022
martinjrobins added a commit that referenced this issue Dec 12, 2022
martinjrobins added a commit that referenced this issue Dec 12, 2022
martinjrobins added a commit that referenced this issue Dec 12, 2022
martinjrobins added a commit that referenced this issue Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working difficulty: medium Will take a few days
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants