-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
Import new OCP curves from test data #3407
Comments
The recommended way of doing this is to return PyBaMM's interpolant object
|
Thanks for answering, it's very helpful!
Thank you! |
they should be separate |
Hello everyone, At the moment, however, I have the problem that the phase transition in the graphite is not as consistent as I would like.
Now I wanted to ask if there is a "best" way to fit a custom OCV while preserving the actifacts and ensuring monotonicity. Thanks for the support. |
The options are:
There are other packages (open-source like pybop or commercial like Ionworks Lab) that can help with parameter fitting |
Thank you very much. |
Hello Valentin, Thank you very much |
Hi, I am introducing ocp curve data for my own batteries with reference to the method in #600, which is:
model = pybamm.lithium_ion.DFN()
param = pybamm.ParameterValues("Chen2020")
data_cathode = pd.read_excel(...)
interpolated_OCP_cathode = interpolate.CubicSpline(
data_cathode.to_numpy()[:, 0],
data_cathode.to_numpy()[:, 1],
extrapolate=True
)
dOCP_cathode = interpolated_OCP_cathode.derivative()
@primitive
def OCP_cathode(sto):
print("Input to OCP_cathode:", sto)
out = interpolated_OCP_cathode(sto)[0]
if np.size(out) == 1:
out = np.array([out])
return out
def OCP_cathode_vjp(ans,sto):
sto_shape = sto.shape
return lambda g: np.full(sto_shape, g) * dOCP_cathode(sto)
defvjp(OCP_cathode, OCP_cathode_vjp)
param.update({
"Positive electrode OCP [V]": OCP_cathode,
})
Unfortunately, a problem has arisen when I try to run the simulation (for example, sim.solve([0,24])). The error is: TypeError: float() argument must be a string or a real number, not 'Scalar'.
The format of imported data looks fine for me:
print(data_cathode)
SOC-dch U-dch
50 0.00 3.52
49 0.02 3.61
48 0.04 3.62
47 0.06 3.63
46 0.08 3.64
45 0.10 3.65
...
5 0.90 4.03
4 0.92 4.1
3 0.94 4.11
2 0.96 4.12
1 0.98 4.13
0 1.00 4.14
Do you perhaps have any ideas? Or should I try another way for updating the OCP data?
Thank you for your support.
The text was updated successfully, but these errors were encountered: