-
First of all, I want to thank you for the prog_models package, which is impressive! I have a question and could not find any solution after reading all the docs and tutorials. I want to use the package for simulating a self-adjusting battery. The battery is used with intensity for a fixed period Is there a way to, e.g., store the whole battery object with its current conditions, including its current degradation level, and then call it again and simulate it further without starting from its initial state? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I solved this by myself, which, in hindsight, is quite trivial. The return values of Example |
Beta Was this translation helpful? Give feedback.
I solved this by myself, which, in hindsight, is quite trivial. The return values of
simulate_to
comprise a list of states. Setting these states as newmodel.parameters
saves the current state of the model.Example
Simulation for 100 time steps (assume that
future_loading
always returns a specific intensity for any t, e.g., 2):(_, _, states, _, event_states) = batt.simulate_to(100, future_loading, **options)
Set states of battery to final values of last observation (i.e., after simulating 100 time steps with intensity 2):
batt.parameters['x0'] = states[-1]
Now any following simulation starts as if the battery was already run with intensity 2 for 100 time steps.