Questions about the Battery Cycle counting algorithm

  • Arthur800
  • Topic Author
More
01 Apr 2022 05:04 #10790 by Arthur800
Hello, I'm studying the SAM Battery Model, and I am focusing on the Lifetime Model. I already know that the SAM uses a rainflow counting algorithm to count the amount of cycles passed. I'd would like to know if the rainflow counting algorithm specifically used on SAM is available on the Github repository ( I couldn't find it at  github.com/NREL/ssc/blob/develop/shared/lib_battery.cpp ). I'm asking this because I tried to implement a separate cycle counting in Python with some open source library for rainflow counting and outputs obtained from simulations in SAM (total charge, SOC, DOD, average DOD), and I'm getting strange results that I would like to compare with the code SAM would use. Regarding this matter, how sound would it be to choose the SOC hourly output for cycle counting instead of average DOD? Because the two variables don't seem to exactly compliment each other in the results tables (and I must be missing some grasp on the output calculations.)

Please Log in or Create an account to join the conversation.

  • pgilman
More
01 Apr 2022 16:44 - 01 Apr 2022 17:55 #10798 by pgilman
Hi Arthur,

You can use the citation on p. 8 of DiOrio, N.; Dobos, A.; Janzou, S.; Nelson, A.; Lunstrom, B. (2015). Technoeconomic Modeling of Battery Energy Storage in SAM. 32 pp. NREL/TP-6A20-64641 ( PDF 2.6 MB ) to find a description of the rainflow algorithm SAM uses for the battery life model (it is listed as S. Downing and D. Socie, "Simple Rainflow Counting Algorithms," International Journal of Fatigue, 1982.)

The code for SAM's rainflow algorithm is here:

github.com/NREL/ssc/blob/892b81b46a66a81ed6d357bc802dd82318372c4b/shared/lib_battery_lifetime_calendar_cycle.cpp#L119

As of SAM 2021.12.02, SAM uses the hourly depth-of-discharge (DOD) value rather than the average. Note that the rainflow algorithm is based on DOD not state of charge (SOC). In the rainflow algorithm a cycle from 80% to 90% SOC and a cycle from 10% to 20% SOC would both be counted as 10% DOD and cause the same amount of degradation.
 
If you are using Python for this, the BatteryStateful module of the PySAM package allows for inputting custom rainflow cycle counts (variable name 'cycle_counts') for each single step: nrel-pysam.readthedocs.io/en/master/modules/BatteryStateful.html.

Best regards,
Paul.
Last edit: 01 Apr 2022 17:55 by pgilman.

Please Log in or Create an account to join the conversation.

  • shahzad_Javed
More
12 Jan 2023 03:02 #11827 by shahzad_Javed
Replied by shahzad_Javed on topic Questions about the Battery Cycle counting algorithm
Hi Paul!
Many thanks for the explanation. I am working on an energy system model aiming to use SOC as input to rainflow to account for cycles and then see battery degradation from the look-up table. I wonder how to solve the full and partial battery cycles issue (I can calculate full and partial cycles from rainflow algorithm output) before referring to the look-up table, as that table provides battery capacity degradation for complete cycles only. Or specifically, would you please advise how I can use the rainflow algorithm output to get battery degradation? I currently have count, range, and mean values as output from the rainflow algorithm.

Many thanks, and I enjoyed reading your NREL report and looking forward.

Please Log in or Create an account to join the conversation.

Moderators: pgilman
Powered by Kunena Forum