NREL / ssc

SAM Simulation Core (SSC) contains the underlying performance and financial models for SAM
BSD 3-Clause "New" or "Revised" License
79 stars 85 forks source link

Adaptive Timestep bug #544

Closed dguittet closed 3 years ago

dguittet commented 3 years ago

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."

brtietz commented 3 years ago

@dguittet should this be closed, or is there more work to do after #545?