Rate capability
Compare discharge curves across C-rates with ionworks.pybamm.BatchStudy.
Discharge a DFN cell at six C-rates and overlay the curves. Each rate is its own
pybamm.Experiment, and BatchStudy submits every run to Ionworks at once.
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.
import ionworks.pybamm as pybamm
import matplotlib.pyplot as plt
rates = ["C/10", "C/5", "C/2", "1C", "2C", "3C"]
study = pybamm.BatchStudy(
models={"DFN": pybamm.lithium_ion.DFN()},
experiments={
rate: pybamm.Experiment([f"Discharge at {rate} until 2.5 V"])
for rate in rates
},
parameter_values={"Chen2020": pybamm.ParameterValues("Chen2020")},
permutations=True,
)
study.solve(initial_soc=1)
fig, ax = plt.subplots()
capacities = {}
for rate, sim in zip(rates, study.sims, strict=True):
capacity = sim.solution["Discharge capacity [A.h]"].entries
ax.plot(capacity, sim.solution["Voltage [V]"].entries, label=rate)
capacities[rate] = capacity[-1]
ax.set_xlabel("Discharge capacity [A.h]")
ax.set_ylabel("Voltage [V]")
ax.legend()
plt.show()
print({rate: round(capacity, 3) for rate, capacity in capacities.items()})