In the current energy scenario, system design and operation strategies are paramount especially for plants fed by renewable sources and/or whose production is strictly connected to the users demand. The systems optimization must consider the possibility of energy storage and of the conversion among different forms of energy. In this paper, a hybrid cogeneration system composed by a cogenerative internal combustion engine, a photovoltaic plant, a boiler and a pump as turbine is investigated. Different energy storage options are included: a pack of batteries, a water reservoir and a hot thermal storage. By applying the Particle Swarm Optimization method, the devices size and hourly operation are simultaneously optimized. The minimization of the overall cost is the optimization goal, while the main constraint is the fulfilment of the user request (electricity, heat and water). Results show that the cogenerative internal combustion engine supplies the 87% of the electricity and the 19% of the heat during winter time while, during summer period, it supplies the 89% of the electricity and the all heat. The use of a pump as turbine allows to reduce the battery discharge rate and the Depth of Discharge with a consequent increase of the battery lifetime. (C) 2015 Elsevier B.V. All rights reserved.