Hello everyone!
I am trying to find a way to replicate the solution of the 2 cycles of one simulation by solving one cycle at a time and then reinitialize. The experiment consist of [discharge, rest, charge, rest] = Cycle, in total one simulation contains 2 cycles.
There are ways to reinitialize the model in pybamm that I found:
sim.solve(starting_solution=previous_solution)
there is a time correction with t_start_shifted = np.nextafter(t_start, np.inf)
new_model = model.set_initial_conditions_from(solution = previous_solution, inplace=False)
then construct new simulation class with the new model and solve. The solution starts at t=0, there is no time correction through np.nextafter()
However I struggle to “reconstruct” the same 2-cycle solution if I use one of these methods… I thought, solving in a loop one cycle at a time and using the 1. method of re-initialization would deliver the same solution of 2-cycle solution, but it is not.
I think. the problem lies in the calculation of the consistent initial state for the next cycle after the first.
Is there a more simple way to solve one cycle after another and get same results as if solving the cycling sequence at once?
Geri