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
Passing an initial concentration function which makes use of r or x fails for DFN models. The same function runs without error for other models such as BasicDFN.
Steps to Reproduce
import pybamm
# x-dependent initial concentration
def initial_concentration(r, x):
return 17038.0 + r + x
parameter_values = pybamm.ParameterValues("Chen2020")
parameter_values.update(
{
"Initial concentration in negative electrode [mol.m-3]": initial_concentration,
}
)
model = pybamm.lithium_ion.DFN()
experiment = pybamm.Experiment(["Rest for 1 sec"])
sim = pybamm.Simulation(
model,
experiment=experiment,
parameter_values=parameter_values,
)
solution = sim.solve()
Relevant log output
NotImplementedError: method self.evaluate() not implemented for symbol r_n of type<class 'pybamm.expression_tree.independent_variable.SpatialVariable'
The text was updated successfully, but these errors were encountered:
PyBaMM Version
25.1.1
Python Version
3.12.4
Describe the bug
Passing an initial concentration function which makes use of
r
orx
fails for DFN models. The same function runs without error for other models such as BasicDFN.Steps to Reproduce
Relevant log output
The text was updated successfully, but these errors were encountered: