Optimisation of multi-period renewable energy systems with hydrogen and battery energy storage: A P-graph approach