Analysis of the influence of thermal energy storage on the optimal management of a trigeneration plant