You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I frequently encounter errors similar to those listed below when running my code, even after trying the suggestions from issue #1493 and adjusting some parameters.
These adjustments initially allowed the code to run smoothly on PyBaMM version 23.5 and CasADi version 3.6.3 without errors. However, after changing certain parameter values, I face consistent errors irrespective of the PyBaMM or CasADi version I use.
Here is a minimum working example that illustrates the issue:
import pybamm
model = pybamm.lithium_ion.DFN({"lithium plating": "partially reversible"})
param = pybamm.ParameterValues("OKane2022")
pybamm.set_logging_level("NOTICE")
cycle_number = 1000
degradation_experiments = [
"Discharge at 1C until 2.5V",
"Charge at 0.3C until 4.2V",
"Hold at 4.2V until C/100",
] * cycle_number
param.update({"Ambient temperature [K]": 278.15})
solutions_degradation = {}
param.update({"Lithium plating kinetic rate constant [m.s-1]": 1E-8})
param.update({"Dead lithium decay constant [s-1]": 4E-7})
degradation_experiment = pybamm.Experiment(degradation_experiments)
sim_degradation = pybamm.Simulation(model, parameter_values=param, experiment=degradation_experiment)
safe_solver = pybamm.CasadiSolver(mode="safe")
sol_degradation = sim_degradation.solve(solver=safe_solver)
Errors with PyBaMM (24.1) and CasADi (3.6.5):
Using safe_solver = pybamm.CasadiSolver(mode="safe"), the code stops at cycle 1441/3000 with the following errors:
2024-04-24 17:49:00.747 - [NOTICE] callbacks.on_step_start(180): Cycle 1441/3000, step 1/1: Discharge at 1C until 2.5V
At t = 267.014 and h = 3.90134e-11, the corrector convergence failed repeatedly or with |h| = hmin.
At t = 45.806 and h = 1.58123e-09, the corrector convergence failed repeatedly or with |h| = hmin.
2024-04-24 17:49:01.790 - [ERROR] callbacks.on_experiment_error(224): Simulation error: Error in Function::call for 'F' [IdasInterface] at .../casadi/core/function.cpp:1432:
Error in Function::call for 'F' [IdasInterface] at .../casadi/core/function.cpp:361:
.../casadi/interfaces/sundials/idas_interface.cpp:596: IDASolve returned "IDA_CONV_FAIL". Consult IDAS documentation.
2024-04-24 17:49:01.934 - [NOTICE] callbacks.on_experiment_end(220): Finish experiment simulation, took 20 minutes, 53 seconds
Errors with PyBaMM (23.5) and CasADi (3.6.3):
The situation remains similar with safe_solver = pybamm.CasadiSolver(mode="safe"), where the code stops at cycle 910/3000 with errors like:
2024-04-24 18:29:54.019 - [NOTICE] callbacks.on_step_start(180): Cycle 910/3000, step 1/1: Discharge at 1C until 2.5V
At t = 285.773 and h = 3.43867e-11, the corrector convergence failed repeatedly or with |h| = hmin.
At t = 51.4407 and h = 4.71913e-10, the corrector convergence failed repeatedly or with |h| = hmin.
2024-04-24 18:29:55.091 - [ERROR] callbacks.on_experiment_error(224): Simulation error: Error in Function::call for 'F' [IdasInterface] at .../casadi/core/function.cpp:1401:
Error in Function::call for 'F' [IdasInterface] at .../casadi/core/function.cpp:330:
.../casadi/interfaces/sundials/idas_interface.cpp:596: IDASolve returned "IDA_CONV_FAIL". Consult IDAS documentation.
2024-04-24 18:29:55.201 - [NOTICE] callbacks.on_experiment_end(220): Finish experiment simulation, took 18 minutes, 2 seconds
I've also tried changing the CasadiSolver's mode to "fast" and using settings like dt_max=120 or rtol=1e-9, atol=1e-9 in safe_solver = pybamm.CasadiSolver(), but these adjustments did not significantly alter the outcome; the code still stops around the same cycle.
Does anyone know what might be causing this issue? Thank you in advance for your help!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hallo everyone,
I frequently encounter errors similar to those listed below when running my code, even after trying the suggestions from issue #1493 and adjusting some parameters.
These adjustments initially allowed the code to run smoothly on PyBaMM version 23.5 and CasADi version 3.6.3 without errors. However, after changing certain parameter values, I face consistent errors irrespective of the PyBaMM or CasADi version I use.
Here is a minimum working example that illustrates the issue:
Errors with PyBaMM (24.1) and CasADi (3.6.5):
Using safe_solver = pybamm.CasadiSolver(mode="safe"), the code stops at cycle 1441/3000 with the following errors:
Errors with PyBaMM (23.5) and CasADi (3.6.3):
The situation remains similar with safe_solver = pybamm.CasadiSolver(mode="safe"), where the code stops at cycle 910/3000 with errors like:
I've also tried changing the CasadiSolver's mode to "fast" and using settings like dt_max=120 or rtol=1e-9, atol=1e-9 in safe_solver = pybamm.CasadiSolver(), but these adjustments did not significantly alter the outcome; the code still stops around the same cycle.
Does anyone know what might be causing this issue? Thank you in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions