Hi, I am currently simulating cell aging using Pybamm. I want to run aging for 1800 cycles. But it is almost impossible on my laptop to run these many cycles. What should I change in my code to run these many cycles?
import pybamm
import matplotlib.pyplot as plt
import numpy as np
model = pybamm.lithium_ion.DFN(
{
“SEI”: “solvent-diffusion limited”,
}
)
param = pybamm.ParameterValues(“OKane2022”)
experiment = pybamm.Experiment(
[
“Discharge at 0.5C until 2.95V”, # Discharge step
“Charge at 0.5C until 4.15V”, # Constant current charge
“Hold at 4.15V until 50mA”, # Constant voltage hold
“Rest for 10 minutes”, # Rest step
] * 1800 # Repeat for 1800 cycles
)
sim = pybamm.Simulation(model, parameter_values=param, experiment=experiment)
Solve the simulation
solution = sim.solve()
discharge_capacity = solution[“Discharge capacity [A.h]”].data
time= solution[“Time [min]”].data
current= solution[“Current [A]”].data
voltage = solution[“Voltage [V]”].data
if current.shape != time.shape:
current = np.full_like(time, current[0]) # If current is scalar, match the length of time
Create a figure and axis objects
fig, ax1 = plt.subplots(figsize=(8, 5))
ax1.plot(time, discharge_capacity, marker=‘o’, color=‘tab:blue’, label=‘Discharge Capacity’)
ax1.set_xlabel(“Time (min)”)
ax1.set_ylabel(“Capacity (A.h)”, color=‘tab:blue’)
ax1.tick_params(axis=‘y’, labelcolor=‘tab:blue’)
ax1.grid(True)
ax2 = ax1.twinx()
ax2.plot(time, current, marker=‘x’, color=‘tab:red’, label=‘Current’)
ax2.set_ylabel(“Current (A)”, color=‘tab:red’)
ax2.tick_params(axis=‘y’, labelcolor=‘tab:red’)
ax3 = ax1.twinx()
Shift the third y-axis to avoid overlapping with the second y-axis
ax3.spines[‘right’].set_position((‘outward’, 60))
ax3.plot(time, voltage, marker=‘^’, color=‘tab:green’, label=‘Voltage’)
ax3.set_ylabel(“Voltage (V)”, color=‘tab:green’)
ax3.tick_params(axis=‘y’, labelcolor=‘tab:green’)
plt.title(“Voltage, Discharge Capacity, and Current vs Time”)
fig.tight_layout() # Adjust layout for better appearance
plt.show()