Optimal energy control of a PV-fuel cell hybrid system