How to evaluate a variable at a particular position/time #1295
-
Here is a quite common question:
pybamm.dynamic_plot(
simulation,
output_variables =[
"Negative particle surface concentration [mol.m-3]",
],
)
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You can do that using post-processed variables after you have solved your c_n_surf = simulation.solution["Negative particle surface concentration [mol.m-3]"] and you can find all the variables you can call in this notebook. This returns an object c_n_surf(x = 1e-5, t = 100) Because this is a surface concentration, it only depends on |
Beta Was this translation helpful? Give feedback.
You can do that using post-processed variables after you have solved your
simulation
. Then, you can define your post-processed variable asand you can find all the variables you can call in this notebook.
This returns an object
c_n_surf
which is an interpolant. Then, we can call that object and evaluate it at any point by doingBecause this is a surface concentration, it only depends on
x
andt
. If we chose the concentration in the particles it would depend onr
,x
andt
and thus we would have to evaluate it for the three variables. Note that you can pass time as a vector to eva…