Optimization of electricity and hydrogen production with hybrid renewable energy systems