This paper presents a detailed numerical analysis of a trigeneration system serving a hospital, aiming at determining the best economic operating strategy. In this paper, a novel approach is presented aiming at developing a detailed tool to be used to predict the real time performance of the trigeneration system and to optimize its operation designing efficient control strategy. To this scope, a detailed dynamic simulation model was developed in TRNSYS environment. The simulated system provides electrical, thermal and cooling energy. It includes: a natural gas fired reciprocating engine, heat exchangers for waste-heat recovery, a single-stage LiBr-H2O Absorption Chiller (ACH), a cooling tower, pumps, a backup boiler, a backup vapor-compression electric chiller, storage tanks, valves, mixers. For such components, suitable control strategies and detailed algorithms were implemented in order to develop a model as much realistic as possible. To this scope, cooling and thermal loads were estimated by implementing detailed building dynamic simulations strictly related to the trigeneration system model.Three different operating strategies were evaluated in order to minimize the plant cost and maximize the performance of the system, namely: Thermal Load Tracking mode (TLT), Maximum Power Thermal Load Tracking mode (MPTLT) and Electricity Load Tracking mode (ELT). In the first one (MPTLT), the thermal power provided by the engine is always lower or equal to the thermal demand; in the second one (TLT), the engine operates according to an On/Off strategy; in the third one (ELT), the electrical power provided by the engine is always lower or equal to the electrical demand.The results of the case study were presented on different time bases (days, weeks, years). Such results show that the ELT control strategy can achieve a better profitability, with a simple payback period, SPB, equal to 4 years. For this strategy, 256 simulations were also performed by varying the main model parameters, in order to determine the combination showing the lowest SPB value and the highest Primary Energy Saving (PES) value. The optimum and the analysis of the optimum response surface was obtained by using Design of Experiments (DoE) method, showing that the best SPB value, equal to 3.9 years, comes out choosing an engine capacity ratio equal to 1, an ACH capacity ratio equal to 1, a hot tank volume equal to 5 m3 and a cold tank volume equal to 2 m3. The best PES value, instead, is equal to 20.6% and comes out selecting an engine capacity ratio equal to 0.5, an ACH capacity ratio equal to 1, a hot tank volume equal to 6 m3 and a cold tank volume equal to 2 m3.