Skip to content
Discussion options

You must be logged in to vote

There is no straightforward way to do this, but a hacky way is

import pybamm
import numpy as np

model = pybamm.lithium_ion.DFN(
    {"SEI porosity change": "true", "SEI": "solvent-diffusion limited"}
)
params = pybamm.ParameterValues("Chen2020_plating")

# Discretize the model
sim = pybamm.Simulation(model, parameter_values=params)
sim.build()
# Extract dLdt
L = model.variables["Outer SEI thickness"]
L_disc = sim.built_model.variables["Outer SEI thickness"]
dLdt = sim.built_model.rhs[L]
dLdt.render()

# Build a y to evaluate
y = np.zeros(L_disc.y_slices[0].stop)
y[L_disc.y_slices[0]] = 1
print(dLdt.evaluate(y=y))

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cannotcomplain
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