Skip to content

Problem when differentiating FunctionParameter with respect to time #4519

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

You must be logged in to vote

Looks like pybamm can't take the derivative of one of the nodes in the Negative electrode stoichiometry expression:

x-average(0.75 * r-average(Negative particle concentration [mol.m-3]))

The x-average is the problem here, diff doesn't seem to be implemented for any of the averages. The problem doesn't occur if you take the derivative wrt sto_n because pybamm can work that out without taking the derivative of the average (since d sto /d sto = 1)

You could circumvent this if you manually work out the derivative of nu_n and give this to a pybamm.FunctionParameter. Mind you, if the result contains the time derivative of one of the state variables (e.g. concentration) then you might not be ab…

Replies: 1 comment

Comment options

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