A general methodology for optimal load management with distributed renewable energy generation and storage in residential housing. Issue 2 (4th March 2017)