Clarification on battery self-discharge implementation in hour_simulation (SOC not updated?)

I noticed the following lines in the hour_simulation function (in hybrids.py and hybrids_wind.py):

battery_use = 0.0002 * soc
soc - 0.0002 * soc

It seems the second line does not modify soc (no assignment), so self-discharge is not actually applied to the battery state.

Was the intention to update SOC (e.g. soc -= 0.0002 * soc), or is self-discharge only meant to be tracked in battery_use?

@AndreasSahlberg

Best wishes,

Stuart

1 Like

Hi Stuart,

Thanks for flagging this. You are correct, the self-discharge should be applied to the battery state as well, i.e. soc -= 0.0002 * soc would be correct.

If you submit a pull request or raise an issue on GitHub it should be quick to update.

Best regards,
Andreas

Hi Andreas,

thanks for your quick response. I will do so. :slight_smile:

Best regards,

Stuart