Open tomjholland opened 2 months ago
can you try using a linear interpolant rather than a cubic one? something like
parameter_values = pybamm.ParameterValues("Okane2022")
path = # path to where the csv is stored
graphite_LGM50_ocp_Chen2020_data = pybamm.parameters.process_1D_data(
"graphite_LGM50_ocp_Chen2020.csv", path=path
)
def graphite_LGM50_ocp_Chen2020(sto):
name, (x, y) = graphite_LGM50_ocp_Chen2020_data
return pybamm.Interpolant(x, y, sto, name=name, interpolator="linear")
parameter_values["Negative electrode OCP [V]"] = graphite_LGM50_ocp_Chen2020
I think all the data interpolant OCPs should be linear, but it looks like they aren't...
can you try using a linear interpolant rather than a cubic one?
I tried this yesterday, still has the noise with linear interpolation. I also checked and several other parameter sets use cubic interpolation:
I put a couple of my experiments below.
can you try using a linear interpolant rather than a cubic one? something like
parameter_values = pybamm.ParameterValues("Okane2022") path = # path to where the csv is stored graphite_LGM50_ocp_Chen2020_data = pybamm.parameters.process_1D_data( "graphite_LGM50_ocp_Chen2020.csv", path=path ) def graphite_LGM50_ocp_Chen2020(sto): name, (x, y) = graphite_LGM50_ocp_Chen2020_data return pybamm.Interpolant(x, y, sto, name=name, interpolator="linear") parameter_values["Negative electrode OCP [V]"] = graphite_LGM50_ocp_Chen2020
I think all the data interpolant OCPs should be linear, but it looks like they aren't...
Yes so the results may be dependent on the interpolator (thanks @kratman for looking into this), my question I think is more fundamental. To my understanding:
"OKane2022"
parameter set is based on the "Chen2020"
parameters for the LG M50 cell"Chen2020"
parameter set uses fitted functions for both positive and negative OCPs, as defined in their paper"OKane2022"
also uses a fitted function for the positive OCP"OKane2022"
uses interpolation for the negative OCPI raised this issue to suggest that the "OKane2022"
is brought in line with "Chen2020"
parameter set to use the fitted function form for consistency, although I realise that this is not a general solution for the other parameter sets that just use interpolation.
Yeah I used the Ai2020 data to show that something was specifically an issue with the data set used by OKane2022. It could be as simple as not having enough resolution to make the function smooth
@DrSOKane Can you take a look at this?
PyBaMM Version
24.5
Python Version
3.11.7
Describe the bug
Differentiating low c-rate constant-current results reveals noise in calculated voltage when using
"OKane2022"
parameter set, but not when using"Chen2020"
parameter set:This is due to the csv interpolation used for the graphite OCP in the
"OKane2022"
parameter set. The suggested fix would be to replace this with the functional form defined in"Chen2020"
, as the OCP curves for these parameter sets should be identical anyway.Steps to Reproduce
The following code uses the Chen2020 parameters, OKane2022 parameters and finally the OKane2022 parameters with the graphite OCP parameter replaced with the value in the Chen2020 parameter set:
Relevant log output