A linear programming approach to the optimization of residential energy systems. (August 2016)