Skip to content

Batt fixes#549

Merged
dguittet merged 11 commits into
patchfrom
batt_fixes
Mar 18, 2021
Merged

Batt fixes#549
dguittet merged 11 commits into
patchfrom
batt_fixes

Conversation

@dguittet

@dguittet dguittet commented Mar 11, 2021

Copy link
Copy Markdown
Collaborator

For the NMC model, relying on differences between lifetime indices to compute whether a full day has elapsed or not had difficulties when using different time steps. That issue occurred when towards the end of the day, the hourly battery would "finish" its day, then get switched over to a smaller timestep (1 min) and would run into needing to "finish" its day again-- resulting in problems. The previous fix was to make the index when the day "finishes" equal to lifetimeIndex % ts_per_day == ts_per_day - (size_t)(1. / params->dt_hr) so that the repetition wouldn't happen.

The fix here explicitly calculates elapsed day as fabs(state->nmc_li_neg->cum_dt - 1.) < 1e-7.

Also, reduce the run time of calculate_max_discharge_w fxns.

@dguittet dguittet added this to the 2020.11.29 Patch 2 milestone Mar 11, 2021
@dguittet dguittet requested a review from brtietz March 11, 2021 20:12

@brtietz brtietz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, but I have one question about edge cases in lib_battery_lifetime_nmc

Comment thread shared/lib_battery_lifetime_nmc.cpp
@dguittet dguittet merged commit 5e30992 into patch Mar 18, 2021
@dguittet dguittet deleted the batt_fixes branch March 18, 2021 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants