Gravar-mail: On solving the profit maximization of small cogeneration systems