Hello guys,
I am currently trying to create a simple example to use the US06 drive cycle. The problem is that my experiment just won’t finish completely because of an infeasibility warning. I hope someone can help me here.
import pybamm
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
drive_cycle = pd.read_csv(
pybamm.DataLoader().get_data("US06.csv"), comment="#", header=None
).to_numpy()
parameter_values = pybamm.ParameterValues("Mohtat2020")
spm = pybamm.lithium_ion.SPM()
parameter_values.set_initial_stoichiometries(0.1);
experiment = pybamm.Experiment(
[
(
"Rest for 1 hour",
"Charge at 0.5C until 4.2V",
"Hold at 4.2V until C/50",
"Rest for 1 hour",
pybamm.step.current(drive_cycle),
"Rest for 5 hour",
"Discharge at 0.1C until 2.5V",
)
]
)
pybamm.set_logging_level("NOTICE")
sim = pybamm.Simulation(spm, experiment=experiment, parameter_values=parameter_values)
sol = sim.solve()
time = sol["Time [s]"].entries
current = sol["Current [A]"].entries
plt.figure(figsize=(10, 6))
plt.plot(time , sol["Current [A]"].entries, label='Current (A)')
plt.xlabel('Time (seconds)')
plt.ylabel('Current (A)')
plt.title('Sim Problem')
plt.legend()
plt.grid(True)
plt.show()
Output:
➜ test_pybamm.py
2024-12-28 00:49:55.704 - [WARNING] callbacks.on_experiment_infeasible_time(240):
Experiment is infeasible: default duration (600.0 seconds) was reached during 'Step([[0.0000e+00 1.2859e-02]
[1.0000e+00 1.2859e-02]
[2.0000e+00 1.2859e-02]
...
[5.9800e+02 1.2859e-02]
[5.9900e+02 1.2859e-02]
[6.0000e+02 1.2859e-02]], duration=600.0, period=1.0, direction=Discharge)'. The returned solution only contains up to step 5 of cycle 1. Please specify a duration in the step instructions.
Bascially I expected pybamm to continue the rest/discharge process, but something in the drive cycle causes the sim to terminate earlier
I would also like to know which drive cycles besides the US06 exist in pybamm that I can use as an alternative, as I would like to have a 1-hour drive cycle (US06 is only about 10 minutes). My main goal later on is to expand this experiment to a whole day and test different configurations with respect to charging/discharging/drive cycles to represent the activity on a normal workday. Many thanks!