Tip

An interactive online version of this notebook is available, which can be accessed via Open this notebook in Google Colab


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.

A look at solution data and processed variables#

Once you have run a simulation the first thing you want to do is have a look at the data. Most of the examples so far have made use of PyBaMM’s handy QuickPlot function but there are other ways to access the data and this notebook will explore them. First off we will generate a standard SPMe model and use QuickPlot to view the default variables.

[2]:
%pip install "pybamm[plot,cite]" -q    # install PyBaMM if it is not installed
import os

import matplotlib.pyplot as plt
import numpy as np

import pybamm

os.chdir(pybamm.__path__[0] + "/..")

# load model
model = pybamm.lithium_ion.SPMe()

# set up and solve simulation
simulation = pybamm.Simulation(model)
t = [0, 3600]
solution = simulation.solve(t)

quick_plot = pybamm.QuickPlot(solution)
quick_plot.dynamic_plot();
Note: you may need to restart the kernel to use updated packages.

Behind the scenes the QuickPlot classed has created some processed variables which can interpolate the model variables for our solution and has also stored the results for the solution steps

[3]:
solution.data.keys()
[3]:
dict_keys(['Negative particle surface concentration [mol.m-3]', 'Electrolyte concentration [mol.m-3]', 'Positive particle surface concentration [mol.m-3]', 'Current [A]', 'Negative electrode potential [V]', 'Electrolyte potential [V]', 'Positive electrode potential [V]', 'Voltage [V]'])
[4]:
solution.data["Negative particle surface concentration [mol.m-3]"].shape
[4]:
(20, 59)
[5]:
solution.t.shape
[5]:
(59,)

Notice that the dictionary keys are in the same order as the subplots in the QuickPlot figure. We can add new processed variables to the solution by simply using it like a dictionary. First let’s find a few more variables to look at. As you will see there are quite a few:

[6]:
keys = list(model.variables.keys())
keys.sort()
print(keys)
['Ambient temperature [C]', 'Ambient temperature [K]', 'Average negative particle concentration', 'Average negative particle concentration [mol.m-3]', 'Average negative particle stoichiometry', 'Average positive particle concentration', 'Average positive particle concentration [mol.m-3]', 'Average positive particle stoichiometry', 'Battery negative electrode bulk open-circuit potential [V]', 'Battery negative particle concentration overpotential [V]', 'Battery open-circuit voltage [V]', 'Battery particle concentration overpotential [V]', 'Battery positive electrode bulk open-circuit potential [V]', 'Battery positive particle concentration overpotential [V]', 'Battery voltage [V]', 'Bulk open-circuit voltage [V]', 'C-rate', 'Cell temperature [C]', 'Cell temperature [K]', 'Contact overpotential [V]', 'Current [A]', 'Current collector current density [A.m-2]', 'Current variable [A]', 'Discharge capacity [A.h]', 'Discharge energy [W.h]', 'Electrode current density [A.m-2]', 'Electrode transport efficiency', 'Electrolyte concentration [Molar]', 'Electrolyte concentration [mol.m-3]', 'Electrolyte concentration concatenation [mol.m-3]', 'Electrolyte convection flux [mol.m-2.s-1]', 'Electrolyte current density [A.m-2]', 'Electrolyte diffusion flux [mol.m-2.s-1]', 'Electrolyte flux [mol.m-2.s-1]', 'Electrolyte migration flux [mol.m-2.s-1]', 'Electrolyte potential [V]', 'Electrolyte transport efficiency', 'Environment total cooling [W]', 'Exchange current density [A.m-2]', 'Gradient of electrolyte potential [V.m-1]', 'Gradient of negative electrode potential [V.m-1]', 'Gradient of negative electrolyte potential [V.m-1]', 'Gradient of positive electrode potential [V.m-1]', 'Gradient of positive electrolyte potential [V.m-1]', 'Gradient of separator electrolyte potential [V.m-1]', 'Interfacial current density [A.m-2]', 'Irreversible electrochemical heating [W.m-3]', 'Irreversible electrochemical heating [W]', 'Irreversible electrochemical heating per unit electrode-pair area [W.m-2]', 'LAM_ne [%]', 'LAM_pe [%]', 'LLI [%]', 'Local ECM resistance [Ohm]', 'Local voltage [V]', 'Loss of active material in negative electrode [%]', 'Loss of active material in positive electrode [%]', 'Loss of capacity to negative SEI [A.h]', 'Loss of capacity to negative SEI on cracks [A.h]', 'Loss of capacity to negative lithium plating [A.h]', 'Loss of capacity to positive SEI [A.h]', 'Loss of capacity to positive SEI on cracks [A.h]', 'Loss of capacity to positive lithium plating [A.h]', 'Loss of lithium due to loss of active material in negative electrode [mol]', 'Loss of lithium due to loss of active material in positive electrode [mol]', 'Loss of lithium inventory [%]', 'Loss of lithium inventory, including electrolyte [%]', 'Loss of lithium to negative SEI [mol]', 'Loss of lithium to negative SEI on cracks [mol]', 'Loss of lithium to negative lithium plating [mol]', 'Loss of lithium to positive SEI [mol]', 'Loss of lithium to positive SEI on cracks [mol]', 'Loss of lithium to positive lithium plating [mol]', 'Maximum negative particle concentration', 'Maximum negative particle concentration [mol.m-3]', 'Maximum negative particle stoichiometry', 'Maximum negative particle surface concentration', 'Maximum negative particle surface concentration [mol.m-3]', 'Maximum negative particle surface stoichiometry', 'Maximum positive particle concentration', 'Maximum positive particle concentration [mol.m-3]', 'Maximum positive particle stoichiometry', 'Maximum positive particle surface concentration', 'Maximum positive particle surface concentration [mol.m-3]', 'Maximum positive particle surface stoichiometry', 'Minimum negative particle Minimum negative particle surface concentration [mol.m-3]', 'Minimum negative particle concentration', 'Minimum negative particle concentration [mol.m-3]', 'Minimum negative particle stoichiometry', 'Minimum negative particle surface concentration', 'Minimum negative particle surface stoichiometry', 'Minimum positive particle Minimum positive particle surface concentration [mol.m-3]', 'Minimum positive particle concentration', 'Minimum positive particle concentration [mol.m-3]', 'Minimum positive particle stoichiometry', 'Minimum positive particle surface concentration', 'Minimum positive particle surface stoichiometry', 'Negative SEI concentration [mol.m-3]', 'Negative SEI on cracks concentration [mol.m-3]', 'Negative SEI on cracks thickness [m]', 'Negative SEI thickness [m]', 'Negative crack surface to volume ratio [m-1]', 'Negative current collector Ohmic heating [W.m-3]', 'Negative current collector potential [V]', 'Negative current collector temperature [C]', 'Negative current collector temperature [K]', 'Negative dead lithium concentration [mol.m-3]', 'Negative dead lithium thickness [m]', 'Negative electrode SEI film overpotential [V]', 'Negative electrode SEI interfacial current density [A.m-2]', 'Negative electrode SEI on cracks interfacial current density [A.m-2]', 'Negative electrode SEI on cracks volumetric interfacial current density [A.m-3]', 'Negative electrode SEI volumetric interfacial current density [A.m-3]', 'Negative electrode active material volume fraction', 'Negative electrode active material volume fraction change [s-1]', 'Negative electrode bulk open-circuit potential [V]', 'Negative electrode capacity [A.h]', 'Negative electrode current density [A.m-2]', 'Negative electrode entropic change [V.K-1]', 'Negative electrode equilibrium open-circuit potential [V]', 'Negative electrode exchange current density [A.m-2]', 'Negative electrode extent of lithiation', 'Negative electrode interface utilisation', 'Negative electrode interface utilisation variable', 'Negative electrode interfacial current density [A.m-2]', 'Negative electrode lithium plating interfacial current density [A.m-2]', 'Negative electrode lithium plating reaction overpotential [V]', 'Negative electrode lithium plating volumetric interfacial current density [A.m-3]', 'Negative electrode ohmic losses [V]', 'Negative electrode open-circuit potential [V]', 'Negative electrode porosity', 'Negative electrode porosity change [s-1]', 'Negative electrode porosity times concentration [mol.m-3]', 'Negative electrode potential [V]', 'Negative electrode pressure [Pa]', 'Negative electrode reaction overpotential [V]', 'Negative electrode roughness ratio', 'Negative electrode stoichiometry', 'Negative electrode surface area to volume ratio [m-1]', 'Negative electrode surface potential difference [V]', 'Negative electrode surface potential difference at separator interface [V]', 'Negative electrode temperature [C]', 'Negative electrode temperature [K]', 'Negative electrode transport efficiency', 'Negative electrode volume-averaged acceleration [m.s-2]', 'Negative electrode volume-averaged concentration', 'Negative electrode volume-averaged concentration [mol.m-3]', 'Negative electrode volume-averaged velocity [m.s-1]', 'Negative electrode volumetric interfacial current density [A.m-3]', 'Negative electrolyte concentration [Molar]', 'Negative electrolyte concentration [mol.m-3]', 'Negative electrolyte current density [A.m-2]', 'Negative electrolyte potential [V]', 'Negative electrolyte transport efficiency', 'Negative lithium plating concentration [mol.m-3]', 'Negative lithium plating thickness [m]', 'Negative particle bc [mol.m-4]', 'Negative particle concentration', 'Negative particle concentration [mol.m-3]', 'Negative particle concentration overpotential [V]', 'Negative particle crack length [m]', 'Negative particle cracking rate [m.s-1]', 'Negative particle effective diffusivity [m2.s-1]', 'Negative particle flux [mol.m-2.s-1]', 'Negative particle radius', 'Negative particle radius [m]', 'Negative particle rhs [mol.m-3.s-1]', 'Negative particle stoichiometry', 'Negative particle surface concentration', 'Negative particle surface concentration [mol.m-3]', 'Negative particle surface stoichiometry', 'Ohmic heating [W.m-3]', 'Ohmic heating [W]', 'Ohmic heating per unit electrode-pair area [W.m-2]', 'Particle concentration overpotential [V]', 'Porosity', 'Porosity change', 'Porosity times concentration [mol.m-3]', 'Positive SEI concentration [mol.m-3]', 'Positive SEI on cracks concentration [mol.m-3]', 'Positive SEI on cracks thickness [m]', 'Positive SEI thickness [m]', 'Positive crack surface to volume ratio [m-1]', 'Positive current collector Ohmic heating [W.m-3]', 'Positive current collector potential [V]', 'Positive current collector temperature [C]', 'Positive current collector temperature [K]', 'Positive dead lithium concentration [mol.m-3]', 'Positive dead lithium thickness [m]', 'Positive electrode SEI film overpotential [V]', 'Positive electrode SEI interfacial current density [A.m-2]', 'Positive electrode SEI on cracks interfacial current density [A.m-2]', 'Positive electrode SEI on cracks volumetric interfacial current density [A.m-3]', 'Positive electrode SEI volumetric interfacial current density [A.m-3]', 'Positive electrode active material volume fraction', 'Positive electrode active material volume fraction change [s-1]', 'Positive electrode bulk open-circuit potential [V]', 'Positive electrode capacity [A.h]', 'Positive electrode current density [A.m-2]', 'Positive electrode entropic change [V.K-1]', 'Positive electrode equilibrium open-circuit potential [V]', 'Positive electrode exchange current density [A.m-2]', 'Positive electrode extent of lithiation', 'Positive electrode interface utilisation', 'Positive electrode interface utilisation variable', 'Positive electrode interfacial current density [A.m-2]', 'Positive electrode lithium plating interfacial current density [A.m-2]', 'Positive electrode lithium plating reaction overpotential [V]', 'Positive electrode lithium plating volumetric interfacial current density [A.m-3]', 'Positive electrode ohmic losses [V]', 'Positive electrode open-circuit potential [V]', 'Positive electrode porosity', 'Positive electrode porosity change [s-1]', 'Positive electrode porosity times concentration [mol.m-3]', 'Positive electrode potential [V]', 'Positive electrode pressure [Pa]', 'Positive electrode reaction overpotential [V]', 'Positive electrode roughness ratio', 'Positive electrode stoichiometry', 'Positive electrode surface area to volume ratio [m-1]', 'Positive electrode surface potential difference [V]', 'Positive electrode surface potential difference at separator interface [V]', 'Positive electrode temperature [C]', 'Positive electrode temperature [K]', 'Positive electrode transport efficiency', 'Positive electrode volume-averaged acceleration [m.s-2]', 'Positive electrode volume-averaged concentration', 'Positive electrode volume-averaged concentration [mol.m-3]', 'Positive electrode volume-averaged velocity [m.s-1]', 'Positive electrode volumetric interfacial current density [A.m-3]', 'Positive electrolyte concentration [Molar]', 'Positive electrolyte concentration [mol.m-3]', 'Positive electrolyte current density [A.m-2]', 'Positive electrolyte potential [V]', 'Positive electrolyte transport efficiency', 'Positive lithium plating concentration [mol.m-3]', 'Positive lithium plating thickness [m]', 'Positive particle bc [mol.m-4]', 'Positive particle concentration', 'Positive particle concentration [mol.m-3]', 'Positive particle concentration overpotential [V]', 'Positive particle crack length [m]', 'Positive particle cracking rate [m.s-1]', 'Positive particle effective diffusivity [m2.s-1]', 'Positive particle flux [mol.m-2.s-1]', 'Positive particle radius', 'Positive particle radius [m]', 'Positive particle rhs [mol.m-3.s-1]', 'Positive particle stoichiometry', 'Positive particle surface concentration', 'Positive particle surface concentration [mol.m-3]', 'Positive particle surface stoichiometry', 'Power [W]', 'Pressure [Pa]', 'R-averaged negative particle concentration', 'R-averaged negative particle concentration [mol.m-3]', 'R-averaged negative particle stoichiometry', 'R-averaged positive particle concentration', 'R-averaged positive particle concentration [mol.m-3]', 'R-averaged positive particle stoichiometry', 'Resistance [Ohm]', 'Reversible heating [W.m-3]', 'Reversible heating [W]', 'Reversible heating per unit electrode-pair area [W.m-2]', 'Separator electrode transport efficiency', 'Separator electrolyte concentration [Molar]', 'Separator electrolyte concentration [mol.m-3]', 'Separator electrolyte potential [V]', 'Separator electrolyte transport efficiency', 'Separator porosity', 'Separator porosity change [s-1]', 'Separator porosity times concentration [mol.m-3]', 'Separator pressure [Pa]', 'Separator temperature [C]', 'Separator temperature [K]', 'Separator volume-averaged acceleration [m.s-2]', 'Separator volume-averaged velocity [m.s-1]', 'Sum of electrolyte reaction source terms [A.m-3]', 'Sum of negative electrode electrolyte reaction source terms [A.m-3]', 'Sum of negative electrode volumetric interfacial current densities [A.m-3]', 'Sum of positive electrode electrolyte reaction source terms [A.m-3]', 'Sum of positive electrode volumetric interfacial current densities [A.m-3]', 'Sum of volumetric interfacial current densities [A.m-3]', 'Sum of x-averaged negative electrode electrolyte reaction source terms [A.m-3]', 'Sum of x-averaged negative electrode volumetric interfacial current densities [A.m-3]', 'Sum of x-averaged positive electrode electrolyte reaction source terms [A.m-3]', 'Sum of x-averaged positive electrode volumetric interfacial current densities [A.m-3]', 'Surface open-circuit voltage [V]', 'Surface temperature [K]', 'Surface total cooling [W.m-3]', 'Surface total cooling [W]', 'Terminal power [W]', 'Terminal voltage [V]', 'Throughput capacity [A.h]', 'Throughput energy [W.h]', 'Time [h]', 'Time [min]', 'Time [s]', 'Total capacity lost to side reactions [A.h]', 'Total current density [A.m-2]', 'Total heating [W.m-3]', 'Total heating [W]', 'Total heating per unit electrode-pair area [W.m-2]', 'Total lithium [mol]', 'Total lithium capacity [A.h]', 'Total lithium capacity in particles [A.h]', 'Total lithium in electrolyte [mol]', 'Total lithium in negative electrode [mol]', 'Total lithium in particles [mol]', 'Total lithium in positive electrode [mol]', 'Total lithium in primary phase in negative electrode [mol]', 'Total lithium in primary phase in positive electrode [mol]', 'Total lithium lost [mol]', 'Total lithium lost from electrolyte [mol]', 'Total lithium lost from particles [mol]', 'Total lithium lost to side reactions [mol]', 'Transverse volume-averaged acceleration [m.s-2]', 'Transverse volume-averaged velocity [m.s-1]', 'Voltage [V]', 'Voltage expression [V]', 'Volume-averaged Ohmic heating [W.m-3]', 'Volume-averaged acceleration [m.s-1]', 'Volume-averaged ambient temperature [C]', 'Volume-averaged ambient temperature [K]', 'Volume-averaged cell temperature [C]', 'Volume-averaged cell temperature [K]', 'Volume-averaged irreversible electrochemical heating [W.m-3]', 'Volume-averaged negative SEI concentration [mol.m-3]', 'Volume-averaged negative SEI on cracks concentration [mol.m-3]', 'Volume-averaged negative SEI on cracks thickness [m]', 'Volume-averaged negative SEI thickness [m]', 'Volume-averaged negative dead lithium concentration [mol.m-3]', 'Volume-averaged negative dead lithium thickness [m]', 'Volume-averaged negative lithium plating concentration [mol.m-3]', 'Volume-averaged negative lithium plating thickness [m]', 'Volume-averaged negative particle effective diffusivity [m2.s-1]', 'Volume-averaged positive SEI concentration [mol.m-3]', 'Volume-averaged positive SEI on cracks concentration [mol.m-3]', 'Volume-averaged positive SEI on cracks thickness [m]', 'Volume-averaged positive SEI thickness [m]', 'Volume-averaged positive dead lithium concentration [mol.m-3]', 'Volume-averaged positive dead lithium thickness [m]', 'Volume-averaged positive lithium plating concentration [mol.m-3]', 'Volume-averaged positive lithium plating thickness [m]', 'Volume-averaged positive particle effective diffusivity [m2.s-1]', 'Volume-averaged reversible heating [W.m-3]', 'Volume-averaged surface temperature [K]', 'Volume-averaged total heating [W.m-3]', 'Volume-averaged velocity [m.s-1]', 'X-averaged Ohmic heating [W.m-3]', 'X-averaged SEI film overpotential [V]', 'X-averaged battery concentration overpotential [V]', 'X-averaged battery electrolyte ohmic losses [V]', 'X-averaged battery negative reaction overpotential [V]', 'X-averaged battery negative solid phase ohmic losses [V]', 'X-averaged battery positive reaction overpotential [V]', 'X-averaged battery positive solid phase ohmic losses [V]', 'X-averaged battery reaction overpotential [V]', 'X-averaged battery solid phase ohmic losses [V]', 'X-averaged cell temperature [C]', 'X-averaged cell temperature [K]', 'X-averaged concentration overpotential [V]', 'X-averaged electrolyte concentration [Molar]', 'X-averaged electrolyte concentration [mol.m-3]', 'X-averaged electrolyte ohmic losses [V]', 'X-averaged electrolyte overpotential [V]', 'X-averaged electrolyte potential [V]', 'X-averaged irreversible electrochemical heating [W.m-3]', 'X-averaged negative SEI concentration [mol.m-3]', 'X-averaged negative SEI on cracks concentration [mol.m-3]', 'X-averaged negative SEI on cracks thickness [m]', 'X-averaged negative SEI thickness [m]', 'X-averaged negative dead lithium concentration [mol.m-3]', 'X-averaged negative dead lithium thickness [m]', 'X-averaged negative electrode SEI film overpotential [V]', 'X-averaged negative electrode SEI interfacial current density [A.m-2]', 'X-averaged negative electrode SEI on cracks interfacial current density [A.m-2]', 'X-averaged negative electrode SEI on cracks volumetric interfacial current density [A.m-3]', 'X-averaged negative electrode SEI volumetric interfacial current density [A.m-3]', 'X-averaged negative electrode active material volume fraction', 'X-averaged negative electrode active material volume fraction change [s-1]', 'X-averaged negative electrode entropic change [V.K-1]', 'X-averaged negative electrode equilibrium open-circuit potential [V]', 'X-averaged negative electrode exchange current density [A.m-2]', 'X-averaged negative electrode extent of lithiation', 'X-averaged negative electrode interface utilisation', 'X-averaged negative electrode interface utilisation variable', 'X-averaged negative electrode interfacial current density [A.m-2]', 'X-averaged negative electrode lithium plating interfacial current density [A.m-2]', 'X-averaged negative electrode lithium plating reaction overpotential [V]', 'X-averaged negative electrode lithium plating volumetric interfacial current density [A.m-3]', 'X-averaged negative electrode ohmic losses [V]', 'X-averaged negative electrode open-circuit potential [V]', 'X-averaged negative electrode porosity', 'X-averaged negative electrode porosity change [s-1]', 'X-averaged negative electrode potential [V]', 'X-averaged negative electrode pressure [Pa]', 'X-averaged negative electrode reaction overpotential [V]', 'X-averaged negative electrode resistance [Ohm.m2]', 'X-averaged negative electrode roughness ratio', 'X-averaged negative electrode surface area to volume ratio [m-1]', 'X-averaged negative electrode surface potential difference [V]', 'X-averaged negative electrode temperature [C]', 'X-averaged negative electrode temperature [K]', 'X-averaged negative electrode total interfacial current density [A.m-2]', 'X-averaged negative electrode total volumetric interfacial current density [A.m-3]', 'X-averaged negative electrode transport efficiency', 'X-averaged negative electrode transverse volume-averaged acceleration [m.s-2]', 'X-averaged negative electrode transverse volume-averaged velocity [m.s-1]', 'X-averaged negative electrode volume-averaged acceleration [m.s-2]', 'X-averaged negative electrode volumetric interfacial current density [A.m-3]', 'X-averaged negative electrolyte concentration [Molar]', 'X-averaged negative electrolyte concentration [mol.m-3]', 'X-averaged negative electrolyte potential [V]', 'X-averaged negative electrolyte transport efficiency', 'X-averaged negative lithium plating concentration [mol.m-3]', 'X-averaged negative lithium plating thickness [m]', 'X-averaged negative particle concentration', 'X-averaged negative particle concentration [mol.m-3]', 'X-averaged negative particle crack length [m]', 'X-averaged negative particle cracking rate [m.s-1]', 'X-averaged negative particle effective diffusivity [m2.s-1]', 'X-averaged negative particle flux [mol.m-2.s-1]', 'X-averaged negative particle radius [m]', 'X-averaged negative particle stoichiometry', 'X-averaged negative particle surface concentration', 'X-averaged negative particle surface concentration [mol.m-3]', 'X-averaged negative particle surface stoichiometry', 'X-averaged positive SEI concentration [mol.m-3]', 'X-averaged positive SEI on cracks concentration [mol.m-3]', 'X-averaged positive SEI on cracks thickness [m]', 'X-averaged positive SEI thickness [m]', 'X-averaged positive dead lithium concentration [mol.m-3]', 'X-averaged positive dead lithium thickness [m]', 'X-averaged positive electrode SEI film overpotential [V]', 'X-averaged positive electrode SEI interfacial current density [A.m-2]', 'X-averaged positive electrode SEI on cracks interfacial current density [A.m-2]', 'X-averaged positive electrode SEI on cracks volumetric interfacial current density [A.m-3]', 'X-averaged positive electrode SEI volumetric interfacial current density [A.m-3]', 'X-averaged positive electrode active material volume fraction', 'X-averaged positive electrode active material volume fraction change [s-1]', 'X-averaged positive electrode entropic change [V.K-1]', 'X-averaged positive electrode equilibrium open-circuit potential [V]', 'X-averaged positive electrode exchange current density [A.m-2]', 'X-averaged positive electrode extent of lithiation', 'X-averaged positive electrode interface utilisation', 'X-averaged positive electrode interface utilisation variable', 'X-averaged positive electrode interfacial current density [A.m-2]', 'X-averaged positive electrode lithium plating interfacial current density [A.m-2]', 'X-averaged positive electrode lithium plating reaction overpotential [V]', 'X-averaged positive electrode lithium plating volumetric interfacial current density [A.m-3]', 'X-averaged positive electrode ohmic losses [V]', 'X-averaged positive electrode open-circuit potential [V]', 'X-averaged positive electrode porosity', 'X-averaged positive electrode porosity change [s-1]', 'X-averaged positive electrode potential [V]', 'X-averaged positive electrode pressure [Pa]', 'X-averaged positive electrode reaction overpotential [V]', 'X-averaged positive electrode resistance [Ohm.m2]', 'X-averaged positive electrode roughness ratio', 'X-averaged positive electrode surface area to volume ratio [m-1]', 'X-averaged positive electrode surface potential difference [V]', 'X-averaged positive electrode temperature [C]', 'X-averaged positive electrode temperature [K]', 'X-averaged positive electrode total interfacial current density [A.m-2]', 'X-averaged positive electrode total volumetric interfacial current density [A.m-3]', 'X-averaged positive electrode transport efficiency', 'X-averaged positive electrode transverse volume-averaged acceleration [m.s-2]', 'X-averaged positive electrode transverse volume-averaged velocity [m.s-1]', 'X-averaged positive electrode volume-averaged acceleration [m.s-2]', 'X-averaged positive electrode volumetric interfacial current density [A.m-3]', 'X-averaged positive electrolyte concentration [Molar]', 'X-averaged positive electrolyte concentration [mol.m-3]', 'X-averaged positive electrolyte potential [V]', 'X-averaged positive electrolyte transport efficiency', 'X-averaged positive lithium plating concentration [mol.m-3]', 'X-averaged positive lithium plating thickness [m]', 'X-averaged positive particle concentration', 'X-averaged positive particle concentration [mol.m-3]', 'X-averaged positive particle crack length [m]', 'X-averaged positive particle cracking rate [m.s-1]', 'X-averaged positive particle effective diffusivity [m2.s-1]', 'X-averaged positive particle flux [mol.m-2.s-1]', 'X-averaged positive particle radius [m]', 'X-averaged positive particle stoichiometry', 'X-averaged positive particle surface concentration', 'X-averaged positive particle surface concentration [mol.m-3]', 'X-averaged positive particle surface stoichiometry', 'X-averaged reaction overpotential [V]', 'X-averaged reversible heating [W.m-3]', 'X-averaged separator electrode transport efficiency', 'X-averaged separator electrolyte concentration [Molar]', 'X-averaged separator electrolyte concentration [mol.m-3]', 'X-averaged separator electrolyte potential [V]', 'X-averaged separator electrolyte transport efficiency', 'X-averaged separator porosity', 'X-averaged separator porosity change [s-1]', 'X-averaged separator pressure [Pa]', 'X-averaged separator temperature [C]', 'X-averaged separator temperature [K]', 'X-averaged separator transverse volume-averaged acceleration [m.s-2]', 'X-averaged separator transverse volume-averaged velocity [m.s-1]', 'X-averaged separator volume-averaged acceleration [m.s-2]', 'X-averaged solid phase ohmic losses [V]', 'X-averaged total heating [W.m-3]', 'X-averaged volume-averaged acceleration [m.s-1]', 'negative electrode transverse volume-averaged acceleration [m.s-2]', 'negative electrode transverse volume-averaged velocity [m.s-1]', 'positive electrode transverse volume-averaged acceleration [m.s-2]', 'positive electrode transverse volume-averaged velocity [m.s-1]', 'r_n [m]', 'r_p [m]', 'separator transverse volume-averaged acceleration [m.s-2]', 'separator transverse volume-averaged velocity [m.s-1]', 'x [m]', 'x_n [m]', 'x_p [m]', 'x_s [m]']

If you want to find a particular variable you can search the variables dictionary

[7]:
model.variables.search("time")
Results for 'time': ['Time [s]', 'Time [min]', 'Time [h]', 'Porosity times concentration [mol.m-3]', 'Negative electrode porosity times concentration [mol.m-3]', 'Separator porosity times concentration [mol.m-3]', 'Positive electrode porosity times concentration [mol.m-3]']

We’ll use the time in hours

[8]:
solution["Time [h]"]
[8]:
<pybamm.solvers.processed_variable.ProcessedVariable0D at 0x146fd5250>

This created a new processed variable and stored it on the solution object

[9]:
solution.data.keys()
[9]:
dict_keys(['Negative particle surface concentration [mol.m-3]', 'Electrolyte concentration [mol.m-3]', 'Positive particle surface concentration [mol.m-3]', 'Current [A]', 'Negative electrode potential [V]', 'Electrolyte potential [V]', 'Positive electrode potential [V]', 'Voltage [V]', 'Time [h]'])

We can see the data by simply accessing the entries attribute of the processed variable

[10]:
solution["Time [h]"].entries
[10]:
array([0.00000000e+00, 3.43868323e-06, 6.87736646e-06, 1.37547329e-05,
       2.75094658e-05, 5.50189317e-05, 1.10037863e-04, 1.65056795e-04,
       2.75094658e-04, 3.85132522e-04, 4.95170385e-04, 7.15246112e-04,
       9.35321839e-04, 1.37547329e-03, 1.77160960e-03, 2.16774591e-03,
       2.56388222e-03, 2.96001853e-03, 3.75229114e-03, 4.54456376e-03,
       5.33683637e-03, 6.12910899e-03, 6.92138161e-03, 8.50592684e-03,
       1.00904721e-02, 1.16750173e-02, 1.32595625e-02, 1.48441078e-02,
       1.64286530e-02, 1.80131982e-02, 2.11822887e-02, 2.40344701e-02,
       2.74926780e-02, 3.06050651e-02, 3.37174522e-02, 3.68298392e-02,
       3.99422263e-02, 4.30546134e-02, 4.61670005e-02, 5.23917747e-02,
       5.86165488e-02, 6.48413230e-02, 7.72908714e-02, 8.83141619e-02,
       9.93374525e-02, 1.10360743e-01, 1.21384034e-01, 1.32407324e-01,
       1.54453906e-01, 1.76500487e-01, 1.98547068e-01, 2.20593649e-01,
       2.42640230e-01, 2.86733393e-01, 3.30826555e-01, 4.19012880e-01,
       5.95385529e-01, 9.48130829e-01, 1.00000000e+00])

We can also call the method with specified time(s) in SI units of seconds

[11]:
time_in_seconds = np.array([0, 600, 900, 1700, 3000])
[12]:
solution["Time [h]"](time_in_seconds)
[12]:
array([0.        , 0.16666667, 0.25      , 0.47222222, 0.83333333])

If the variable has not already been processed it will be created behind the scenes

[13]:
var = "X-averaged negative electrode temperature [K]"
solution[var](time_in_seconds)
[13]:
array([298.15, 298.15, 298.15, 298.15, 298.15])

In this example the simulation was isothermal, so the temperature remains unchanged.

Saving the solution#

The solution can be saved in a number of ways:

[14]:
# to a pickle file (default)
solution.save_data(
    "outputs.pickle",
    ["Time [h]", "Current [A]", "Voltage [V]", "Electrolyte concentration [mol.m-3]"],
)
# to a matlab file
# need to give variable names without space
solution.save_data(
    "outputs.mat",
    ["Time [h]", "Current [A]", "Voltage [V]", "Electrolyte concentration [mol.m-3]"],
    to_format="matlab",
    short_names={
        "Time [h]": "t",
        "Current [A]": "I",
        "Voltage [V]": "V",
        "Electrolyte concentration [mol.m-3]": "c_e",
    },
)
# to a csv file (time-dependent outputs only, no spatial dependence allowed)
solution.save_data(
    "outputs.csv", ["Time [h]", "Current [A]", "Voltage [V]"], to_format="csv"
)

Stepping the solver#

The previous solution was created in one go with the solve method, but it is also possible to step the solution and look at the results as we go. In doing so, the results are automatically updated at each step.

[15]:
dt = 360
time = 0
end_time = solution["Time [s]"].entries[-1]
step_simulation = pybamm.Simulation(model)
while time < end_time:
    step_solution = step_simulation.step(dt)
    print("Time", time)
    print(step_solution["Voltage [V]"].entries)
    time += dt
Time 0
[3.77057396 3.77055358 3.77053333 3.7704931  3.77041403 3.7702603
 3.76997849 3.76971335 3.76923473 3.76879676 3.76839135 3.76763934
 3.76696517 3.7657705  3.76482861 3.76396994 3.76317298 3.76242499
 3.76105167 3.75980242 3.75865012 3.75758225 3.75659013 3.75479647
 3.7532074  3.75177811 3.75047724 3.74928148 3.74817179 3.74713337
 3.74522275 3.74364749 3.74187167 3.74036101 3.73891052 3.73750368
 3.73613075 3.73478468 3.73346097 3.73086618 3.7283324  3.72584895
 3.7210167  3.71687343 3.7128573  3.71261995]
Time 360
[3.77057396 3.77055358 3.77053333 3.7704931  3.77041403 3.7702603
 3.76997849 3.76971335 3.76923473 3.76879676 3.76839135 3.76763934
 3.76696517 3.7657705  3.76482861 3.76396994 3.76317298 3.76242499
 3.76105167 3.75980242 3.75865012 3.75758225 3.75659013 3.75479647
 3.7532074  3.75177811 3.75047724 3.74928148 3.74817179 3.74713337
 3.74522275 3.74364749 3.74187167 3.74036101 3.73891052 3.73750368
 3.73613075 3.73478468 3.73346097 3.73086618 3.7283324  3.72584895
 3.7210167  3.71687343 3.7128573  3.71261995 3.71261995 3.71260604
 3.71259213 3.71256431 3.7125087  3.71239755 3.71217557 3.7117329
 3.71085267 3.70911262 3.7057141  3.70242457 3.6961711  3.69034621
 3.68493657 3.68226249]
Time 720
[3.77057396 3.77055358 3.77053333 3.7704931  3.77041403 3.7702603
 3.76997849 3.76971335 3.76923473 3.76879676 3.76839135 3.76763934
 3.76696517 3.7657705  3.76482861 3.76396994 3.76317298 3.76242499
 3.76105167 3.75980242 3.75865012 3.75758225 3.75659013 3.75479647
 3.7532074  3.75177811 3.75047724 3.74928148 3.74817179 3.74713337
 3.74522275 3.74364749 3.74187167 3.74036101 3.73891052 3.73750368
 3.73613075 3.73478468 3.73346097 3.73086618 3.7283324  3.72584895
 3.7210167  3.71687343 3.7128573  3.71261995 3.71261995 3.71260604
 3.71259213 3.71256431 3.7125087  3.71239755 3.71217557 3.7117329
 3.71085267 3.70911262 3.7057141  3.70242457 3.6961711  3.69034621
 3.68493657 3.68226249 3.68226249 3.68224649 3.68223049 3.6821985
 3.68213458 3.68200692 3.68175235 3.68124622 3.68024586 3.678292
 3.67456535 3.6677789  3.66174893 3.66136469]
Time 1080
[3.77057396 3.77055358 3.77053333 3.7704931  3.77041403 3.7702603
 3.76997849 3.76971335 3.76923473 3.76879676 3.76839135 3.76763934
 3.76696517 3.7657705  3.76482861 3.76396994 3.76317298 3.76242499
 3.76105167 3.75980242 3.75865012 3.75758225 3.75659013 3.75479647
 3.7532074  3.75177811 3.75047724 3.74928148 3.74817179 3.74713337
 3.74522275 3.74364749 3.74187167 3.74036101 3.73891052 3.73750368
 3.73613075 3.73478468 3.73346097 3.73086618 3.7283324  3.72584895
 3.7210167  3.71687343 3.7128573  3.71261995 3.71261995 3.71260604
 3.71259213 3.71256431 3.7125087  3.71239755 3.71217557 3.7117329
 3.71085267 3.70911262 3.7057141  3.70242457 3.6961711  3.69034621
 3.68493657 3.68226249 3.68226249 3.68224649 3.68223049 3.6821985
 3.68213458 3.68200692 3.68175235 3.68124622 3.68024586 3.678292
 3.67456535 3.6677789  3.66174893 3.66136469 3.66136469 3.66135111
 3.66133754 3.66131039 3.66125614 3.66114777 3.66093158 3.66050137
 3.65964904 3.65797209 3.65468218 3.64774012 3.64343267]
Time 1440
[3.77057396 3.77055358 3.77053333 3.7704931  3.77041403 3.7702603
 3.76997849 3.76971335 3.76923473 3.76879676 3.76839135 3.76763934
 3.76696517 3.7657705  3.76482861 3.76396994 3.76317298 3.76242499
 3.76105167 3.75980242 3.75865012 3.75758225 3.75659013 3.75479647
 3.7532074  3.75177811 3.75047724 3.74928148 3.74817179 3.74713337
 3.74522275 3.74364749 3.74187167 3.74036101 3.73891052 3.73750368
 3.73613075 3.73478468 3.73346097 3.73086618 3.7283324  3.72584895
 3.7210167  3.71687343 3.7128573  3.71261995 3.71261995 3.71260604
 3.71259213 3.71256431 3.7125087  3.71239755 3.71217557 3.7117329
 3.71085267 3.70911262 3.7057141  3.70242457 3.6961711  3.69034621
 3.68493657 3.68226249 3.68226249 3.68224649 3.68223049 3.6821985
 3.68213458 3.68200692 3.68175235 3.68124622 3.68024586 3.678292
 3.67456535 3.6677789  3.66174893 3.66136469 3.66136469 3.66135111
 3.66133754 3.66131039 3.66125614 3.66114777 3.66093158 3.66050137
 3.65964904 3.65797209 3.65468218 3.64774012 3.64343267 3.64343267
 3.64341293 3.64339317 3.6433536  3.64327422 3.64311456 3.64279155
 3.64213043 3.64074499 3.63770617 3.63060974 3.61576857 3.61179969]
Time 1800
[3.77057396 3.77055358 3.77053333 3.7704931  3.77041403 3.7702603
 3.76997849 3.76971335 3.76923473 3.76879676 3.76839135 3.76763934
 3.76696517 3.7657705  3.76482861 3.76396994 3.76317298 3.76242499
 3.76105167 3.75980242 3.75865012 3.75758225 3.75659013 3.75479647
 3.7532074  3.75177811 3.75047724 3.74928148 3.74817179 3.74713337
 3.74522275 3.74364749 3.74187167 3.74036101 3.73891052 3.73750368
 3.73613075 3.73478468 3.73346097 3.73086618 3.7283324  3.72584895
 3.7210167  3.71687343 3.7128573  3.71261995 3.71261995 3.71260604
 3.71259213 3.71256431 3.7125087  3.71239755 3.71217557 3.7117329
 3.71085267 3.70911262 3.7057141  3.70242457 3.6961711  3.69034621
 3.68493657 3.68226249 3.68226249 3.68224649 3.68223049 3.6821985
 3.68213458 3.68200692 3.68175235 3.68124622 3.68024586 3.678292
 3.67456535 3.6677789  3.66174893 3.66136469 3.66136469 3.66135111
 3.66133754 3.66131039 3.66125614 3.66114777 3.66093158 3.66050137
 3.65964904 3.65797209 3.65468218 3.64774012 3.64343267 3.64343267
 3.64341293 3.64339317 3.6433536  3.64327422 3.64311456 3.64279155
 3.64213043 3.64074499 3.63770617 3.63060974 3.61576857 3.61179969
 3.61179969 3.61177923 3.6117588  3.61171801 3.61163672 3.61147527
 3.61115691 3.610538   3.6093688  3.60727952 3.6038772  3.5987646
 3.59720169]
Time 2160
[3.77057396 3.77055358 3.77053333 3.7704931  3.77041403 3.7702603
 3.76997849 3.76971335 3.76923473 3.76879676 3.76839135 3.76763934
 3.76696517 3.7657705  3.76482861 3.76396994 3.76317298 3.76242499
 3.76105167 3.75980242 3.75865012 3.75758225 3.75659013 3.75479647
 3.7532074  3.75177811 3.75047724 3.74928148 3.74817179 3.74713337
 3.74522275 3.74364749 3.74187167 3.74036101 3.73891052 3.73750368
 3.73613075 3.73478468 3.73346097 3.73086618 3.7283324  3.72584895
 3.7210167  3.71687343 3.7128573  3.71261995 3.71261995 3.71260604
 3.71259213 3.71256431 3.7125087  3.71239755 3.71217557 3.7117329
 3.71085267 3.70911262 3.7057141  3.70242457 3.6961711  3.69034621
 3.68493657 3.68226249 3.68226249 3.68224649 3.68223049 3.6821985
 3.68213458 3.68200692 3.68175235 3.68124622 3.68024586 3.678292
 3.67456535 3.6677789  3.66174893 3.66136469 3.66136469 3.66135111
 3.66133754 3.66131039 3.66125614 3.66114777 3.66093158 3.66050137
 3.65964904 3.65797209 3.65468218 3.64774012 3.64343267 3.64343267
 3.64341293 3.64339317 3.6433536  3.64327422 3.64311456 3.64279155
 3.64213043 3.64074499 3.63770617 3.63060974 3.61576857 3.61179969
 3.61179969 3.61177923 3.6117588  3.61171801 3.61163672 3.61147527
 3.61115691 3.610538   3.6093688  3.60727952 3.6038772  3.5987646
 3.59720169 3.59720169 3.59719376 3.59718583 3.59716998 3.59713829
 3.597075   3.59694876 3.59669762 3.59620036 3.59522447 3.59334112
 3.58986018 3.58831559]
Time 2520
[3.77057396 3.77055358 3.77053333 3.7704931  3.77041403 3.7702603
 3.76997849 3.76971335 3.76923473 3.76879676 3.76839135 3.76763934
 3.76696517 3.7657705  3.76482861 3.76396994 3.76317298 3.76242499
 3.76105167 3.75980242 3.75865012 3.75758225 3.75659013 3.75479647
 3.7532074  3.75177811 3.75047724 3.74928148 3.74817179 3.74713337
 3.74522275 3.74364749 3.74187167 3.74036101 3.73891052 3.73750368
 3.73613075 3.73478468 3.73346097 3.73086618 3.7283324  3.72584895
 3.7210167  3.71687343 3.7128573  3.71261995 3.71261995 3.71260604
 3.71259213 3.71256431 3.7125087  3.71239755 3.71217557 3.7117329
 3.71085267 3.70911262 3.7057141  3.70242457 3.6961711  3.69034621
 3.68493657 3.68226249 3.68226249 3.68224649 3.68223049 3.6821985
 3.68213458 3.68200692 3.68175235 3.68124622 3.68024586 3.678292
 3.67456535 3.6677789  3.66174893 3.66136469 3.66136469 3.66135111
 3.66133754 3.66131039 3.66125614 3.66114777 3.66093158 3.66050137
 3.65964904 3.65797209 3.65468218 3.64774012 3.64343267 3.64343267
 3.64341293 3.64339317 3.6433536  3.64327422 3.64311456 3.64279155
 3.64213043 3.64074499 3.63770617 3.63060974 3.61576857 3.61179969
 3.61179969 3.61177923 3.6117588  3.61171801 3.61163672 3.61147527
 3.61115691 3.610538   3.6093688  3.60727952 3.6038772  3.5987646
 3.59720169 3.59720169 3.59719376 3.59718583 3.59716998 3.59713829
 3.597075   3.59694876 3.59669762 3.59620036 3.59522447 3.59334112
 3.58986018 3.58831559 3.58831559 3.58831018 3.58830476 3.58829394
 3.58827232 3.58822915 3.58814307 3.58797197 3.58763394 3.58697333
 3.5856988  3.58309553 3.58066974]
Time 2880
[3.77057396 3.77055358 3.77053333 3.7704931  3.77041403 3.7702603
 3.76997849 3.76971335 3.76923473 3.76879676 3.76839135 3.76763934
 3.76696517 3.7657705  3.76482861 3.76396994 3.76317298 3.76242499
 3.76105167 3.75980242 3.75865012 3.75758225 3.75659013 3.75479647
 3.7532074  3.75177811 3.75047724 3.74928148 3.74817179 3.74713337
 3.74522275 3.74364749 3.74187167 3.74036101 3.73891052 3.73750368
 3.73613075 3.73478468 3.73346097 3.73086618 3.7283324  3.72584895
 3.7210167  3.71687343 3.7128573  3.71261995 3.71261995 3.71260604
 3.71259213 3.71256431 3.7125087  3.71239755 3.71217557 3.7117329
 3.71085267 3.70911262 3.7057141  3.70242457 3.6961711  3.69034621
 3.68493657 3.68226249 3.68226249 3.68224649 3.68223049 3.6821985
 3.68213458 3.68200692 3.68175235 3.68124622 3.68024586 3.678292
 3.67456535 3.6677789  3.66174893 3.66136469 3.66136469 3.66135111
 3.66133754 3.66131039 3.66125614 3.66114777 3.66093158 3.66050137
 3.65964904 3.65797209 3.65468218 3.64774012 3.64343267 3.64343267
 3.64341293 3.64339317 3.6433536  3.64327422 3.64311456 3.64279155
 3.64213043 3.64074499 3.63770617 3.63060974 3.61576857 3.61179969
 3.61179969 3.61177923 3.6117588  3.61171801 3.61163672 3.61147527
 3.61115691 3.610538   3.6093688  3.60727952 3.6038772  3.5987646
 3.59720169 3.59720169 3.59719376 3.59718583 3.59716998 3.59713829
 3.597075   3.59694876 3.59669762 3.59620036 3.59522447 3.59334112
 3.58986018 3.58831559 3.58831559 3.58831018 3.58830476 3.58829394
 3.58827232 3.58822915 3.58814307 3.58797197 3.58763394 3.58697333
 3.5856988  3.58309553 3.58066974 3.58066974 3.58066304 3.58065634
 3.58064291 3.58061598 3.58056182 3.5804523  3.58022833 3.57975945
 3.57872824 3.57620613 3.56844051 3.55184639]
Time 3240
[3.77057396 3.77055358 3.77053333 3.7704931  3.77041403 3.7702603
 3.76997849 3.76971335 3.76923473 3.76879676 3.76839135 3.76763934
 3.76696517 3.7657705  3.76482861 3.76396994 3.76317298 3.76242499
 3.76105167 3.75980242 3.75865012 3.75758225 3.75659013 3.75479647
 3.7532074  3.75177811 3.75047724 3.74928148 3.74817179 3.74713337
 3.74522275 3.74364749 3.74187167 3.74036101 3.73891052 3.73750368
 3.73613075 3.73478468 3.73346097 3.73086618 3.7283324  3.72584895
 3.7210167  3.71687343 3.7128573  3.71261995 3.71261995 3.71260604
 3.71259213 3.71256431 3.7125087  3.71239755 3.71217557 3.7117329
 3.71085267 3.70911262 3.7057141  3.70242457 3.6961711  3.69034621
 3.68493657 3.68226249 3.68226249 3.68224649 3.68223049 3.6821985
 3.68213458 3.68200692 3.68175235 3.68124622 3.68024586 3.678292
 3.67456535 3.6677789  3.66174893 3.66136469 3.66136469 3.66135111
 3.66133754 3.66131039 3.66125614 3.66114777 3.66093158 3.66050137
 3.65964904 3.65797209 3.65468218 3.64774012 3.64343267 3.64343267
 3.64341293 3.64339317 3.6433536  3.64327422 3.64311456 3.64279155
 3.64213043 3.64074499 3.63770617 3.63060974 3.61576857 3.61179969
 3.61179969 3.61177923 3.6117588  3.61171801 3.61163672 3.61147527
 3.61115691 3.610538   3.6093688  3.60727952 3.6038772  3.5987646
 3.59720169 3.59720169 3.59719376 3.59718583 3.59716998 3.59713829
 3.597075   3.59694876 3.59669762 3.59620036 3.59522447 3.59334112
 3.58986018 3.58831559 3.58831559 3.58831018 3.58830476 3.58829394
 3.58827232 3.58822915 3.58814307 3.58797197 3.58763394 3.58697333
 3.5856988  3.58309553 3.58066974 3.58066974 3.58066304 3.58065634
 3.58064291 3.58061598 3.58056182 3.5804523  3.58022833 3.57975945
 3.57872824 3.57620613 3.56844051 3.55184639 3.55184639 3.55181127
 3.55177611 3.55170565 3.55156424 3.55127934 3.55070116 3.54951025
 3.54698155 3.54125892 3.52636208 3.47241928 3.17213165]

We can plot the voltages and see that the solutions are the same

[23]:
t = np.linspace(0, solution.t[-1], 100)
voltage = solution["Voltage [V]"](t)

step_t = np.linspace(0, step_solution.t[-1], 100)
step_voltage = step_solution["Voltage [V]"](step_t)
plt.figure()
plt.plot(t, voltage, "b-", label="SPMe (continuous solve)", zorder=10)
plt.plot(t, step_voltage, "ro", label="SPMe (stepped solve)")
plt.legend()
[23]:
<matplotlib.legend.Legend at 0x14513f080>
../../../_images/source_examples_notebooks_solution-data-and-processed-variables_28_1.png

As a final step, we will clean up the output files created by this notebook:

[17]:
os.remove("outputs.csv")
os.remove("outputs.mat")
os.remove("outputs.pickle")

References#

The relevant papers for this notebook are:

[18]:
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] 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.
[4] Alan C. Hindmarsh. The PVODE and IDA algorithms. Technical Report, Lawrence Livermore National Lab., CA (US), 2000. doi:10.2172/802599.
[5] 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.
[6] 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.
[7] 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.