Citation: Gronier, T.; Maréchal, W.; Geissler C.; Gibout, S. Usage of GAMS-Based Digital Twins and Clustering to Improve Energetic Systems Control. Energies 2023, 16, 123. https://doi.org/ 10.3390/en16010123 Academic Editors: Alfeu J. Sguarezi Filho, Jen-Hao Teng, Lakshmanan Padmavathi and Kin-Cheong Sou Received: 29 October 2022 Revised: 29 November 2022 Accepted: 17 December 2022 Published: 22 December 2022 Copyright: © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/). energies Article Usage of GAMS-Based Digital Twins and Clustering to Improve Energetic Systems Control Timothé Gronier 1,2,3 , William Maréchal 1, *, Christophe Geissler 1 and Stéphane Gibout 2, * 1 Advestis, 75008 Paris, France 2 Universite de Pau et des Pays de l’Adour, E2S UPPA, LaTEP, 64053 Pau,France 3 ADERA, 33608 Pessac, France * Correspondence: wmarechal@advestis.com (W.M.); stephane.gibout@univ-pau.fr (S.G.) Abstract: With the increasing constraints on energy and resource markets and the non-decreasing trend in energy demand, the need for relevant clean energy generation and storage solutions is growing and is gradually reaching the individual home. However, small-scale energy storage is still an expensive investment in 2022 and the risk/reward ratio is not yet attractive enough for individual homeowners. One solution is for homeowners not to store excess clean energy individually but to produce hydrogen for mutual use. In this paper, a collective production of hydrogen for a daily filling of a bus is considered. Following our previous work on the subject, the investigation consists of finding an optimal buy/sell rule to the grid, and the use of the energy with an additional objective: mobility. The dominant technique in the energy community is reinforcement learning, which however is difficult to use when the learning data is limited, as in our study. We chose a less data-intensive and yet technically well-documented approach. Our results show that rulebooks, different but more interesting than the usual robust rule, exist and can be cost-effective. In some cases, they even show that it is worth punctually missing the H 2 production requirement in exchange for higher economic performance. However, they require fine-tuning as to not deteriorate the system performance. Keywords: energy management system; digital twins; general additive models; green H 2 1. Introduction With the increasing constraints on energy and resource markets and the non-decreasing trend in energy demand, the need for relevant clean energy generation and storage solu- tions is growing and is gradually reaching the individual home [1,2]. Unfortunately, the intermittent nature of most renewable energy sources makes it difficult for the residential consumer to self-consume it. Furthermore, small-scale energy storage is still an expensive investment in 2022 and the risk/reward ratio is not yet attractive enough for individual homeowners. The solution studied here dedicates excess energy to a collective use, which in this case is the daily filling of a hydrogen bus. This usage fits into the European plan for hydrogen development [3] and some hydrogen buses are already in service in Europe [4]. Following our previous work on this case study [5], the investigation consists of finding an optimal buy/sell rule to the grid, and the use of the energy with an additional objective: mobility. The dominant technique in the energy community is reinforcement learning, which is however difficult to use when the learning data is limited, as in our study. We therefore chose a less data-intensive and yet technically well-documented set of tools. 1.1. Context The importance of Energy Management Systems (EMS) has increased over the years and is moving down to individual systems, such as individuals or groups of dwellings, or solar community. In a previous article [5] we studied the opportunity of integrating energy storage technologies for such scales. In this article we will focus on the generation of H 2 in Energies 2023, 16, 123. https://doi.org/10.3390/en16010123 https://www.mdpi.com/journal/energies