Degradation parameter sweep
Sweep two degradation parameters in one batch request and map state of health after 100 cycles.
Make two degradation parameters "[input]" and solve over a 3 × 3 grid. The nine
runs share a model and protocol, so they go to Ionworks as one batch request. The
map shows which mechanism drives the fade.
This example uses a published PyBaMM parameter set, so you can
copy it and run it as-is on Ionworks. Set IONWORKS_PYBAMM_LOCAL=1 to run the same script with
PyBaMM on your own machine.
Each simulation holds 0.025 of
the credit left after what its running simulations have used if that is fewer, so solve
sends a larger batch in groups of that size, each once the group before it has finished.
If your credit runs out while simulations are running, they are all canceled and charged
for the time they ran.
import ionworks.pybamm as pybamm
import matplotlib.pyplot as plt
import numpy as np
model = pybamm.lithium_ion.SPM(
{
"SEI": "solvent-diffusion limited",
"SEI porosity change": "true",
"lithium plating": "partially reversible",
"lithium plating porosity change": "true",
"particle mechanics": "swelling only",
"loss of active material": "stress-driven",
}
)
sei = "SEI solvent diffusivity [m2.s-1]"
lam = "Negative electrode LAM constant proportional term [s-1]"
parameter_values = pybamm.ParameterValues("OKane2022")
parameter_values[sei] = "[input]"
parameter_values[lam] = "[input]"
cycles = 100
experiment = pybamm.Experiment(
[
(
"Discharge at 1C until 2.5 V",
"Rest for 5 minutes",
"Charge at 0.3C until 4.2 V",
"Hold at 4.2 V until C/100",
"Rest for 5 minutes",
)
]
* cycles
)
sim = pybamm.Simulation(
model, parameter_values=parameter_values, experiment=experiment
)
sei_values = np.geomspace(2.5e-22, 2.5e-20, 3)
lam_values = np.geomspace(2.7778e-7, 2.7778e-5, 3)
grid = [(s, m) for s in sei_values for m in lam_values]
solutions = sim.solve(initial_soc=1, inputs=[{sei: s, lam: m} for s, m in grid])
def soh_at_last_cycle(sol):
first, last = sol.cycles[0].steps[0], sol.cycles[-1].steps[0]
return 100 * (
np.ptp(last["Discharge capacity [A.h]"].entries)
/ np.ptp(first["Discharge capacity [A.h]"].entries)
)
soh = np.array([soh_at_last_cycle(sol) for sol in solutions]).reshape(
len(sei_values), len(lam_values)
)
fig, ax = plt.subplots()
image = ax.imshow(soh, origin="lower", cmap="viridis")
ax.set_xticks(range(len(lam_values)), [f"{m:.1e}" for m in lam_values])
ax.set_yticks(range(len(sei_values)), [f"{s:.1e}" for s in sei_values])
ax.set_xlabel(lam)
ax.set_ylabel(sei)
for (i, j), value in np.ndenumerate(soh):
ax.text(j, i, f"{value:.1f}", ha="center", va="center", color="white")
fig.colorbar(image, label=f"State of health after {cycles} cycles [%]")
plt.show()
Next
To find the values that match your cell instead of sweeping them, fit them to
ageing data with ionworks.pipeline: see
Cycle-ageing fit.