Aged parameter set example

For scenario modelling it can be useful to take a parameter set for a fresh cell and apply a degradation state to it. In this example we will use the apply_degradation_state method to do this.

import ionworkspipeline as iwp
import pybamm
/home/docs/checkouts/readthedocs.org/user_builds/ionworks-ionworkspipeline/envs/v0.8.2/lib/python3.12/site-packages/pybtex/plugin/__init__.py:26: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources

We begin by loading in a fresh parameter set. For this example we will use the Chen2020 parameter set.

fresh_parameter_values = iwp.ParameterValues("Chen2020")

Next we define a degradation state. The degradation state to apply to the parameter values is a dictionary with the following keys:

  • “LAM_ne [%]”: Loss of active material in negative electrode (%)

  • “LAM_pe [%]”: Loss of active material in positive electrode (%)

  • “LLI [%]”: Loss of lithium inventory (%)

  • “R0_addn [Ohm]”: Additional ohmic resistance (Ohm). This is achieved by adding to the contact resistance.

degradation_state = {
    "LLI [%]": 8,
    "LAM_ne [%]": 3,
    "LAM_pe [%]": 5,
    "R0_addn [Ohm]": 0.03,
}

We then apply the degradation state to the parameter values, passing inplace=False so that the original parameter values are not modified

aged_parameter_values = fresh_parameter_values.apply_degradation_state(
    degradation_state, inplace=False
)

Now we can create a model and solve it for both the fresh and aged parameter values,

model = pybamm.lithium_ion.SPMe(options={"contact resistance": "true"})
experiment = pybamm.Experiment(
    [
        "Discharge at 1C until 2.8V",
        "Rest for 1 hour",
        "Charge at 1C until 4.2V",
        "Hold at 4.2V until C/20",
        "Rest for 1 hour",
    ]
)
sols = []
for parameter_values in [fresh_parameter_values, aged_parameter_values]:
    sim = pybamm.Simulation(
        model,
        parameter_values=parameter_values,
        experiment=experiment,
    )
    sol = sim.solve()
    sols.append(sol)

and compare the results

pybamm.dynamic_plot(
    sols,
    [
        "Current [A]",
        "Voltage [V]",
        "X-averaged negative electrode reaction overpotential [V]",
        "X-averaged positive electrode reaction overpotential [V]",
        "X-averaged electrolyte overpotential [V]",
        "Electrolyte concentration [mol.m-3]",
    ],
    labels=["Fresh", "Aged"],
)
<pybamm.plotting.quick_plot.QuickPlot at 0x745b3eded790>