Time intervals for reporting data #3911
-
Hi everyone, I am comparing some models in Pybamm to a 3D simulation of a Li-ion cell that I have done. The 3D simulation reports spatial fields of concentration and potential at regular time intervals, say every 60s. However, the cell voltage data is reported at much smaller time intervals, since it doesn't use much memory. First, I am comparing predictions of concentration and potential, so I am passing t_eval to my Pybamm model using the course time interval (every 60s). Then, I want to compare cell voltage predictions, using the finer t interval. Right now, I am just running the Pybamm simulations again with a new t_eval. But of course, this is very inefficient as I have to run the simulations twice. Any ideas on a slicker way to do this? Cheers, Isaac |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
-
Ok great that's just what I was looking for. I'll solve on the fine grid and then interpolate to the courser one. Cheers! |
Beta Was this translation helpful? Give feedback.
solution["Voltage [V]"](t=t_fine_grid)
will interpolate the voltage onto the fine grid. It's only linear interpolation though, so it will just give straight lines between your coarse data points. If you want the finer grid you have to solve with that from the start. You could solve with the finer grid then interpolate your spatial variables onto the coarse grid (solution["Negative particle concentration [mol.m-3]"](t=t_coarse_grid)
)