davidusb-geek / emhass

emhass: Energy Management for Home Assistant, is a Python module designed to optimize your home energy interfacing with Home Assistant.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Type of self-consumption optimization is always bigm, never maxmin

michaelpiron opened this issue · comments

Hi @davidusb-geek ,

In the code, I noticed that in case of a self-consumption cost function, the optimizer always applies the so-called "bigm" method, due to this hard-coded parameter:

type_self_conso = 'bigm' # maxmin

However, the documentation explains the "maxmin" method, which is never invoked due to the parameter above.
Is there an issue with the maxmin method (e.g. never leads to a solution)?

Happy to help further, based on your reply.

Yes it is hard coded to big M. It was long time ago but I think that the other method has convergence problems, probably the equations are not well posed. The big M was a second possible method but the maxmin is the elegant correct way to handle this.
Of course that you can help, all contributions are more than welcomed.
If you are interested we have another problem in the constraints section with constraints: set_def_const and treat_def_as_semi_cont. The don't seem to be compatible and are causing infeasible issues.

Ok, I will adapt the documentation to reflect the reality that self-consumption cost function uses the big M method.

regarding the other issue on constraints, is there already a bug report of this? If not, can you provide more input/evidence of the issue?

thx

regarding the other issue on constraints, is there already a bug report of this? If not, can you provide more input/evidence of the issue?

I dived into this other issue and it is solved in the current release.

Updated the optimizer documentation here: #143
It now describes that self-consumption has two methods (bigM and maxmin), and that currently only method bigM is used.