Skip to content

fixed: battery minimum charging p_demand comes with bad side effects#61

Merged
andig merged 3 commits into
evcc-io:mainfrom
ekkea:16-battery-minimum-charging-p_demand-comes-with-bad-side-effects
Mar 15, 2026
Merged

fixed: battery minimum charging p_demand comes with bad side effects#61
andig merged 3 commits into
evcc-io:mainfrom
ekkea:16-battery-minimum-charging-p_demand-comes-with-bad-side-effects

Conversation

@ekkea
Copy link
Copy Markdown
Contributor

@ekkea ekkea commented Mar 14, 2026

Fix #59

Analysis: battery charging was forced to happen with at least p_demand if set in the request. Not meeting the constraint was loaded with a high penalty, even if the battery was fully charged. This created a weird behavior as the optimizer tried to delay full charging as long as possible in order to minimize the penalty.

Solution: introduced a second constraint that limits the charge demand to the remaining charge to reach s_max. Both constraints can be alternatively chosen by the optimizer through added binary variable which activates exclusively one of the constraints.

added test cases based on raised issues, updated one test case that now shows improved solution.

ekkea added 3 commits March 14, 2026 21:41
fix: added bianry variable array to inforce p_demand only until battery has reached s_max.
@andig andig merged commit e456cb8 into evcc-io:main Mar 15, 2026
2 checks passed
@andig andig added the bug Something isn't working label Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support min+pv charging

2 participants