-
-
Notifications
You must be signed in to change notification settings - Fork 665
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
PyBaMM Version
25.6
Python Version
3.12
Describe the bug
Defining an experiment step with a drive cycle array seems to ignore any manually defined t_eval period. It just uses the period of the data (or in the case of non-uniform timesteps, it looks like it does a fixed period of total_duration/N_points)
I tried specifying the period
in both the step and the experiment, it doesn't make a difference.
Steps to Reproduce
import pybamm
import numpy as np
t = np.linspace(0, 100, 101)
I = np.sin(t)
drive_cycle = np.column_stack([t, I])
exp = pybamm.Experiment([pybamm.step.CRate(drive_cycle, duration=100, period=0.05)], period=0.05)
model = pybamm.lithium_ion.SPMe()
params = model.default_parameter_values
sim = pybamm.Simulation(model, exp, parameter_values=params, solver=pybamm.IDAKLUSolver())
sol = sim.solve(initial_soc=0.5)
sol["Time [s]"].entries # this has the period of the linspace
Relevant log output
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working