You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been working on a simulation using the SPM model with specific parameter values and a custom drive cycle. My initial setup performs well for a lower number of cycles (actually just for <3), but as I increase the number of cycles to 3 or more, the output becomes inaccurate. Specifically, I do not get the expected 3 drive cycles in one complete cycle.
Here is the code snippet for reference:
importpybammimportpandasaspd# Parameter setupparameter_values=pybamm.ParameterValues("Chen2020")
parameter_values.update({"SEI kinetic rate constant [m.s-1]": 1e-12})
#parameter_values.update({"SEI kinetic rate constant [m.s-1]": 1e-14})model=pybamm.lithium_ion.SPM({
"thermal": "lumped",
"SEI": "reaction limited",
"SEI film resistance": "distributed",
"SEI porosity change": "false"
})
pybamm.set_logging_level("ERROR")
# Number of cyclescycles=2# Load drive cycledrive_cycle=pd.read_csv("pybamm/input/drive_cycles/WLTC.csv", comment='#', header=None).to_numpy()
# Scale the currentscale_factor=0.1drive_cycle[:, 1] *=scale_factor# Define experimentexperiment=pybamm.Experiment(
[
(
pybamm.step.current(drive_cycle),
"Rest for 1 hour",
pybamm.step.current(drive_cycle),
"Rest for 1 hour",
pybamm.step.current(drive_cycle),
"Rest for 1 hour",
"Charge at 1C until 4.2V",
"Hold at 4.2V until C/50"
),
] *cycles,
)
# Run simulationsim=pybamm.Simulation(
model, parameter_values=parameter_values, experiment=experiment
)
sol=sim.solve(save_at_cycles=10)
sol.plot()
As mentioned, the simulation runs as expected for a small number of cycles, but when increasing the cycle count, the output does not correctly reflect the three drive cycles in one complete cycle.
I am unsure what might be causing this. Could it be an issue with how the experiment is defined or perhaps how the cycles are being handled in my code? Any insights or suggestions to troubleshoot this issue would be greatly appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello PyBaMM Community,
I have been working on a simulation using the SPM model with specific parameter values and a custom drive cycle. My initial setup performs well for a lower number of cycles (actually just for <3), but as I increase the number of cycles to 3 or more, the output becomes inaccurate. Specifically, I do not get the expected 3 drive cycles in one complete cycle.
Here is the code snippet for reference:
As mentioned, the simulation runs as expected for a small number of cycles, but when increasing the cycle count, the output does not correctly reflect the three drive cycles in one complete cycle.
I am unsure what might be causing this. Could it be an issue with how the experiment is defined or perhaps how the cycles are being handled in my code? Any insights or suggestions to troubleshoot this issue would be greatly appreciated.
Thank you in advance for your help!
Best regards,
Michael
Beta Was this translation helpful? Give feedback.
All reactions