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]: IDAKLUSolver output variables #4496

Open
rtimms opened this issue Oct 7, 2024 · 5 comments
Open

[Bug]: IDAKLUSolver output variables #4496

rtimms opened this issue Oct 7, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@rtimms
Copy link
Contributor

rtimms commented Oct 7, 2024

PyBaMM Version

24.9

Python Version

3.11

Describe the bug

Running the same experiment but with cycles tagged differently can make the IDAKLUSolver return a solution without all the variables.

@MarcBerliner @martinjrobins

Steps to Reproduce

model = pybamm.lithium_ion.SPM()
parameter_values = pybamm.ParameterValues("Chen2020")
solver = pybamm.IDAKLUSolver()

# works
experiment1 = pybamm.Experiment(
    [
        (
            "Rest for 1 hour",
            "Charge at C/5 until 4.2 V",
            "Hold at 4.2 V until C/20",
        ),
    ]
)
sim1 = pybamm.Simulation(
    model, parameter_values=parameter_values, experiment=experiment1, solver=solver
)
sim1.solve()
sim1.plot()

# fails
experiment2 = pybamm.Experiment(
    [
        ("Rest for 1 hour"),
        (
            "Charge at C/5 until 4.2 V",
            "Hold at 4.2 V until C/20",
        ),
    ]
)
sim2 = pybamm.Simulation(
    model, parameter_values=parameter_values, experiment=experiment2, solver=solver
)
sim2.solve()
sim2.plot()

Relevant log output

KeyError: "Cannot process variable 'Negative particle surface concentration [mol.m-3]' as it was not part of the solve. Please re-run the solve with output_variables set to include this variable."

@rtimms rtimms added the bug Something isn't working label Oct 7, 2024
@kratman
Copy link
Contributor

kratman commented Oct 7, 2024

@rtimms This one is a known issue: #4386

@rtimms
Copy link
Contributor Author

rtimms commented Oct 7, 2024

But here I am not using output_variables, so I think this is slightly different to #4386

@kratman
Copy link
Contributor

kratman commented Oct 7, 2024

Hopefully it is fixed along with the other issue. I think @pipliggins was working on it

@MarcBerliner
Copy link
Member

@kratman I believe this is unrelated to #4386

@rtimms this is a bug, but I think we're seeing strange behavior here because the cell is at 100% SOC, and you're charging it in the second step, which instantaneously violates the voltage limit. I can look into this if it's blocking

@rtimms
Copy link
Contributor Author

rtimms commented Oct 7, 2024

Yeah, not a huge blocker. I also think that is what is happening, but it is handled more nicely by the other solvers. Just a random edge case I came across.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants