Skip to content
Discussion options

You must be logged in to vote

Does something like this work:

import pybamm
import numpy as np

model = pybamm.lithium_ion.SPM()
param = pybamm.ParameterValues("Chen2020")

drive_cycles = np.array([2, 1, -2, -1, -3, -1, -2, 3, 2, 5, 4])

Vmin = 2.5
Vmax = 4.3

param['Lower voltage cut-off [V]'] = Vmin
param['Upper voltage cut-off [V]'] = Vmax

solution = None

for i, I_app in enumerate(drive_cycles):
    if I_app < 0:
        instr = "Discharge"
        Vlim = Vmin
    else:
        instr = "Charge"
        Vlim = Vmax
    I_mag = np.abs(I_app)
    try:
        op_cond = f"{instr} at {I_mag}A for 1 hour or until {Vlim}V"
        experiment = pybamm.Experiment(operating_conditions=[op_cond])
        sim = pybamm.Simulat…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by manjunathnilugal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants