2D interpolation does not work #3738
Unanswered
WoohyunJeong95
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to use dataset for electrolyte diffusivity instead of fitted equation. Electrolyte diffusivity is a function of c_e (electrolyte concentration) and T (temperature), so 2d interpolation is needed. I used attached data with code below but it did not work and gave me an value error. Is there any example code for 2d interpolation for parameter? (I found similar discussion #3326, but it does not have helpful answer). Any comment will be appreciated.
electrolyte_diffusivity_test.csv
Test data is generated from Marquis2019 parameter.
Steps to reproduce:
import pybamm
import numpy as np
DFN = pybamm.lithium_ion.DFN()
processed = pybamm.parameters.process_2D_data_csv("electrolyte_diffusivity_test.csv")
def Electrolyte_diffusivity(c_e,T):
name, (xs,y) = processed
return pybamm.Interpolant(xs,y,[c_e,T],name=name)
param = pybamm.ParameterValues("Marquis2019")
param.update({'Electrolyte diffusivity [m2.s-1]':Electrolyte_diffusivity})
sim = pybamm.Simulation(DFN, parameter_values=param)
t_eval = np.arange(0, 3600, 1)
sim.solve(t_eval=t_eval)
sim.plot()
Beta Was this translation helpful? Give feedback.
All reactions