## 1 Introduction
In this way, depending on the availability of data and the characteristics of the energy system under study, such systems can be modeled as a white-box, grey-box, or black-box system [16]. A white-box model is used when detailed knowledge about the system's operation and constraints is available. In such cases, the system is described using physical and mathematical equations with clearly defined constraints. These models can be solved using optimization tools such as CPLEX for linear problems [17], while solvers such as IPOPT or KNITRO are suitable for nonlinear cases [18]. For highly nonlinear or complex systems where conventional solvers may struggle, heuristic methods such as genetic algorithms or Particle Swarm Optimization (PSO) can be applied [19]. When partial knowledge of the system exists and some historical or real-time data is available, a grey-box model can be developed by combining physical insights with data-driven components. In [20], a continuous-time stochastic grey-box model was initially developed at DTU Computeand further improved at AAU Computer Science to unlock energy flexibility in buildings with multiple temperature zones. In situations where the internal characteristics of the system are largely unknown and only data are available, black-box model can be appropriate. In this approach, machine learning algorithms are used to model and optimize system behavior. Studies have shown that neural networks and Long Short-Term Memory (LSTM) models are effective in capturing and utilizing the flexibility potential of industries, especially when detailed system information is lacking [21]. This paper explores the energy flexibility potential of salmon fish breeding pools that are supported by industrial cooling plants. These cooling plants receive brine water from the sea, which is treated and then cooled or heated to maintain the required temperature range in the breeding pools. The temperature in these pools must stay within a specific range, which can be influenced by outdoor conditions. Flexibility arises from the fact that the water temperature does not need to be kept at a single fixed value but can vary within a safe range. Based on this, an intelligent control system is developed for the cooling plant to take advantage of this thermal flexibility and respond dynamically to fluctuations in electricity prices. The study is based on a real-world case located in the Port of Hirthals in northern Denmark. Real operational data from the plant are used to create a black-box model of the system. This model is then optimized using Extreme Gradient Boosting (XGBoost) and Bayesian Optimization to improve control strategies and unlock flexibility. The main contributions of this study are as follows:  
1. Developing a black-box model for the energy consumption of a cooling plant that supplies a fish breeding pool while considering flexible temperature bounds. 2. Demonstrating the ability to unlock power-to-heat flexibility in response to dynamic electricity prices. 3. Optimizing the flexibility potential of the cooling plant using XGBoost and Bayesian Optimization supported by real-world historical data from the industrial facility. The rest of the paper is organized as follows: Section 2 presents the methodology of the suggested approach as well as the mathematical models and formulations; Section 3 explains the case study and simulation results; finally, the last section concludes the study.