Full text
Contents lists available at ScienceDirect Engineering Applications of Artificial Intelligence journal homepage: www.elsevier.com/locate/engappai Research paper Electric power optimization in solar trough plants with deep learning-based model predictive control Sara Ruiz-Moreno ∗, Antonio J. Gallego, José Ramón D. Frejo , Eduardo F. Camacho Dept. de Ingeniería de Sistemas y Automática, University of Seville, Camino de los Descubrimientos, no number, E-41092, Seville, Spain A R T I C L E I N F O Keywords: Solar energy Parabolic-trough collectors Artificial neural networks Deep learning Power optimization A B S T R A C T On-site computational capabilities limit the optimization of electricity production in commercial plants. This work addresses the implementation of a virtual operator for electric power maximization in parabolic-trough collector plants by manipulating the flow rate circulating through the pipes with a neural network-based procedure. A model predictive control (MPC) strategy is proposed using nonlinear models to predict the system’s response. The effect of including diverse parts of the plant in the prediction model and using different objective functions (the model of the pump and the pipes and the difference between optimizing thermal and electric power) is analyzed. First, two control layers are implemented: one for obtaining the temperature setpoints and one for computing the flow rate. Since the nonlinear MPC cannot be computed in real-time for medium and large plants, an artificial neural network is trained to learn the optimal solution and lower the computational burden, reducing a 2-layer MPC strategy into only one neural controller that internally decides the operating point. The simulation results obtain a mean time reduction of 99.99995%, while the electricity production for the studied cases is only reduced by around 1%, making the controller implementable in real-time in actual plants. 1. Introduction The reduction of emissions to the atmosphere is one of the main challenges today. For this purpose, research in renewable energy sources is on the trend to reduce the impact of fossil fuels (Blanco and Miller, 2017). Renewable energy is experiencing rapid global growth that will help reduce carbon emissions while supplying the expanding electricity demands of the present-day (Du et al., 2019). According to the World Energy Council, the share of solar and wind power has increased to 12% of the global energy generation, and the share of renewable energy sources in the global power output will be at least 50% by 2050 (Anon, 2024). One of the most relevant energy sources, if not the most, is the Sun. Solar energy is the cleanest renewable energy source, which makes it a good alternative to fossil fuels (Ajbar et al., 2022), although one of the challenges today is still to make it efficient and competitive. Due to its importance and abundance, solar energy has attracted more and more interest, and the U.S. National Academy of Engineering and the European Commission have identified the objective of increasing its economic benefit and competitiveness as one of the significant challenges of the century (Anoun, 2019). ∗Corresponding author. E-mail addresses: [email protected] (S. Ruiz-Moreno), [email protected] (A.J. Gallego), [email protected] (J.R.D. Frejo), [email protected] (E.F. Camacho). Solar energy technologies are divided into two types: photovoltaics (PV), which directly transforms the sunlight into electricity and concentrating solar power (CSP), which produces steam to drive a turbine generator. Within CSP systems, this work focuses on parabolic-trough collectors (PTC), which use parabolic mirrors to concentrate solar rays into a fluid contained in a pipe (Gallego et al., 2019). Solar thermal energy can be stored in thermal energy storage (TES) tanks, which allows them to produce energy during the night and makes them competitive. Recently, many studies have been conducted to improve their performance, contributing to its growth and making PTCs the most mature of all CSP technologies (Ajbar et al., 2022). As reported by Tagle-Salazar et al. (2020), PTCs are used in numerous industrial applications, such as electricity generation, seawater desalination, or water decontamination, and there are numerous plants under construction around the world. In general, the challenges faced by the CSP industry are their use in countries where they have hardly been built yet, market resilience, competition from natural gas, and low investment in some countries (Anon, 2022a). Traditionally, the control objective in PTC plants has been to maintain the outlet temperature at the desired level by manipulating the flow rate Kannaiyan and Bokde (2022). This allows the plant to be https://doi.org/10.1016/j.engappai.2025.110832 Received 14 November 2023; Received in revised form 1 January 2025; Accepted 7 April 2025 Engineering Applications of Articial Intelligence 154 (2025) 110832 Available online 3 May 2025 0952-1976/© 2025 The Author(s). Published by Elsevier Ltd. This is an open access article under the CC BY license ( http://creativecommons.org/licenses/by/4.0/ ).
S. Ruiz-Moreno et al. Nomenclature Parameters and variables 𝛿sDeclination (◦) 𝜖Effective roughness (m) 𝜂Efficiency (−) 𝜇Dynamic viscosity (mPa s) 𝜔s(t) Hourly angle (◦) 𝜌(𝑇)Density (kg/m3) 𝐴Pipe cross-sectional Area (m2) 𝐶(𝑇)Specific heat capacity (J/(kg ◦C)) 𝐺Collector aperture (m) 𝑔Gravity of Earth (m/s2) 𝐻l(𝑇)Thermal loss coefficient (W/(m2◦C)) 𝐻t(𝑇)Convective heat transfer coefficient (W/ (m2◦C)) 𝐼(𝑡)Direct solar irradiance (W/m2) 𝐾opt Optical efficiency (−) 𝐿Tube perimeter (m) 𝐿loop Loop length (m) 𝐿pPipe length (m) 𝑛o(𝑡)Geometric efficiency (−) 𝑞(𝑡)Volumetric flow rate (m3∕s) 𝑆Total area of the field (m2) 𝑡Time (s) 𝑇(𝑡)Temperature (◦C) 𝑋(𝑡)Neural network’s input vector 𝜙Weighting factor (−) 𝑎Neuron’s output (−) 𝑏Neuron’s bias unit (−) 𝐸cSolar constant (−) 𝑔Activation function (−) 𝐻pPrediction horizon (−) 𝐻uControl horizon (−) 𝐽dJulian day (−) 𝐽Cost functionW 𝑘Timestep (−) 𝑛Number of neurons (−) 𝑡(𝑡)Transmittance (W/ m2K) 𝑤Neuron’s weight vector (−) 𝑌(𝑡)Neural network’s output vector Subscripts a Ambient el Electric f Fluid in Input ini Initial loop Mean for the entire loop m Metal mean Mean between input and output out Output p Pump pred Predicted ref Reference sg Steam generator th Thermal stabilized before changing the setpoint to fulfill the different requirements of the operators. On the contrary, some references address the maximization of the power obtained. For example, the work by Frejo and Camacho (2020) maximizes the thermal power of the plant and states that, in terms of thermal power, it is preferable to operate the plant at low temperatures. Another interesting approach is to focus on electricity production, as in the work by Camacho and Gallego (2013). PTC plants are highly nonlinear, time-variant, and dominated by complex dynamics, making it difficult for traditional control techniques to regulate the flow rate. Model predictive control (MPC) can cope with the disturbances of solar thermal plants while taking into account some constraints and fulfilling different criteria. Different linear MPC strategies have been used to address the control specifications. Gallego et al. (2018a) implement a gain scheduling MPC controller that combines linear MPC with a feedforward controller to linearize the system response. Wang et al. (2022) propose a multimodel adaptive predictive scheduling controller of the outlet steam temperature of a PTC plant. Marín et al. (2019) use an MPC strategy based on early switch-off to maximize the thermal energy and improve the efficiency in a swimming pool that works with a solar collector and biomass. Nonlinear MPC controllers can deal with the dynamics of solar thermal plants governed by high nonlinearities. The drawback of this technique is the computational cost of solving a complex optimization problem at each sample time, especially in the case of large plants. Different approaches have been proposed in the literature to address this problem, and it is the subject of current research. For instance, Masero et al. (2022) propose a coalitional MPC approach based on market supply and demand for thermal power maximization. A nonlinear fuzzy MPC controller for reducing the prediction time is proposed by Escaño et al. (2021) for regulating the outlet temperature around given setpoints. Pataro et al. (2021) propose the use of a mixedlogical dynamic model, which is linear in the state space, for controlling hybrid solar thermal plants considering variations in load demand. A quasi-linear parameter varying MPC controller is proposed by Morato et al. (2021) for temperature regulation of a solar collector solving a min–max problem. Frejo and Camacho (2020) propose a distributed algorithm to optimize the plant loops. The ultimate goal of commercial plants is to obtain the highest benefit, which is achieved by the maximization of electricity production. This requires using complex models and solving highly time-demanding optimization problems. However, the computational capabilities of on-site computers are usually minimal, and solar thermal plants are controlled with sampling times of less than one minute (Camacho et al., 2012). Another issue with the implementation of control techniques in commercial plants is that they are usually installed on a centralized server (Gallego et al., 2022). This further underscores the need to reduce the computational burden and simplify the controller as much as possible, posing constraints on computation times and requiring controllers that are easy to implement. A way to approach this issue is using an artificial neural network (ANN). The application of ANNs in the literature is receiving growing attention for their ability to reproduce nonlinear functions and their fast implementation. In industrial applications, their use is generally more focused on system modeling to reduce prediction times. For example, the work by Lee et al. (2022) analyzes the use of an ANN in the prediction model of an MPC controller for thermal energy storage with a metaheuristic algorithm for the solver, and Hassanpour et al. (2022) use recurrent neural networks for modeling a chemical reactor in an MPC scheme. The work by Zaaoumi et al. (2021) compares three models for estimating the hourly electric production in a PTC plant and concludes that the best performance is obtained with a neural network. Regarding the application of ANNs directly to control the system, although it is much less frequent, some examples can also be found in the literature. For instance, Norouzi et al. (2022) apply recurrent neural networks both to model a combustion engine and to substitute an MPC Engineering Applications of Articial Intelligence 154 (2025) 110832 2
S. Ruiz-Moreno et al. controller that uses it for predictions. The work of Chanfreut et al. (2021) uses a feedforward ANN to initialize the Lagrange multipliers in a distributed MPC based on dual decomposition for a 16-tank system. Solar plants still do not have many applications. Ammar et al. (2013) use an ANN to obtain the operating point in photovoltaic-thermal panels, Sun et al. (2017) propose the use of ANNs to control residential photovoltaic systems based on approximate dynamic programming, and Cervantes-Bobadilla et al. (2021) use an inverse artificial neural network with particle swarm optimization to obtain the flow rate of a PTC given the desired temperature. Although ANNs have been proposed in the literature to model the plants used by the controllers to reduce computation times, this work aims to directly replace the complete controller, drastically augmenting the reduction. A previous work addressed the computation times by applying a neural network to reproduce the behavior of an MPC controller (Ruiz-Moreno et al., 2021), but the control objective was to maximize the thermal power obtained instead of the electric power, which is the actual product of interest in a commercial plant. Optimizing thermal power instead of electric power is more straightforward to solve since the problem can easily be assimilated into a temperature minimization problem. For given design parameters, maximizing thermal power implies minimizing thermal losses to the environment. This is produced at lower working temperatures. When optimizing electric power, the optimal operating point varies throughout the day (depending on the temperature, position, and radiation of the Sun). This is added to the fact that the plant operates in transient mode, making the optimization problem nontrivial and hindering the application of a neural network. The control problem in PTC plants is highly nonlinear, and the more accurate the models are, the more complicated their control and the more computational time it requires, especially in plants with many loops such as Mojave (282) (Anon, 2022b) or Solana (808) (Anon, 2022c), where the loops must be controlled by sectors, and no entirely distributed control strategies can be applied. Given the challenge of controlling the plant, this work aims to improve the controller developed in Ruiz-Moreno et al. (2021) with a two-layer MPC strategy: one external layer for computing the temperature setpoints and one internal layer for regulating the plant around those setpoints by manipulating the flow rate. This allows the system to reach optimal temperatures and facilitates the control process. In this paper, a comparative analysis is presented, demonstrating how results improve when additional elements are incorporated into the objective function. Next, a neural network is applied to learn from the two layers of MPC controllers and reduce the computational burden. This work investigates the use of one neural network per layer and one neural network to substitute the whole control strategy. The results are obtained by simulation of the ACUREX plant. The main advantages of this approach with respect to the previous work are as follows: •A more accurate model of the actual plant. This is achieved by including pump consumption and pipes. •An easier implementability. The radiation profiles are not assumed to be known by the controller. •Electric power optimization, instead of thermal power, to improve the performance and teach the neural network. To the best of the author’s knowledge, this is the first time that this approach has been applied to electrical power maximization in solar thermal plants since neural networks had been previously used in this type of plant for tasks such as fault detection (Ruiz-Moreno et al., 2022), modeling (Cox et al., 2019), estimation (Ghritlahre and Prasad, 2018) and thermal power maximization (Masero et al., 2023), which complexity is different from that of an electrical power maximization problem. Hereby, the main contributions of this work are the following: •The use of ANNs to maximize electric power in PTC systems with satisfactory results and negligible computation times. Fig. 1. ACUREX collector loops. •The reduction of a two-layer methodology into a single control step. •An analysis of the effect of considering the pipes and the pump in the control system, usually neglected in the literature. •A detailed comparison of outlet temperature maximization and minimization, thermal power maximization, and electric power maximization. The remainder of this paper is as follows. Section 2 provides a description of the PTC plant and its models. Section 3 describes the implementation of the 2-layer MPC controller and the artificial neural networks. Then, Section 4 shows some training and simulation results. Section 5 gives some discussion, and finally, Section 6 draws some conclusions and remarks on some lines of future work. 2. System description This section presents the plant used to evaluate the methodology. In this work, the simulations are carried out for one loop of ACUREX (Camacho et al., 2012), a PTC plant of 1 MW that was located at the Plataforma Solar de Almería. It is composed of 10 loops of single-axis East-West aligned collectors arranged in 12 modules of 4 collectors. The loops are 172 m long and include an active part of 142 m that receives solar radiation and a passive part of 30 m isolated from solar radiation. The heat transfer fluid is Therminol 55 thermal oil, with the density 𝜌f and specific heat capacity 𝐶f of Eqs. (1) and (2). The collector loop is shown in Fig. 1. The ACUREX plant is provided with a sun-tracking system that makes the mirrors rotate around an axis parallel to the pipe axis. It is based on the voltage differential between two photodiodes situated on the collector axis (Camacho et al., 2012). 𝜌f= 903 − 0.672𝑇f(1) 𝐶f= 1820 + 3.478𝑇f(2) Fig. 2 shows a scheme of one collector loop with the pipes at the input and output of the field and the steam generator. The collectors and the pipes are modeled with a distributed parameter model, and the steam generator is modeled as a temperature drop of 80 oC. Assuming the field is perfectly balanced and all loops have the same efficiency, the field is modeled as an equivalent loop. 2.1. Concentrated parameter model The concentrated or lumped parameter model is used to implement a forward controller (Camacho et al., 2012). It provides a simplified Engineering Applications of Articial Intelligence 154 (2025) 110832 3
S. Ruiz-Moreno et al. Fig. 2. Scheme of one collector loop with pipes and steam generator. description of the plant with the internal energy variation of the fluid and is given by Eq. (3), with the notation of the nomenclature section. The rest of the coefficients that make up the equation are obtained for the loop using the mean values as 𝐶loop =𝐿loop𝜌m𝐶m𝐴f and 𝑃cp = 𝜌m𝐶m. 𝐶loop 𝑑𝑇out 𝑑𝑡 =𝑛o𝐾opt𝐼𝑆 +𝑞𝑃cp(𝑇in −𝑇out) + 𝐻l𝐴(𝑇a−𝑇mean)(3) 2.2. Distributed parameter model To simulate the system, the distributed parameter model given by the partial differential Eqs. (4) and (5) provides a description of the energy balances in the metal and the fluid with spatially distributed variables (Camacho et al., 2012). A uniform local concentration ratio is assumed since the dimensions of the reflector and receiver are assumed to be equal along the loop, except for the passive parts. The temperature of the metal is assumed to be radially constant. The loop is discretized longitudinally into 172 segments of 1 m and is computed with an integration time of 0.25 s to facilitate problem resolution. 𝜌m𝐶m𝐴m 𝜕𝑇m 𝜕𝑡 =𝑛o𝐺𝐾opt𝐼+𝐻l𝐺(𝑇a−𝑇m) + 𝐿𝐻t(𝑇f−𝑇m)(4) 𝜌f𝐶f𝐴f 𝜕𝑇f 𝜕𝑡 +𝑞𝜌f𝐶f 𝜕𝑇f 𝜕𝑥 = −𝐿𝐻t(𝑇f−𝑇m)(5) The parameters of the metal in the system are 𝜌m= 7800 kg/m3, 𝐶m= 550 J/Kg◦ C, 𝐴m= 2.4806 ⋅10−4 m2, 𝐺= 1.82 m, 𝐿= 7.98 ⋅10−2 m and 𝐴f= 5.0671⋅10−4 m2. The thermal loss coefficient 𝐻l is given by Eq. (6) (it includes the radiation and external convection resistances), and the coefficient of convective heat transfer of the inner tube 𝐻t is calculated by Eq. (7) (Camacho et al., 2012). 𝐻l= 0.00249 (𝑇f−𝑇a)− 0.06133 (6) 𝐻t=𝑞0.8(2.17 ⋅106− 5.01 ⋅104𝑇f+ 4.53 ⋅102𝑇2 f − 1.64𝑇3 f+ 2.1⋅10−3𝑇4 f)(7) The geometric efficiency is sometimes referred to as 𝑐𝑜𝑠(𝜃) and depends on the collector dimensions, declination, latitude, hourly angle, solar hour, and Julian day (Gallego et al., 2018b). It is obtained with the relation between the normal vector of the mirror and the radiation beam vector. For a plant like ACUREX, which is oriented East-West, the Sun is tracked on elevation, and the geometric efficiency is obtained from Eq. (8) (Camacho et al., 2012), where 𝛿s and 𝜔s are the declination and the hourly angle. 𝑛o=(1 − cos2(𝛿s) sin2(𝜔s))1 2(8) 2.3. Pipes The pipes are modeled using the distributed parameter model from Eqs. (4) and (5), but in this case, the pipes are insulated and the parameters are different (Camacho and Gallego, 2013). The resulting model is described by Eqs. (9) and (10), with 𝐴f= 6.4⋅10−3 m2, 𝐴m= 1.5⋅10−3 m2, 𝐿= 0.09𝜋 m, and 𝑞field = 10𝑞. This last consideration is due to the fact that this pipe collects the output from all loops. The tubes are divided into 140 segments of 1 m. 𝜌m𝐶m𝐴m 𝜕𝑇m 𝜕𝑡 =𝐿𝐻t(𝑇f−𝑇m)(9) 𝜌f𝐶f𝐴f 𝜕𝑇f 𝜕𝑡 +𝑞field𝜌f𝐶f 𝜕𝑇f 𝜕𝑥 = −𝐿𝐻t(𝑇f−𝑇m)(10) 2.4. Pump The consumption of the pump (𝑃p) (Camacho and Gallego, 2013; Kundu et al., 2015) affects the net power obtained. It is usually neglected since its value is low compared to the thermal and electric powers. However, it can be considered in the optimization problem’s cost function. This work studies the difference in the controlled system when it is included. A steady state is assumed, and the losses of the rest of the loops are neglected since the control system only considers one loop. It is modeled as a sum of friction and inertia and in Eq. (11). 𝑃p=𝑞𝜌f𝑔ℎ 𝜂pump =𝑞 𝜂pump (8𝑓𝐿p𝑞2 𝑔𝜋2𝐿5+16𝑞2 𝑔𝜋2𝑑4)(11) where 𝜂pump = 0.9, 𝑔= 9.81 m/s2, 𝐿= 2.54⋅10−2. The value of the pump efficiency is assumed, as it was not available from the old ACUREX plant, and it does not override the methodology and the conclusions drawn from this study. The pump consumption depends on the Barr’s friction coefficient 𝑓 and the Reynolds number 𝑅𝑒, given by Eqs. (12) and (13) (Punmia Engineering Applications of Articial Intelligence 154 (2025) 110832 4
S. Ruiz-Moreno et al. et al., 1995), where the dynamic viscosity is computed by Eq. (14), obtained by least squares and with manufacturer data. 1 √𝑓 = −2 log10 (𝜖r 3.7+5.1286 𝑅𝑒0.89 )(12) where 𝜖r=𝜖∕𝐿= 7.874 ⋅10−4 m. 𝑅𝑒 =𝜌f𝑞 𝐴f𝜇(13) 𝜇= 3.558 − 0.0435𝑇f+ 2.2860 ⋅10−4𝑇2 f− 5.5037 ⋅10−7𝑇3 f+ 4.9425 ⋅10−10𝑇4 f (14) 2.5. Thermal and electric power The thermal power (𝑃th) is computed using Eq. (15) evaluated in the steam generator, using the mean temperature between its input 𝑇sg,in (which is the output of the pipe located after the collectors) and its output 𝑇sg,out. 𝑃th =𝑞𝜌f𝐶f(𝑇sg,out −𝑇sg,in)(15) The power cycle is simplified by a Rankine cycle. The power conversion system is modeled as a relation between oil temperature and cycle efficiency (Goswami et al., 2000). 𝑇sg,out and 𝑇sg,in correspond to the hold and cold focus temperatures in the Rankine cycle. The electric power (𝑃el) is the product of the thermal power and the Rankine efficiency 𝜂rank, as in Eq. (16). The hot and cold focus temperatures are assumed to be the inlet temperature of the steam generator and the ambient temperature. The remaining parameter is 𝐾= 0.772, a constant that models the efficiency loss with respect to the Carnot cycle and is estimated with the equations of the power conversion system described by Camacho et al. (2012). As described in Camacho and Gallego (2013), 𝐾 is obtained by adjusting a curve with three points from the actual Rankine cycle to approximate the modeled Rankine cycle to the real one. 𝑃el =𝜂rank𝑃th =𝐾(1 − 𝑇a 𝑇sg,in )𝑃th (16) 3. Methodology proposed The controllers proposed in this paper are described in this section. First, two MPC controllers are applied to compute the optimal control signals along the prediction horizon, and then a neural network is trained to approximate the values of the flow rate with much lower times than the MPC controller. The MPC controllers are applied in two stages: one for obtaining the optimal temperatures and another for calculating the flow rate required. The computation of the two layers separately allows the temperatures to stabilize before changing the operating point, facilitating the resolution of the optimization problems. As remarked by Frejo and Camacho (2020), the thermal power is maximized by increasing the flow rate (as the thermal power dependency on the flow rate is stronger than on the fluid properties and the thermal drop in the steam generator is nearly constant), which leads to a minimization of the temperature. With the addition of the Rankine efficiency to compute the electric power, as shown by Eq. (16), the problem loses convexity and the optimal temperatures do not correspond to the minimum because of the ratio 𝑇a∕𝑇in sg . Figs. 3and 4 show the contour lines of the thermal and electric powers obtained by simulating the plant with constant values of irradiance and flow rate, and 𝑇a= 25 oC, 𝑛o= 1. The analysis highlights the need for advanced control techniques and models that adequately describe the system. Note that this thermal power does not correspond to that which would be provided by the collector loop if it were separated from the rest of the plant, since the flow loop is closed. Fig. 3. Contour lines of the thermal power received by the steam generator from the collector, obtained from different simulations with constant inputs. It can be understood as the main component of the cost function that would be solved by controlling the system in one stage. The red lines represent the points where the temperature reaches the limits of 200 oC and 300 oC. Fig. 4. Contour lines of the electric power received by the steam generator from the collector, obtained from different simulations with constant inputs. It can be understood as the main component of the cost function that would be solved by controlling the system in one stage. The red lines represent the points where the temperature reaches the limits of 200 oC and 300 oC. Fig. 5. Scheme of the proposed control strategy. A first MPC controller provides the temperature set-point and a second one provides the flow rate. 3.1. Power optimization The proposed controller is developed in two layers, as shown in Fig. 5. The first layer computes the optimal temperature reference for maximizing the obtained power at a higher level, and the second one provides the flow rate required to reach those references with a lower step time. Both controllers have the structure of MPC. 3.1.1. First layer The first control layer provides the optimal temperature set points as in Camacho and Gallego (2013), but using the distributed parameter model, with an MPC controller every 15 min, which is approximately Engineering Applications of Articial Intelligence 154 (2025) 110832 5
S. Ruiz-Moreno et al. the transport delay in this plant (Camacho et al., 2012). The prediction model employed is the distributed parameter model, and the predictions include a feedforward controller to compute the future values of the system’s flow rate. This allows one to predict not only the response of the system but also the flow rates that will be necessary to achieve each temperature, enabling predictions of several future instants. The equation of the feedforward derives from the concentrated parameter model of Eq. (3) in steady-state, and it has a sample time of 30 s. The flow rate is computed by Eq. (17) and is only used for prediction purposes. The reference temperature is saturated so that it is always 10 degrees over the outlet temperature to avoid negative flow rates. The prediction horizon 𝐻p1 is 6.5 h. 𝑞=𝑛o𝐾opt𝑆𝐼 −𝐻l𝐴(𝑇mean −𝑇a) 𝑃cp(𝑇ref −𝑇in)(17) The final aim is to train a neural network using the data obtained with this controller. Although future irradiance values are not available in the final application, they can be used to obtain the training data. A secondary feature of the neural networks is an internal irradiance prediction. For this purpose, future irradiances are assumed to be previously known for the MPC controller along the prediction horizon. This provides prediction abilities to the neural network that will be used for real-time operation. In this way, the ANN saves significant computational costs in computing the distributed parameter model and making predictions. Nevertheless, an exact model for forecasting solar radiation could be used, increasing the computational burden. The cost function is given by Eq. (18), where P can either be the thermal power (Eq. (15)), the thermal power with the pump consumption, the electric power (Eq. (16)) and the electric power with the pump consumption. The resulting optimization problem is given by Eq. (19). 𝐽1= −𝑃(𝐻p1)(18) 𝑇∗ ref(𝑘) = arg min 𝑇ref 𝐽1(𝑘) 𝑠.𝑡. { system dynamics 𝑇ini − 15 oC< 𝑇ref < 𝑇ini + 15 oC (19) To avoid local minima, the problem is solved around an initial point 𝑇ini(𝑘) in a range selected by trial and error. This point is obtained from a simple optimization using a static model, where all variables are considered constant, the temperature is assumed to follow the reference, and the flow rate is approximated by Eq. (17). The constraints to this pre-optimization problem are a minimum of 205 oC and a maximum of 295 oC in the outlet temperature. 3.1.2. Second layer The MPC controller has a sample time of 1 min to alleviate computing time (Frejo and Camacho, 2020), and prediction and control horizons of 12 and 10 min (𝐻p2= 12 and 𝐻u2= 10). As in the first layer, the predictions are made using the distributed parameter model in the collectors and the pipes. The cost function is given by Eq. (20) with the weighting factor 𝜙= 6 ⋅104 to avoid sudden changes in the control signal that could damage the actuators. The maximum pressure drop in each loop imposes the hard constraints of a minimum flow rate of 0.2 l/s and a maximum of 1.2 l/s. 𝑘 is each simulation instant, as shown by Eq. (21). 𝐽2= 𝐻p2 ∑ 𝑘=1 (𝑇ref −𝑇out)2+ 𝐻u2 ∑ 𝑘=1 𝜙(𝑞(𝑘− 1) − 𝑞(𝑘))2(20) 𝑞∗(𝑘) = arg min 𝑞𝐽2(𝑘) 𝑠.𝑡. { system dynamics 0.2 l/s < 𝑞 < 1.2 l/s (21) 3.2. Artificial neural networks Artificial neural networks (Abiodun et al., 2018) are function approximators formed by different nodes that compute a linear regression problem, as in Eq. (22), where 𝑛(𝑙) is the number of neurons in each layer 𝑙, 𝑤(𝑙−1) 𝑗𝑖 is the kernel between neurons 𝑗 and 𝑖 of layer 𝑙− 1 and 𝑏(𝑙−1) 𝑖 is the bias unit. The activation function 𝑔(𝑙) 𝑖 defines the state of each neuron – active or nonactive – and facilitates the training process by adding limits to its output and simplifying the gradients. The combination of nodes and activation functions results in the resolution of a nonlinear problem. The transfer function is known as the one located at the last layer and contains the activation function of the last layer with a transformation of the data to the output, although in the literature, it is commonly considered another term for the same concept (activation function). 𝑎(𝑙) 𝑖=𝑔(𝑙) 𝑖⎛⎜⎜⎝ 𝑛(𝑙−1) ∑ 𝑗=1 𝑤(𝑙−1) 𝑗𝑖 𝑎(𝑙−1) 𝑗+𝑏(𝑙−1) 𝑖⎞⎟⎟⎠ (22) In this work, the neural networks used are multilayer feed-forward back propagation (FFBP) with sigmoid tangent activation functions in the hidden layers and linear functions in the outputs. The sigmoid tangent function translates the neuron’s output to an active-non-active state with a smooth gradient, allowing the intermediate data to remain in the [−1,1] range. The output layer uses a linear function to produce a nonconverted output. The hidden layers are intermediate layers that transform the information. The data are scaled in the range [−1,1] because of the use of tangent functions and divided into training (70%), validation (15%), and test (15%) subsets. The neural networks are trained with Levenberg–Marquardt backpropagation (Lillicrap et al., 2020), which is an efficient method when the number of parameters in the neural network is not excessive. It optimizes using the sum of squared errors as a loss function. Two versions of neural networks were tested. The first is a unique neural network that substitutes both control layers (ANN 1). The inputs to this ANN are the variables of the concentrated parameter model: 𝑋1(𝑘) = [𝑞(𝑘− 1), 𝑇in, 𝑇out, 𝑇1,𝑇2, 𝑇3, 𝑇4, 𝑇a, 𝐼(𝑘),𝐼pred(𝑘+ 2|𝑘),𝐼pred(𝑘+ 4|𝑘),…, 𝐼pred(𝐻p|𝑘), 𝑛o]𝑇, formed by the previous flow rate, the inlet and outlet temperatures, the temperatures at the center of each collector, the ambient temperature, the irradiance of each two prediction instants, and the geometric efficiency. The output is the flow rate: 𝑌1(𝑘) = 𝑞(𝑘). The number of inputs and prediction instants is based on the previous work developed by the authors (Ruiz-Moreno et al., 2021). The second approach uses one neural network per layer. The firstlayer ANN (ANN 2.1) receives the same inputs as the unique ANN, except for the irradiance, which in this case is taken every 15 min for 1 hour: 𝑋21(𝑘) = [𝑞(𝑘− 1), 𝑇in, 𝑇out, 𝑇1,𝑇2, 𝑇3, 𝑇4, 𝑇a, 𝐼(𝑘),𝐼pred(𝑘+ 15|𝑘),𝐼pred(𝑘+ 30|𝑘),…, 𝐼pred(60|𝑘), 𝑛o]𝑇, 𝑌21(𝑘) = 𝑇ref. The inputs to the second-layer ANN (ANN 2.2) are the same as for the unique ANN with the addition of the reference temperature: 𝑋22(𝑘)=[𝑞(𝑘− 1), 𝑇in, 𝑇out, 𝑇1,𝑇2, 𝑇3, 𝑇4, 𝑇a, 𝐼(𝑘),𝐼pred(𝑘+ 2|𝑘),𝐼pred(𝑘+ 4|𝑘),…, 𝐼pred(𝐻p|𝑘), 𝑛o, 𝑇ref]𝑇, 𝑌22(𝑘) = 𝑞(𝑘). During the training process, the reference is obtained from the controller, but in simulation, it is replaced by the one obtained from the first-layer ANN. The outputs of the neural networks are those from each controller: reference temperature for the first layer and flow rate for the second one. 3.2.1. Irradiance prediction In a real-time operation, the values of future irradiance are not available. Although the neural networks can learn from the controller and indirectly make predictions internally, they receive simple predictions to help the process. As stated in the previous work (Ruiz-Moreno et al., 2021), the neural networks do not need the whole irradiance information. They can perform well without knowing all future irradiances, but their performance decreases when they are only fed the current value. Engineering Applications of Articial Intelligence 154 (2025) 110832 6
S. Ruiz-Moreno et al. A simple irradiance prediction obtained from a clear-day model is fed to the ANNs. Note that the MPC controller does not use these predictions. As it is used for obtaining the dataset and not for realtime operation, the MPC controller considers the actual future values of irradiance. Eq. (23) provides the evolvent of the irradiance, as described by Camacho et al. (2012), which approximates the future irradiances given the current value at one instant. The model provided by Hottel (1976) gives the atmosphere’s transmittance. 𝐼pred(𝑘+ 1|𝑘) = 𝐼(𝑘) + (𝑡(𝑘+ 1) − 𝑡(𝑘))𝐸c(1+0.033 cos (2𝜋𝐽d 365 )) (23) where 𝐼pred(𝑘+ 1|𝑘) is the predicted value of irradiance for instant 𝑘+ 1 calculated at instant 𝑘, 𝑡(𝑘) is the transmittance, 𝐸c= 1367 W/m2 is the solar constant and 𝐽d is the Julian day. 3.2.2. Evaluation metrics During the neural network selection process, Pearson’s correlation coefficient (R) is used in each of the subsets to select the best neural network and to compare the variation in performance among different data. This coefficient is obtained with Eq. (24), where 𝑥𝑖 and 𝑦𝑖 are two different data, and 𝑥 and 𝑦 are the mean values of variables 𝑥 and 𝑦. For simplicity, in this document 𝑅 refers to the Pearson correlation coefficient between the dataset and the simulation data. 𝑅(𝑥, 𝑦) = ∑𝑁 𝑖=1(𝑥𝑖−𝑥)(𝑦𝑖−𝑦) √∑𝑁 𝑖=1(𝑥𝑖−𝑥)2∑𝑁 𝑖=1(𝑦𝑖−𝑦)2 (24) The mean squared constraint violation (MSCV) is used to take into account the deviation of a variable (in this case, the outlet temperature) from certain limits. It is computed with Eq. (25). MSCV = 1 ns 𝑘=𝑘2 ∑ 𝑘=𝑘1(max (𝑦min −𝑦(𝑘), 𝑦(𝑘) − 𝑦max,0)2)(25) In addition, the results obtained with the controllers are evaluated with the mean time required for computing the control signals and the mean powers obtained: thermal power 𝑃th, thermal power considering the pump consumption 𝑃th −𝑃p, electric power 𝑃el and electric power considering the pump consumption 𝑃el −𝑃p. 4. Simulation results This section presents the results obtained with the different controllers proposed. The simulations are carried out using the distributed parameter model and including the pump and pipes. First, two controllers were applied to the system to follow a fixed temperature reference. In this case, only the second layer was implemented. The first controller uses a low temperature, and the second one uses a high one. These controllers allow us to compare the effects of using traditional control objectives. 4.0.1. Power optimization The power maximization controllers (controllers 3–6) were applied using the same irradiance profile. First, two controllers were implemented considering thermal power maximization in the cost function. The fourth controller includes the pump consumption in the cost function and incorporates the pipes in the prediction model, whereas the third one only takes the thermal power. The third controller models the inlet temperature with a first-order filter of the outlet temperature with a time constant of 10 min. Likewise, two other controllers were implemented for electric power optimization with the same considerations as the fourth and fifth controllers. The following list gathers the characteristics of the MPC controllers used: 1. 220 oC tracking, without pipes or pump. 2. 300 oC tracking, without pipes or pump. 3. Thermal power maximization, without pipes or pump. Fig. 6. Irradiance and effective irradiance used for testing the controllers. 4. Thermal power maximization, with pipes and pump. 5. Electric power maximization, without pipes or pump. 6. Electric power maximization, with pipes and pump. A one-day simulation was performed with all the controllers using the synthetic irradiance profile of Fig. 6. The effective irradiance is the product of the incoming irradiance (the one obtained from the synthetic irradiance profile) and the geometric and optical efficiencies of the collectors. The results are gathered in Table 1, with all metrics calculated between hours 10:30 and 17:30. The MSCV indexes are computed using 200 oC and 300 oC as limits, and the mean power is computed for the 10 loops of the field, considering that all of them are equally distributed, i.e., the total power of the field is assumed to be ten times the power of one loop. As might be expected, the controllers that provide more thermal power are the third and fourth (with almost no difference between them because they both work minimizing the outlet temperature), and the controllers that provide more electric power are the fifth and sixth. Following the criteria of electric power maximization, since that is the objective in a commercial plant, the sixth controller is the best one. Fig. 7 shows the results obtained with the abovementioned MPC controllers. Note that, as well as with Table 1, the system behaves similarly with controllers 3 and 4. This is because when maximizing the thermal power, the controller tends to minimize the outlet temperature, regardless of the elements included in the model. Although controller three neglects temperature and generation drops due to the pumps and pipes, the control objective is still to bring the temperature to its lower limit, which is easily achieved by augmenting the flow rate. A detail of the results obtained with controller 6 (maximization of electrical power considering pipes and pump) is shown in Fig. 8, which represents the outlet temperature and the references given by the first control layer and the electric power. As this controller provides the highest mean electric power, it is used to train the neural networks to reproduce their behavior. 4.0.2. Artificial neural networks After selecting the controller that will be used to train neural networks, 20 simulations of one day were performed with the different random synthetic clouds in Fig. 9. For creating the dataset, instants with outlet temperatures below 180 oC were removed (as in those situations the plant is shut down), obtaining 8036 instances. Then, the dataset was randomly divided into training, validation, and test subsets of 5626, 1205, and 1205 instances, respectively. Notice that the test subset and the test irradiance profile have no relation to each other, as the test set contains random instances of the results with Engineering Applications of Articial Intelligence 154 (2025) 110832 7
S. Ruiz-Moreno et al. Table 1 Results of the MPC controllers applied with different cost functions. Controller 𝑃th (kW) 𝑃th −𝑃p (kW) 𝑃el (kW) 𝑃el −𝑃p (kW) MSCV Max time (s) 1 949.282 936.003 287.197 273.917 0 313.379 2 741.534 735.571 271.452 265.486 0.154 343.471 3 996.151 980.749 276.577 261.175 24.358 392.545 4 996.151 980.749 276.577 261.575 24.358 392.327 5 879.950 870.310 291.280 281.640 0.079 619.376 6 857.887 849.212 290.786 282.110 0 1.274⋅104 Fig. 7. Evolution of outlet temperature, flow rate, and production with the MPC controllers. Fig. 8. Detail of the evolution of outlet temperature, its reference and the production with the 6◦ MPC controller (electric power maximization with pipes and pump in the cost function). the training irradiance profiles, and the test irradiance profile is used to perform simulations after selecting the best neural networks. The neural networks were trained, and the simulations were performed in Matlab® R2020b with Intel® Core™ i7-9700F CPU at 3.00 GHz and 16 GB RAM. Three types of neural networks were trained with different numbers of neurons and layers in an iterative process. Table 2 shows the training parameters of the neural networks. The first experiment was the training of neural networks to directly obtain the flow rate in one step (ANN 1). Table 3 shows the number of neurons in the hidden layers, the R scores of the trained neural networks in each subset and the complete dataset, the MSCV with the train profiles, and the mean value of 𝑃el −𝑃p (the electric power with pump consumption) between 10:30 and 17:30 with the training and test irradiance profile. The R scores are obtained in an open loop, while the electric production is computed by simulating the system Engineering Applications of Articial Intelligence 154 (2025) 110832 8
S. Ruiz-Moreno et al. Table 2 Training hyperparameters of the neural networks. Training algorithm Range Activation functions 𝜇0𝜇 increase ratio 𝜇 decrease ratio Max 𝜇 Max epochs Min gradient Max validation checks LevenbergMarquardt [-1,1] tansig purelin 10−3 10−1 10 1010 10310−9 6 Table 3 Results of the neural networks that compute directly the flow rates (ANN 1). Neurons R (tr) R (val) R (test) R (total) MSCV (tr) 𝑃𝑒𝑙 −𝑃p (tr) 𝑃𝑒𝑙 −𝑃p (test) 12 99.875 99.828 99.722 99.845 738.644 235.534 kW 280.356 kW 36 99.904 99.850 99.749 99.873 606.069 133.369 kW 280.317 kW 48 99.943 99.827 99.701 99.891 3856.887 205.672 kW 285.249 kW 60 99.943 99.868 99.861 99.920 3047.920 203.257 kW 279.831 kW 72 99.841 99.677 99.770 99.806 2107.935 246.021 kW 276.629 kW 12–4 99.935 99.899 99.743 99.900 1103.012 228.637 kW 277.188 kW 12–6 99.890 99.867 99.808 99.874 744.402 238.693 kW 280.238 kW 12-12 99.803 99.703 99.775 99.784 883.385 237.375 kW 280.054 kW 24–12 99.930 99.840 99.863 99.907 2144.251 226.110 kW 280.389 kW 36–24 99.925 99.884 99.851 99.907 595.590 238.922 kW 279.696 kW 48–24 99.910 99.859 99.847 99.893 1850.920 224.765 kW 280.426 kW 36-24-6 99.927 99.839 99.774 99.890 798.054 235.741 kW 276.634 kW 36-24-12 99.915 99.751 99.798 99.872 1851.284 226.084 kW 261.036 kW 48-24-12 99.977 99.901 99.915 99.956 1168.809 233.489 kW 273.360 kW Fig. 9. Training irradiance profiles. in a closed loop. This second metric is a more realistic indication of the ANN performance, as a very accurate ANN in an open loop may not necessarily generalize well and may be overly dependent on slight deviations in the flow rate. The selected one was a neural network with two hidden layers, with 12 neurons in the first hidden layer and 12 in the last one. This ANN was the one that combined high power and low MSCV with the training profiles and high power with the test profiles, and the Pearson correlation coefficient was similar in the three subsets, showing a good ability to generalize without overfitting, the phenomenon whereby a learning algorithm is overtrained and learns to fit only the training data. The training time of this ANN was 0.896 s. The second experiment consisted of training two different neural networks: one for emulating each control layer. Table 4 shows the training metrics of the first-layer neural networks. The electric production values were obtained using a feedforward controller in the second layer to track the temperatures, only for comparison purposes. The selected one was a neural network with 36, 24 and 6 neurons in the hidden layers. The training time of this ANN was 13.166 s. The results with the second-layer ANN are shown in Table 5, where the absolute tracking error of the outlet temperature is included. In this case, the references are obtained from the first-layer MPC controller. The ANN with 36, 24 and 12 neurons was selected because of its high power and low loss of R value. The training time of this ANN was 12.405 s. Table 6 compares the simulation results with controller six and the artificial neural networks in terms of thermal and electric powers, constraints violations, and computation time. The term ANN 2 represents the combination of ANN 2.1 and ANN 2.2. As well as in the previous experiments, all metrics are obtained between hours 10:30 and 17:30. The evolutions of outlet temperature, flow rate, and electric production are represented in Fig. 10. During transients, there is a higher discrepancy between the results obtained with ANNs and those with MPC. This is because even minor differences between the ANN and MPC responses can lead to slightly different dynamic system behaviors. At the next sampling time, these differences cause the ANN and MPC to receive slightly different inputs again, compounding the effect. This phenomenon is common to all approximations of controllers. However, the electric power generated remains very similar. The maximum computation times of the neural networks are negligible with respect to the MPC controller, and the constraint violations are near 0. Both ANN approaches approximate successfully the behavior of the MPC controller. Fig. 11 shows the times that were required to obtain control signals with the electric power maximization MPC and with the selected neural networks. The MPC times are represented on a scale of seconds, while the ANN times are represented in decimilliseconds. This graph shows that the main objective of this work is met, which was to control the plant with performance similar to that of the MPC controllers but with much lower computation times. One extra simulation was performed for each controller to validate the results using the irradiance profile from Fig. 12. The results of the three selected controllers are shown in Table 7. Both neural network approaches are able to control the system. The loss of performance in ANN 2 is higher for this test, although it is still lower than 2% (see Fig. 13). 4.0.3. Robustness analysis One limitation of the ANNs is that they are trained with specific plant parameters. Deviations between the system used for training and the actual plant can lead to variations in the results. Different simulations were performed, changing some parameters in the following conditions: i) 6th MPC controller with modification of the prediction model (as a baseline), ii) MPC controller with a mismatch between Engineering Applications of Articial Intelligence 154 (2025) 110832 9