Tri and cogeneration