Closed ADSDAW closed 3 months ago
@ADSDAW As I mentioned in #4233, you are using a rather old version of PyBaMM. Can you try again with a newer version?
With the following code (and the pre-release of PyBaMM 24.5) I do not get the behavior you are reporting. This is mostly what you did, except I used the data loader class since the drive cycles are no longer stored directly in PyBaMM.
import pybamm
import pandas as pd
file_path = pybamm.DataLoader().get_data("US06.csv")
parameter_values = pybamm.ParameterValues("Chen2020")
drive_cycle = pd.read_csv(file_path, comment="#", header=None).to_numpy()
current_interpolant = pybamm.Interpolant(drive_cycle[:, 0], drive_cycle[:, 1], pybamm.t)
parameter_values["Current function [A]"] = current_interpolant
model = pybamm.lithium_ion.DFN()
sim = pybamm.Simulation(model, parameter_values=parameter_values)
sol = sim.solve()
sim.plot(["Current [A]", "Voltage [V]"])
Thank u vary much
I will close this issue for now since I suspect it was mainly caused by the old python version.
PyBaMM Version
22.9
Python Version
3.7.0
Describe the bug
The code and graphics are as follows US06.csv is copied from the pybamm directory
Steps to Reproduce
Relevant log output
No response