Tip
An interactive online version of this notebook is available, which can be
accessed via
Alternatively, you may download this notebook and run it offline.
Attention
You are viewing this notebook on the latest version of the documentation, where these notebooks may not be compatible with the stable release of PyBaMM since they can contain features that are not yet released. We recommend viewing these notebooks from the stable version of the documentation. To install the latest version of PyBaMM that is compatible with the latest notebooks, build PyBaMM from source.
Plot voltage components#
In a 1D model, the voltage of a cell is given by the difference in solid-phase potentials at the two edges of the domain
We can decompose this voltage into constituent components by adding and subtracting terms and regrouping:
where
and \(\bar{\cdot}\) represents the average value of the variable over its subdomain.
To demonstrate this, we solve a standard DFN model with the Chen2020 parameter set and plot the various potentials
[1]:
%pip install "pybamm[plot,cite]" -q # install PyBaMM if it is not installed
import pybamm
model = pybamm.lithium_ion.DFN()
experiment = pybamm.Experiment(["Discharge at 1C until 2.5 V"])
sim = pybamm.Simulation(
model, experiment=experiment, parameter_values=pybamm.ParameterValues("Chen2020")
)
sol = sim.solve()
sol.plot(
[
"Negative electrode bulk open-circuit potential [V]",
"Positive electrode bulk open-circuit potential [V]",
"Negative particle concentration overpotential [V]",
"Positive particle concentration overpotential [V]",
"X-averaged negative electrode reaction overpotential [V]",
"X-averaged positive electrode reaction overpotential [V]",
"X-averaged concentration overpotential [V]",
"X-averaged electrolyte ohmic losses [V]",
"X-averaged negative electrode ohmic losses [V]",
"X-averaged positive electrode ohmic losses [V]",
],
)
Note: you may need to restart the kernel to use updated packages.
[1]:
<pybamm.plotting.quick_plot.QuickPlot at 0x1339b4620>
A more useful visualization is given by the plot_voltage_components function, which can either plot all the individual voltage components
[2]:
sol.plot_voltage_components(split_by_electrode=True)
[2]:
(<Figure size 800x400 with 1 Axes>, <Axes: xlabel='Time [h]'>)
or group positive and negative together
[3]:
sol.plot_voltage_components()
[3]:
(<Figure size 800x400 with 1 Axes>, <Axes: xlabel='Time [h]'>)
Additionally, for a composite particle model, we can choose which phase to plot the open-circuit potential, concentration and reaction overpotentials for. This is shown in the composite particle notebook.
Note that this function further splits the electrolyte overpotential into the contribution from the electrolyte gradient and the contribution from ohmic losses
References#
The relevant papers for this notebook are:
[4]:
pybamm.print_citations()
[1] Joel A. E. Andersson, Joris Gillis, Greg Horn, James B. Rawlings, and Moritz Diehl. CasADi – A software framework for nonlinear optimization and optimal control. Mathematical Programming Computation, 11(1):1–36, 2019. doi:10.1007/s12532-018-0139-4.
[2] Von DAG Bruggeman. Berechnung verschiedener physikalischer konstanten von heterogenen substanzen. i. dielektrizitätskonstanten und leitfähigkeiten der mischkörper aus isotropen substanzen. Annalen der physik, 416(7):636–664, 1935.
[3] Chang-Hui Chen, Ferran Brosa Planella, Kieran O'Regan, Dominika Gastol, W. Dhammika Widanage, and Emma Kendrick. Development of Experimental Techniques for Parameterization of Multi-scale Lithium-ion Battery Models. Journal of The Electrochemical Society, 167(8):080534, 2020. doi:10.1149/1945-7111/ab9050.
[4] Marc Doyle, Thomas F. Fuller, and John Newman. Modeling of galvanostatic charge and discharge of the lithium/polymer/insertion cell. Journal of the Electrochemical society, 140(6):1526–1533, 1993. doi:10.1149/1.2221597.
[5] Charles R. Harris, K. Jarrod Millman, Stéfan J. van der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J. Smith, and others. Array programming with NumPy. Nature, 585(7825):357–362, 2020. doi:10.1038/s41586-020-2649-2.
[6] Alan C. Hindmarsh. The PVODE and IDA algorithms. Technical Report, Lawrence Livermore National Lab., CA (US), 2000. doi:10.2172/802599.
[7] Alan C. Hindmarsh, Peter N. Brown, Keith E. Grant, Steven L. Lee, Radu Serban, Dan E. Shumaker, and Carol S. Woodward. SUNDIALS: Suite of nonlinear and differential/algebraic equation solvers. ACM Transactions on Mathematical Software (TOMS), 31(3):363–396, 2005. doi:10.1145/1089014.1089020.
[8] Valentin Sulzer, Scott G. Marquis, Robert Timms, Martin Robinson, and S. Jon Chapman. Python Battery Mathematical Modelling (PyBaMM). Journal of Open Research Software, 9(1):14, 2021. doi:10.5334/jors.309.