## 1 Introduction  
The industrial sector is shifting toward electrification and energy self-generation, with a particular focus on renewable energy sources (RES). This transition is mainly driven by electric vehicles (EVs), battery energy storage systems (BESS), and photovoltaic (PV) panels [1]. These technologies enable companies to reduce their carbon footprint and operational costs while also decreasing their dependence on the power grid, mitigating the impact of electricity market volatility. Nonetheless, the complexity of managing and operating these different technologies often prevents the operator from extracting their full potential [2; 3]. The advancement of the Internet of Things (IoT) and the emergence of innovative communication technologies have propelled the world into a new digital era, where data analysis plays a pivotal role. Most systems are now digitized and monitored, enabling data visualization through user interfaces. This evolution has led to the appearance of new ways of improving management and understanding the behavior of complex systems. Digital twins (DTs) and cloud computing are examples of these new tools and are currently employed in a wide variety of fields such as healthcare, sports, economy, industrial engineering, or the energy sector [4]. DT use in situ measured variables, forecasts, and advanced cloud-based models to create a virtual replica of a real system, process, or service. This unlocks deeper analysis of system status, future behavior estimation, and decision-making support [5]. The application of DT and cloud-based solutions in complex energy systems has gained a lot of attention. Most studies agree on their ability to improve operations by providing better insights into current states and more accurate estimations of future behavior. The EV and energy storage sectors are a clear example of this evolution and have also embraced the DT capabilities, to enhance battery operation with energy management systems (EMSs). Authors in [6] developed a DT to improve control, energy management, and battery degradation for a hybrid EV. The DT was constantly updated using real-time data. Moreover, the DT was used to simulate several control scenarios, which allowed us to improve the EMS performance under uncertainties. Also, authors in [7; 8] reviewed several works on DT applications for EV. However, the applications for EV charging optimization were not included. Moreover, authors in [9] leveraged DT to simulate the performance of EV charging infrastructure, integrated with RES and BESS, estimating its self-sufficiency and self-consumption ratios under different sizing, demand, and generation scenarios. Nevertheless, the work does not provide an optimization framework for the EV charging infrastructure. Authors in [10] proposed an EV battery DT to estimate the state of charge (SOC) and internal resistance with an equivalent circuit model (ECM). The DT was used to estimate and optimize the EV charging in a RES-based infrastructure. However, the behavior of the remaining assets involved was not considered in the optimization. [PERSON] et al. [11] proposed a DT to enhance the accuracy of SOC and state of health (SOH) estimations of a BESS, using an ECM coupled with Kalman filtering strategies. [PERSON] et al. [12] explored the potential benefits of using DT to assess the influence of thermal management in the degradation of MWh-scale batteries by using Physics-Based Models (PBMs), demonstrating an efficiency improvement and increase in the total usable energy of the BESS considered. Furthermore, many authors have highlighted the potential of DT to optimize industrial processes. For instance, [PERSON] et al. [13] investigated their application with a focus on minimizing the environmental impact. Authors in [14; 15] proposed DT to support the optimization of manufacturing operation decision-making systems by assessing optimization scenarios in a virtual environment to predict the impact of optimized decisions on the final product and production line efficiency.