During PR #523, the ChangeTimestep function of battery_t has some bugs:
- the lifetime_param's dt_hr was missing from the copy assignment operator
- the lifetime index of the battery needed to be adjusted for the new time step, otherwise the day age of the battery will be incorrect
- battery_t's copy constructor didn't correctly pair up the battery_params with the params within each component class. This is only a problem if you modify the params (as in ChargeTimestep)
Another un-related bug fixed in this PR is that the rainflow cycle processing needs some tolerance to allow for cycles that are the same DOD except by a small factor that is a result from degradation. Otherwise the rainflow_peaks can look like:
94.999718345306533, 5.0455862059404382, 94.999717794146434, 5.0456951070969751, 94.999717194336653, 5.0458097135306446, 94.999716529991715
Add an error check to ChangeTimestep to [revent changing from smaller to larger timestep in the middle of the larger time step:
"battery_t dt_hr step size can only be changed to a higher step size when the current time step is at a time step common to both the previous and new step size. For instance, if running 30-min steps, step size can only be increased to 60-min step at the hour."
During PR #523, the ChangeTimestep function of battery_t has some bugs:
Another un-related bug fixed in this PR is that the rainflow cycle processing needs some tolerance to allow for cycles that are the same DOD except by a small factor that is a result from degradation. Otherwise the rainflow_peaks can look like:
94.999718345306533, 5.0455862059404382, 94.999717794146434, 5.0456951070969751, 94.999717194336653, 5.0458097135306446, 94.999716529991715
Add an error check to ChangeTimestep to [revent changing from smaller to larger timestep in the middle of the larger time step:
"battery_t dt_hr step size can only be changed to a higher step size when the current time step is at a time step common to both the previous and new step size. For instance, if running 30-min steps, step size can only be increased to 60-min step at the hour."