A P-graph model for multi-period optimization of sustainable energy systems. (10th September 2017)