-
-
Notifications
You must be signed in to change notification settings - Fork 534
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]: the corrector convergence failed repeatedly or with |h| = hmin. #4280
Comments
As far as the message:
This is fairly normal. It is a logging message that comes out of the solver as it is dynamically adjusting the timestep. Is your simulation actually failing or are you just seeing that message in the logs? Generally adjusting the timestep and/or number of grid points in the discretization would be the approach for solving convergence issues. There is some work being done to improve the solver performance at higher C-rates, but these have not been merged yet. Unfortunately, some of the parameter sets struggle at higher C rates, so you might have difficulties with some of the simulations. |
Alright, thank you for your response. Actually, the convergence problem mentioned, if I go to 4C or 5C, repeats recursively until the simulation fails. However, I am currently conducting a study where I need data up to at least 5C from the DFN model for my training system. Again, thank you very much for your attention. If you would like to know more about my modeling project, I would be happy to share it with you. |
@simdieudoboinzemwende we are actively working on improving simulation robustness using the import pybamm
model = pybamm.lithium_ion.DFN()
params = pybamm.ParameterValues('Chen2020')
experiment = pybamm.Experiment([
"Discharge at 1C for 1 hours",
"Rest for 10 minutes",
"Charge at 5C until 4.2V",
"Hold at 4.2V until C/50",
])
sim = pybamm.Simulation(model, parameter_values=params, experiment=experiment)
sol = sim.solve(solver=pybamm.IDAKLUSolver())
sim.plot() |
Thank you for your contributions. |
@simdieudoboinzemwende the changes from @MarcBerliner's work have been merged. If you use the develop branch of PyBaMM, then your simulations would work a bit better. You just need to use the IDAKLU solver. |
Okay, great! PyBaMM has an amazing team. I would be thrilled to join such a team. Thank you.
|
Hello, I followed the steps for installing IDAKLUSOLVER. Since then, I have been trying to update to version 24.9 as you suggested, but I can’t manage to do it. The latest version I can get is 24.5. I am using conda and this is the code I enter: “pip install pybamm --upgrade” |
Hi @simdieudoboinzemwende, PyBaMM version 24.9 is not available yet – you will need to build the IDAKLU solver from source. Here are the instructions for doing so: https://docs.pybamm.org/en/latest/source/user_guide/installation/index.html#full-installation-guide |
@simdieudoboinzemwende PyBaMM has official releases every 4 months or so. 24.5 is the May 2024 release (which was delayed a bit) and 24.9 is the release planned for September 1st 2024. In the meantime, building from source with the development branch as @agriyakhetarpal suggested is the best option. |
PyBaMM Version
24.1
Python Version
3.12.3
Describe the bug
Hello, I am a PhD student working on a hybrid modeling project for lithium-ion batteries, integrating neural networks with the SPM model. I would like to know if anyone here has worked on a similar topic.
I am also encountering some issues with my simulation experiments. Specifically, I am unable to perform high-rate experiments with the DFN model. For example, starting from 3C, I encounter convergence problems. I have tried changing the solver and modifying the hyperparameters, but the error persists.
Steps to Reproduce
model = pybamm.lithium_ion.DFN()
params = pybamm.ParameterValues('Chen2020')
experiment = pybamm.Experiment([
"Discharge at 1C for 1 hours",
"Rest for 10 minutes",
"Charge at 3C until 4.2V",
"Hold at 4.2V until C/50",
])
sim = pybamm.Simulation(model, parameter_values=params, experiment=experiment)
sim.solve(solver=pybamm.CasadiSolver(mode="safe", dt_max=1e-5))
sim.plot()
Relevant log output
The text was updated successfully, but these errors were encountered: