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
Currently having some trouble with my experiments repeatedly hitting a condition where I'm unable to pass one experiment to the next, because of exceeding boundary conditions. For context, I'm loading a cell with a square waves at particular frequencies to simulate effects of rippled loading.
There are other experimental steps defined, but the but where it fails usually within the pybamm.current.step() experimental step where I am actually putting in the square wave.
termination_value=self.v1_terminal_limitdefvoltage_cutoff(variables):
globaltermination_valuereturnvariables["Voltage [V]"] -termination_valuedefvoltage_termination(cutoff_voltage):
# Update the terminal voltage - before calling voltage_cutoff() functionglobaltermination_valuetermination_value=cutoff_voltagereturnpybamm.step.CustomTermination(name=f"Voltage cutoff at {cutoff_voltage}V", event_function=voltage_cutoff)
exp=pybamm.Experiment(
[
(pybamm.step.current(drive_cycle_current, duration=truncated_duration, termination="2.7V")),
] *self.num_cycles,
# termination = "2.7V", # termination = voltage_termination(self.v1_terminal_limit)
)
Further below is the section of code where I am applying the experiment: I'm loading the battery with a Square wave just to study the effects of a rippled load. However, in the above section of code, the duration = truncated_duration might be set to somethng like 50s. This stepwill be multiplied by num_cycles, whcih might be in the something like 720 to fully deplete the cell (if the mean current of my square wave is 1C equivalent), so 72 * 50s = 1hr. I'm doing this because, as far as I'm aware the duration is restricted to 600s for pybamm.step.current()?
I've tried to play around with the termination condition, sometimes it might be termination = voltage_termination(self.v1_terminal_limit), other times it might be termination = "2.7V" as above in the pybamm.step.current()
foriinrange(self.M):
ifi!=0: # skip the first set of ageing cycles because it's already been done# st1_charge - this order is mainly because of the initialisation cycle where we calibrate the sim=pybamm.Simulation(
self.model, experiment=self.st1_charge, parameter_values=self.parameter_values
)
st1_charge_sol=sim.solve(starting_solution=rpt_sol, solver=self.solver_mode, calc_esoh=self.calcesoh)
forninrange(self.N):
# st1_sinedischargesim=pybamm.Simulation(
self.model, experiment=self.st1_sinedischarge, parameter_values=self.parameter_values
)
st1_sinedischarge_sol=sim.solve(starting_solution=st1_charge_sol, solver=self.solver_mode, calc_esoh=self.calcesoh, save_at_cycles=self.cyc_save_interval)
# st1_restsim=pybamm.Simulation(
self.model, experiment=self.st1_rest, parameter_values=self.parameter_values
)
st1_rest_sol=sim.solve(starting_solution=st1_sinedischarge_sol, solver=self.solver_mode, calc_esoh=self.calcesoh)
# st1_charge - or generally a final charge up before rpt test (stati discharge test to obtain true capacity).sim=pybamm.Simulation(
self.model, experiment=self.st1_charge, parameter_values=self.parameter_values
)
st1_charge_sol=sim.solve(starting_solution=st1_rest_sol, solver=self.solver_mode, calc_esoh=self.calcesoh)
# Debuggingrpt_sol_cycles_tracker.append(len(rpt_sol.cycles))
# rpt_experiment - do the reference performance tests after each set of ageing cyclessim=pybamm.Simulation(
self.model, experiment=self.rpt_experiment, parameter_values=self.parameter_values
)
rpt_sol=sim.solve(starting_solution=st1_charge_sol, solver=self.solver_mode, calc_esoh=self.calcesoh)
The error is pasted below - I've included a trimmed sub-section of the log printed in the terminal just to indicate how it was running before failing. Mainly, it would appear that the cell is exceeding some boundary condition between each experiment preventing the next experiment step from being run.
This is really quite frustrating, as sometimes it seems to go straight past the termination condition, other times it does complete. The majority of the time I get the error as indicated towards the end, is feasible due to exceeded bounds ```
Would really appreciate an alternaitve suggestion to how I could setup the custom termination, the square wave current profile, or both in order to avoid this!
If it helps. I'm using the IDAKLU solver with OKane2022 parameter set, with DFN model.
5005005004989016, direction=Discharge)
2024-11-23 14:41:07.918 - [NOTICE] logger.func(7): Cycle 21/64 (59 minutes, 8 seconds elapsed) --------------------
2024-11-23 14:41:07.918 - [NOTICE] logger.func(7): Cycle 21/64, step 1/1: Step([[0.00000000e+00 5.50000000e+00]
[5.00500501e-03 5.50000000e+00]
[1.00100100e-02 5.50000000e+00]
...
[4.98998999e+00 1.00000000e+00]
[4.99499499e+00 1.00000000e+00]
[5.00000000e+00 1.00000000e+00]], duration=300, termination=[<pybamm.experiment.step.step_termination.VoltageTermination object at 0x0000014405304B10>], period=0.005005005004989016, direction=Discharge)
2024-11-23 14:44:47.475 - [NOTICE] logger.func(7): Cycle 22/64 (1 hour, 2 minutes, 48 seconds elapsed) --------------------
2024-11-23 14:44:47.476 - [NOTICE] logger.func(7): Cycle 22/64, step 1/1: Step([[0.00000000e+00 5.50000000e+00]
[5.00500501e-03 5.50000000e+00]
[1.00100100e-02 5.50000000e+00]
...
[4.98998999e+00 1.00000000e+00]
[4.99499499e+00 1.00000000e+00]
[5.00000000e+00 1.00000000e+00]], duration=300, termination=[<pybamm.experiment.step.step_termination.VoltageTermination object at 0x0000014405304B10>], period=0.005005005004989016, direction=Discharge)
2024-11-23 14:48:24.909 - [NOTICE] logger.func(7): Cycle 23/64 (1 hour, 6 minutes, 25 seconds elapsed) --------------------
2024-11-23 14:48:24.909 - [NOTICE] logger.func(7): Cycle 23/64, step 1/1: Step([[0.00000000e+00 5.50000000e+00]
[5.00500501e-03 5.50000000e+00]
[1.00100100e-02 5.50000000e+00]
...
[4.98998999e+00 1.00000000e+00]
[4.99499499e+00 1.00000000e+00]
[5.00000000e+00 1.00000000e+00]], duration=300, termination=[<pybamm.experiment.step.step_termination.VoltageTermination object at 0x0000014405304B10>], period=0.005005005004989016, direction=Discharge)
2024-11-23 14:51:58.602 - [NOTICE] logger.func(7): Cycle 24/64 (1 hour, 9 minutes, 59 seconds elapsed) --------------------
2024-11-23 14:51:58.604 - [NOTICE] logger.func(7): Cycle 24/64, step 1/1: Step([[0.00000000e+00 5.50000000e+00]
[5.00500501e-03 5.50000000e+00]
[1.00100100e-02 5.50000000e+00]
...
[4.98998999e+00 1.00000000e+00]
[4.99499499e+00 1.00000000e+00]
[5.00000000e+00 1.00000000e+00]], duration=300, termination=[<pybamm.experiment.step.step_termination.VoltageTermination object at 0x0000014405304B10>], period=0.005005005004989016, direction=Discharge)
Traceback (most recent call last):
File "{removed folder structure due to privacy}\Imported Programs\experiment_drive_cycle.py", line 818, in <module>
drive_cycle_discharge(Wave_load, save_file = True, run_pybamm = run_pybamm, showsine = False, filename = experiment_name)
File "{removed folder structure due to privacy}\Imported Programs\experiment_drive_cycle.py", line 376, in sine_ageing
st1_sinedischarge_sol = sim.solve(starting_solution=st1_charge_sol, solver=self.solver_mode, calc_esoh=self.calcesoh, save_at_cycles = self.cyc_save_interval)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File " {removed folder structure due to privacy}\BMSenv\Lib\site-packages\pybamm\simulation.py", line 818, in solve
raise pybamm.SolverError(
pybamm.expression_tree.exceptions.SolverError: Step 'Step([[0.00000000e+00 5.50000000e+00]
[5.00500501e-03 5.50000000e+00]
[1.00100100e-02 5.50000000e+00]
...
[4.98998999e+00 1.00000000e+00]
[4.99499499e+00 1.00000000e+00]
[5.00000000e+00 1.00000000e+00]], duration=300, termination=[<pybamm.experiment.step.step_termination.VoltageTermination object at 0x0000014405304B10>], period=0.005005005004989016, direction=Discharge)' is infeasible due to exceeded bounds at initial conditions. If this step is part of a longer cycle, round brackets should be used to indicate this, e.g.:
pybamm.Experiment([(
Discharge at C/5 for 10 hours or until 3.3 V,
[1.00100100e-02 5.50000000e+00]
...
[4.98998999e+00 1.00000000e+00]
[4.99499499e+00 1.00000000e+00]
[5.00000000e+00 1.00000000e+00]], duration=300, termination=[<pybamm.experiment.step.step_termination.VoltageTermination object at 0x0000014405304B10>], period=0.005005005004989016, direction=Discharge)' is infeasible due to exceeded bounds at initial conditions. If this step is part of a longer cycle, round brackets should be used to indicate this, e.g.:
[1.00100100e-02 5.50000000e+00]
...
[4.98998999e+00 1.00000000e+00]
[4.99499499e+00 1.00000000e+00]
[1.00100100e-02 5.50000000e+00]
...
[4.98998999e+00 1.00000000e+00]
[4.99499499e+00 1.00000000e+00]
[5.00000000e+00 1.00000000e+00]], duration=300, termination=[<pybamm.experiment.step.step_termination.VoltageTermination object at 0x0000014405304B10>], period=0.005005005004989016, direction=Discharge)' is infeasible due to exceeded bounds at initial conditions. If this step is part of a longer cycle, round brackets should be used to indicate this, e.g.:
pybamm.Experiment([(
Discharge at C/5 for 10 hours or until 3.3 V,
Charge at 1 A until 4.1 V,
Hold at 4.1 V until 10 mA
])
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
-
Hi all!
Currently having some trouble with my experiments repeatedly hitting a condition where I'm unable to pass one experiment to the next, because of exceeding boundary conditions. For context, I'm loading a cell with a square waves at particular frequencies to simulate effects of rippled loading.
There are other experimental steps defined, but the but where it fails usually within the pybamm.current.step() experimental step where I am actually putting in the square wave.
Further below is the section of code where I am applying the experiment: I'm loading the battery with a Square wave just to study the effects of a rippled load. However, in the above section of code, the
duration = truncated_duration
might be set to somethng like 50s. This stepwill be multiplied bynum_cycles
, whcih might be in the something like 720 to fully deplete the cell (if the mean current of my square wave is 1C equivalent), so 72 * 50s = 1hr. I'm doing this because, as far as I'm aware the duration is restricted to 600s forpybamm.step.current()
?I've tried to play around with the termination condition, sometimes it might be
termination = voltage_termination(self.v1_terminal_limit)
, other times it might betermination = "2.7V"
as above in thepybamm.step.current()
The error is pasted below - I've included a trimmed sub-section of the log printed in the terminal just to indicate how it was running before failing. Mainly, it would appear that the cell is exceeding some boundary condition between each experiment preventing the next experiment step from being run.
This is really quite frustrating, as sometimes it seems to go straight past the termination condition, other times it does complete. The majority of the time I get the error as indicated towards the end,
is feasible due to exceeded bounds
```Would really appreciate an alternaitve suggestion to how I could setup the custom termination, the square wave current profile, or both in order to avoid this!
If it helps. I'm using the IDAKLU solver with OKane2022 parameter set, with DFN model.
Beta Was this translation helpful? Give feedback.
All reactions