-
-
Notifications
You must be signed in to change notification settings - Fork 549
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 incompatible with OKane2022 NE OCP Interpolation #4524
Comments
@tomjholland just double-checking – are you on PyBaMM v24.9 or develop? As a temporary workaround, you can change the OCP interpolant to cc @kratman |
For Linux and Mac this fix from #4487 can resolve this issue. The change is needed inside pybamm's main
This does not work on Windows yet, I am working on improving the Windows build to make it work there as well. @tomjholland For tracking issues:
|
I can reproduce this on MacOS with PyBaMM 24.9 on MacOS |
@tomjholland This works on my Mac as a workaround: import pybamm
# Fix Casadi import
import os
import sysconfig
os.environ["CASADIPATH"] = os.path.join(sysconfig.get_path('purelib'), 'casadi')
exp = pybamm.Experiment([ "Discharge at 1C until 2.5 V"])
model = pybamm.lithium_ion.DFN()
params = pybamm.ParameterValues("OKane2022")
solver = pybamm.IDAKLUSolver()
sim = pybamm.Simulation(model, experiment=exp, parameter_values=params, solver=solver)
sim.solve() |
Hi @kratman, thanks for the quick response on this. Sorry, I forgot to add this detail to the issue. I get this error from 24.9 installed from pip on MacOS and Linux. I can confirm that your workaround also works for me on my Mac. Thanks for the help! |
Partial fix was added to develop, it will be in the next release (hopefully in the next week or two) |
PyBaMM Version
24.9
Python Version
3.11
Describe the bug
Casadi error is returned when using the IDAKLU solver with the
OKane2022
parameter set. Appears to be related to the interpolation of the negative electrode OCP, as it is searching forlibcasadi_interpolatnt_bspline.dylib
and setting the OCP to the functional form inChen2020
eliminates the error.This is a separate issue, but I will tag #4365 as another issue caused by the interpolation of discrete points of NE OCP in this parameter set.
Steps to Reproduce
Produces the Runtime error:
This can be overcome by changing the OCP function of the parameter set:
Relevant log output
No response
The text was updated successfully, but these errors were encountered: