Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speed up electrode SOH calculations #2199

Merged
merged 4 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/source/models/lithium_ion/electrode_soh.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
Electrode SOH models
====================

.. autoclass:: pybamm.lithium_ion.ElectrodeSOHFull
:members:

.. autoclass:: pybamm.lithium_ion.ElectrodeSOHx100
:members:

.. autoclass:: pybamm.lithium_ion.ElectrodeSOHx0
:members:

.. autofunction:: pybamm.lithium_ion.solve_electrode_soh
.. autoclass:: pybamm.lithium_ion.ElectrodeSOHSolver
:members:

.. autoclass:: pybamm.lithium_ion.ElectrodeSOHHalfCell
:members:
Expand Down
40 changes: 19 additions & 21 deletions examples/notebooks/models/electrode-state-of-health.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e6603003e40946d19ea56e47731890c0",
"model_id": "97443d8234c241ca8c2fcaad3e21e416",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -65,7 +65,7 @@
{
"data": {
"text/plain": [
"<pybamm.plotting.quick_plot.QuickPlot at 0x7fab314d7a30>"
"<pybamm.plotting.quick_plot.QuickPlot at 0x7fe0614e9bb0>"
]
},
"execution_count": 2,
Expand Down Expand Up @@ -261,7 +261,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This is implemented in PyBaMM as the `ElectrodeSOHx100` and `ElectrodeSOHx0` models"
"This is implemented in PyBaMM as the `ElectrodeSOHSolver` class"
]
},
{
Expand All @@ -273,24 +273,20 @@
"name": "stdout",
"output_type": "stream",
"text": [
"x_100 : 0.8333742762029195\n",
"y_100 : 0.0335455473745956\n",
"C : 4.968932679279886\n",
"x_0 : 0.0015118456462390934\n",
"y_0 : 0.8908948800898482\n"
"x_100 : 0.8333742762029208\n",
"y_100 : 0.03354554737459422\n",
"C : 4.968932679279893\n",
"x_0 : 0.0015118456462391069\n",
"y_0 : 0.8908948800898481\n"
]
}
],
"source": [
"x100_model = pybamm.lithium_ion.ElectrodeSOHx100()\n",
"C_model = pybamm.lithium_ion.ElectrodeSOHx0()\n",
"\n",
"x100_sim = pybamm.Simulation(x100_model, parameter_values=parameter_values)\n",
"C_sim = pybamm.Simulation(C_model, parameter_values=parameter_values)\n",
"esoh_solver = pybamm.lithium_ion.ElectrodeSOHSolver(parameter_values, param)\n",
"\n",
"inputs={ \"V_min\": Vmin, \"V_max\": Vmax, \"C_n\": Cn, \"C_p\": Cp, \"n_Li\": n_Li}\n",
"\n",
"esoh_sol = pybamm.lithium_ion.solve_electrode_soh(x100_sim, C_sim, inputs)\n",
"esoh_sol = esoh_solver.solve(inputs)\n",
"\n",
"for var in [\"x_100\", \"y_100\", \"C\", \"x_0\", \"y_0\"]:\n",
" print(var, \":\", esoh_sol[var].data[0])"
Expand Down Expand Up @@ -376,13 +372,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[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.\n",
"[2] 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.\n",
"[3] Scott G. Marquis, Valentin Sulzer, Robert Timms, Colin P. Please, and S. Jon Chapman. An asymptotic derivation of a single particle model with electrolyte. Journal of The Electrochemical Society, 166(15):A3693–A3706, 2019. doi:10.1149/2.0341915jes.\n",
"[4] Peyman Mohtat, Suhak Lee, Jason B Siegel, and Anna G Stefanopoulou. Towards better estimability of electrode-specific state of health: decoding the cell expansion. Journal of Power Sources, 427:101–111, 2019.\n",
"[5] Peyman Mohtat, Suhak Lee, Valentin Sulzer, Jason B. Siegel, and Anna G. Stefanopoulou. Differential Expansion and Voltage Model for Li-ion Batteries at Practical Charging Rates. Journal of The Electrochemical Society, 167(11):110561, 2020. doi:10.1149/1945-7111/aba5d1.\n",
"[6] 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.\n",
"[7] Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, and others. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nature Methods, 17(3):261–272, 2020. doi:10.1038/s41592-019-0686-2.\n",
"[1] Weilong Ai, Ludwig Kraft, Johannes Sturm, Andreas Jossen, and Billy Wu. Electrochemical thermal-mechanical modelling of stress inhomogeneity in lithium-ion pouch cells. Journal of The Electrochemical Society, 167(1):013512, 2019. doi:10.1149/2.0122001JES.\n",
"[2] 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.\n",
"[3] Rutooj Deshpande, Mark Verbrugge, Yang-Tse Cheng, John Wang, and Ping Liu. Battery cycle life prediction with coupled chemical degradation and fatigue mechanics. Journal of the Electrochemical Society, 159(10):A1730, 2012. doi:10.1149/2.049210jes.\n",
"[4] 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.\n",
"[5] Scott G. Marquis, Valentin Sulzer, Robert Timms, Colin P. Please, and S. Jon Chapman. An asymptotic derivation of a single particle model with electrolyte. Journal of The Electrochemical Society, 166(15):A3693–A3706, 2019. doi:10.1149/2.0341915jes.\n",
"[6] Peyman Mohtat, Suhak Lee, Jason B Siegel, and Anna G Stefanopoulou. Towards better estimability of electrode-specific state of health: decoding the cell expansion. Journal of Power Sources, 427:101–111, 2019.\n",
"[7] Peyman Mohtat, Suhak Lee, Valentin Sulzer, Jason B. Siegel, and Anna G. Stefanopoulou. Differential Expansion and Voltage Model for Li-ion Batteries at Practical Charging Rates. Journal of The Electrochemical Society, 167(11):110561, 2020. doi:10.1149/1945-7111/aba5d1.\n",
"[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.\n",
"[9] Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, and others. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nature Methods, 17(3):261–272, 2020. doi:10.1038/s41592-019-0686-2.\n",
"\n"
]
}
Expand Down
Loading