Skip to content

discretisation of SPMe model fails with parameter replacement #4508

Answered by rtimms
martinjrobins asked this question in Q&A
Discussion options

You must be logged in to vote

Judging by the off-by-two shape error you'll also need to update the boundary conditions (the SPMe solves for the product of the porosity and the concentration).

Not sure what your workflow looks like, but ParameterValues can be symbols, so you can do something like

import pybamm

parameter_values = pybamm.ParameterValues("Chen2020")
parameter_values.update(
    {
        "Positive electrode porosity": 1
        - pybamm.Parameter("Positive electrode active material volume fraction")
    }
)

model = pybamm.lithium_ion.SPMe()

sim = pybamm.Simulation(model, parameter_values=parameter_values)

sim.solve([0, 3600])
sim.plot()

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@martinjrobins
Comment options

martinjrobins Oct 14, 2024
Maintainer Author

Answer selected by martinjrobins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants