A Control-Oriented ANFIS Model of Evaporator in a 1-kWe Organic Rankine Cycle Prototype

: This paper presents a control-oriented neuro-fuzzy model of brazed-plate evaporators for use in organic Rankine cycle (ORC) engines for waste heat recovery from exhaust-gas streams of diesel engines, amongst other applications. Careful modelling of the evaporator is both crucial to assess the dynamic performance of the ORC system and challenging due to the high nonlinearity of its governing equations. The proposed adaptive neuro-fuzzy inference system (ANFIS) model con-sists of two separate neuro-fuzzy sub-models for predicting the evaporator output temperature and evaporating pressure. Experimental data are collected from a 1-kWe ORC prototype to train, and verify the accuracy of the ANFIS model, which benefits from the feed-forward output calculation and backpropagation capability of the neural network, while keeping the interpretability of fuzzy systems. The effect of training the models using gradient-descent least-square estimate (GD-LSE) and particle swarm optimisation (PSO) techniques is investigated, and the performance of both techniques are compared in terms of RMSEs and correlation coefficients. The simulation results indicate strong learning ability and high generalisation performance for both. Training the ANFIS models using the PSO algorithm improved the obtained test data RMSE values by 29% for the evaporator outlet temperature and by 18% for the evaporator outlet pressure. The accuracy and speed of the model illustrate its potential for real-time control purposes.


Introduction
The internal combustion (IC) engine is the main technology currently used in the transportation sector. A typical IC engine converts about 40% of the fuel combustion energy into useful work. Legislation on vehicle emission continues to become more stringent to reduce the impact of IC engines on the environment. To this end, technologies-such as gasoline direct injection (GDI) [1], turbo direct injection (TDI) [2], and fuel stratified injection (FSI) [3]-have been developed and implemented in recent years to increase the efficiency of IC engines. Despite the advantages of such technologies, the thermal efficiency of IC engines needs to be improved to meet regulatory targets such as those agreed upon at the COP21 in the legally binding Paris Agreement, which is set to reduce greenhouse gas emissions. Recently, new methods of waste heat recovery (WHR) have been explored to utilise the significant amount of energy that is released to the atmosphere from the exhaust and coolant of IC engines [4]. The objective is to convert this waste thermal energy into useful mechanical or electrical energy. Several viable WHR technologies can be used to harness this waste thermal energy, such as turbo-compound, thermoelectric generators, piezoelectric generators, and organic Rankine cycle (ORC) engines.
Among them, ORC systems are the preferred method of WHR in IC engines due to their low manufacturing cost and high efficiency. WHR technologies can contribute to enhancing the overall conversion efficiency of IC engines [5][6][7].
ORCs are a promising WHR technology that has been widely considered in many industries due to their features such as simplicity and high efficiency. The ORC is a heatengine thermodynamic cycle that exhibits the potential to be deployed for recovery of waste heat in IC engines, the exhaust gases of which are an unsteady heat source with fluctuating temperature and mass flow rate [8,9]. Key characteristics of the ORC engine that make it a desirable solution for waste heat recovery in IC engines include modularity, versatility, and technological maturity of components (due to the similarities with the refrigeration systems). Moreover, ORC systems are able to recover waste heat in the low-to medium-temperature range. Most current investigations on ORCs are focused on theoretical and thermodynamic analysis [10], cycle optimisation [11], techno-economic optimisation [12,13], and working fluid selection [14]. In particular, combined fluid-design optimisation studies explore the potential of novel working fluids using computer aided molecular design (CAMD) techniques [15][16][17]. Several studies also propose advanced off-design optimisation algorithms to maximise the performance of an ORC engine operating under variable heat-source conditions [18][19][20][21].
However, the latter are based on quasi-steady models of the ORC engine and are thus not suitable for dynamic applications. For safe and successful implementation of ORCs in the automotive industry, a reliable and precise control scheme is required to ensure the safe operation of the engine, prevent organic fluid decomposition, and reduce the risk of component damage. Furthermore, designing a reliable control algorithm for the ORC in the mobile applications depends on accurate modelling of all the components within the cycle. The heat exchanges (i.e., evaporator and condenser) are key components of the ORC system as they are responsible for a large share of the overall exergy destruction [22] (heat transfer over a finite temperature difference being irreversible by nature) and are challenging to model due to the high nonlinearity of their governing equations. In addition, the dynamic behaviour of ORC engines is governed by the large thermal inertia of the heat exchangers, in particular by that of the evaporator, which has a direct impact on the response time of an ORC engine subject to fluctuations in heat-source conditions (namely, temperature and mass flowrate). Therefore, an accurate model of the evaporator is required to capture the dynamics of the system and is of prominent importance, not only because it is necessary for cycle optimisation and working fluid selection, but also as it allows a comprehensive optimisation of the dynamic control strategy.
Evaporator models available in the literature can be categorised into three main categories, namely: finite volume (FV) models, moving boundary (MB) models, and intelligent based models such as fuzzy and neural network models [23][24][25]. As illustrated in Figure 1, FV models are based on a spatial discretisation of the evaporator into a finite number of equally spaced control volumes, with the thermo-physical properties of the working fluid considered constant within each control volume. For this modelling technique, a higher number of control volumes results in an increased precision but significantly increases the computational complexity. Therefore, a trade-off must be made between accuracy and processing time to select the adequate spatial resolution of FV models [26]. FV techniques are computationally expensive and are thus appropriate for performance assessment and working fluid selection, but cannot be applied to high-frequency, real-time control purposes. By contrast, MB models are control-oriented models based on a fixed spatial discretisation of the evaporator into three regions (liquid, two-phase mixture, vapour), the size of which varies with time. The MB technique results in a slight improvement in computational complexity, however, models developed by this technique cannot tolerate nonexistence of the distinct phases of the working fluid. Therefore, this technique is not suitable for situations such as start-up or shut-down because of the resulting singularity in numerical problems [23]. Evaporator fuzzy models have been developed recently to improve the real-time calculation speed of the models [24,28]; however, setting the rules for identifying the model based on the available data is a time-consuming task. Another approach for developing an agile model of the evaporator is the neuro-fuzzy technique. Neuro-fuzzy models are data-driven techniques that require training before implementation. As opposed to predictive methods, which require an iterative solution, neuro-fuzzy models are much faster and can be utilised for control purposes. Adaptive neuro-fuzzy inference system (ANFIS) is an intelligent modelling technique acquiring the modelling benefits of Sugeno fuzzy inference system and pattern recognition ability of feedforward neural network [29]. Khosravi et al. [30] used ANFIS-PSO algorithm for thermodynamic modelling of geothermal based ORC equipped with solar system. Authors, in previous studies [27,31], have developed ANFIS models based on the available data from FV evaporator models that offer reduced complexity, high accuracy and lower computational burden for prediction of the working-fluid and heat-source outlet temperatures. This paper investigates the application of neuro-fuzzy techniques for modelling a plate evaporator using time-resolved high-fidelity experimental data obtained on a 1-kWe ORC prototype. This paper is structured as follows: Section 2 describes the layout and operation of the 1-kWe ORC testing facility. In Section 3, the architecture of the ANFIS model and the node functions within its layers are discussed for a fuzzy inference system with two inputs and one output. Two methods are introduced in Section 4 for training the ANFIS model and limitations and advantages of both methods are pointed out. In Section 5, data collection and application of the ANFIS method for modelling the evaporator outlet temperature and pressure in the testing facility are discussed. The simulation results and discussions of the study are presented in Section 6. The simulation tests are designed to evaluate the effectiveness of the proposed modelling technique. Finally, the paper closes by summarising and discussing key conclusions from this work in Section 7.

ORC System Layout and Test Bench Prototype
The testing facility, commissioned at the Clean Energy Processes (CEP) Laboratory at Imperial College London, comprises a rotary-vane pump, brazed-plate evaporator and condenser, and a scroll expander coupled magnetically to a generator with an adjustable resistive load. The ORC prototype is operated with R245fa as the working fluid, which can maintain above-atmospheric pressure within the condenser and prevent non-condensable air from leaking into the closed loop. The rotary-vane pump circulates the organic fluid through the cycle and allows adjustment of the flowrate. Shaft power is produced from the expansion of the high-temperature, high-pressure vapour exiting the evaporator down to the low pressure maintained in the condenser. The generator converts the expander shaft mechanical work into electrical energy, which is dissipated within a resistive load bank made of a set of adjustable resistors -with an equivalent overall resistance ranging from 10 to 60 Ω. This resistive load bank is able to dissipate safely up to 2 kW of heat without external ventilation and allows to control the torque applied to the expander shaft. The low-pressure vapour leaving the expander is then cooled down and fully condensed in the water-cooled condenser. To avoid cavitation in the pump and maintain zero subcooling at the condenser outlet, a liquid receiver is placed between the condenser and the pump. An 18-kW electric oil heater with adjustable delivery temperature is used as the heat source for the ORC prototype, thus providing a controllable stream of hot Marlotherm SM oil. A detailed piping and instrumentation diagram (P&ID) of the testing facility is shown in Figure 2 and an actual picture of the test bench is presented in Figure 3. As shown in Figure 2, pressure transducers and thermocouples (T-type) are placed at the inlet and outlet of each component to monitor the working fluid state throughout the cycle and provide high-fidelity measurements of the components and system performance. A DAQ970A data acquisition system is used to record time-resolved experimental data from the apparatus with a 1/2-Hz sampling rate. Detailed specifications of the key ORC components are listed in Table 1.

Architecture of an Adaptive Neuro-Fuzzy Inference System (ANFIS)
ANFIS is as an advanced method widely used to model and control complex engineering systems [29]. An ANFIS network is able to extract non-linear relationships of complex multivariable problems using modelling benefits of Sugeno fuzzy inference system and pattern recognition power of feedforward neural networks by means of learning with training data. The advantage of this method compared with other similar methods, such as ANN, is the interpretability in terms of linguistic variables [33]. Because of its fuzzy logic capabilities, ANFIS models are not considered as pure black-box models, and therefore are more interpretable [33]. Moreover, ANFIS is an adequate compromise between neural network and fuzzy system providing smoothness and adaptability for the model [34]. Consequently, the model is able to handle uncertainties better and is less sensitive to noise. The ANFIS architecture comprises five layers. Each layer contains some adaptive or fixed nodes which are connected using directional links to form the network. Fixed nodes are performing a specific task while the output of adaptive nodes depends on the parameters incorporated in their node function. The learning rule specifies how these parameters should change to minimise a prescribed error function [29]. To avoid complexity, a FIS with two inputs and one output is assumed in describing the ANFIS architecture. In the rule base of FIS two TSK rules are considered as follows:

Rule 1:
if is and is , then:

Rule 2:
if is and is , then: = + + , where x and y denote the input variables and is the output. and are demarcated over the input domain and are regarded as the fuzzy sets. , , and are regarded as the linear polynomial parameters in the fourth layer of ANFIS network. Figure 4 represents the architecture of the ANFIS network, formed by implementing these two rules. The square and circle node symbols are deployed to illustrate the adaptive and fixed nodes, respectively. The node function for layers 1 to 5 of this architecture are as follows: Layer 1: The nodes in the first layer of ANFIS are parameterised membership functions and the parameters set in this layer are referred to as premise parameters. These nodes are adaptive and can represent various types of membership functions such as triangular, trapezoidal, generalised bell and Gaussian. In case of the Gaussian shape membership function, the node function is A and B denote the linguistic labels, x and y represent the inputs to the node i and μ(x) and μ(y) are Gaussian membership functions ranging from 0 to 1, as follows: where determine the centre and represent the fuzzy set width. The training cost is determined using the number of training parameters, thus, since Gaussian membership function has only two adjustable parameters it is the most frequently used membership function in the literature [35]. In this study, Gaussian membership function is adopted for partitioning the input space because of its features such as fewer tuneable parameters and smooth representation of the domain.

Layer 2:
Nodes in the second layer are fixed and labelled as π. In this layer, the output of nodes is obtained by multiplying all incoming signals. The node output ascertains the firing strength of the rules, as: Layer 3: The fixed nodes in this layer are labelled as N. The normalised firing strengths is obtained by dividing the firing strength of i th rule to sum of all rules firing strengths: Layer 4: The nodes in the fourth layer have three adjustable parameters and hence are regarded as adaptive nodes. Their node function is calculated as: where is the normalised firing strength, and , and are referred to as consequent parameters, which are identified during the training process of the network.

Layer 5:
The single node in this layer is a fixed node and is labelled as Σ. The crisp output of this layer is calculated by adding all of the incoming signals as

Learning Algorithm of ANFIS
The aim of training the ANFIS network is to adjust the premise and consequent parameters in the adaptive nodes to minimise a performance measure known as the error function. Despite outperforming other fuzzy methods, ANFIS requires an effective learning algorithm for training the parameters of the network. In the original ANFIS paper proposed by Jang [29] a hybrid gradient descent, least square estimate (GD-LSE) method is used to identify the premise and consequent parameters of the network. In this method, because of utilising a gradient-based approach, the algorithm has a tendency to trap in local minima. Therefore, in search for a more effective training method for ANFIS, metaheuristic approaches have been investigated by researchers as an alternative for identifying the network parameters. Extensive literature review illustrates that various metaheuristic algorithms-such as PSO, GA, ABC, and their variants-have been used for training the premise and consequent parameters of the ANFIS network for a range of engineering problems. Table 2 summarises some studies which have used metaheuristic methods for training the ANFIS network. AWPSO EKF Sargolzaei et al. [38] PSO PSO Turki, Bouzaida [39] PSO PSO Rini, Shamsuddin [40] PSO PSO Karaboga, Kaya [41] ABC ABC Soto, Melin [42] GA LSE Cardenas, Garcia [43] GA GA In this study, among many methods of minimising the performance measure, the particle swarm optimisation (PSO) and standard gradient descent, lest square estimate (GD-LSE) are chosen to train the ANFIS network. Moreover, their performance for matching training and test datasets is compared. The root mean square error (RMSE) is selected as the main performance indicator. The network output will better match the training target as the RMSE approaches zero.

GD-LSE Algorithm
In the architecture of the aforementioned ANFIS network, layer 1 and layer 4 contain adjustable parameters that need to be tuned for the network to match the training data. The least square estimate can be utilised to find the optimal values for the consequent parameters; however, since the premise parameters are not fixed, the search space becomes too large and it affects the convergence speed adversely. Therefore, by using a hybrid approach GD-LSE algorithm can speed up the process of training the network. The hybrid GD-LSE comprises a forward and a backward pass to train consequent and premise parameters, respectively. Table 3 illustrates this two-pass algorithm for identifying the premise and consequent parameters of the model. The data is presented to the network after fixing the premise parameters. The node outputs propagate forward through the network and, consequently, the network output is obtained as a linear combination of consequent parameters as: Substituting the fuzzy if-then rules into Equation (8) Equation (9) is linear in the consequent parameters , , , , and , and can thus be written as: and, if the X matrix is invertible: Otherwise, W is calculated by deploying a pseudo-inverse as: where is the transpose of , and ( ) is the pseudo-inverse of if is nonsingular. However, may become singular during the iterations that makes the problem ill-defined. Moreover, although Equation (12) is concise in notation finding the inverse of X is expensive in computation. Therefore, to overcome this issue the recursive LSE method proposed by Jang [29] can be employed as: where is the covariance matrix and least square estimate of is equal to . is the i th row vector of matrix and is the i th element of . After identifying the consequent parameters, the output of network can be calculated and the error measure of the entery of the training data can be obtained as: where and represent the desired output and ANFIS output, respectively. Therefore, the RMSE of the whole training dataset can be computed as follows: In the backwards pass, the consequent parameters are fixed and the error signals propagate through the network in the reverse direction. Accordingly, using the GD algorithm, the premise parameters located in the first layer of the network are updated as: where, is the membership function's adjustable parameter and represents the learning rate. To obtain the partial derivative, , the chain rule is applied as:

Particle Swarm Optimisation
PSO is an iterative metaheuristic computational algorithm inspired by social behaviour of birds and fishes within a flock. This method is first proposed by Eberhart and Kennedy and is considered as one of the swarm intelligence population-based search methods that is usually exploited to solve optimisation problems [44]. In PSO algorithm, potential solutions to the optimisation problem are referred to as particles. In each iteration, the position and velocity of the particles are updated by moving them in the search domain. Each particle movement is determined using its local best position ( , ) but is influenced by the other particles best-known position in the search-space ( , ) as where and are random variables defined as = and = , with and ~ (0, 1). The variables and are positive acceleration constants that satisfy the condition + ≤ 4 [45]. is the inertial weight and is determined using the inertial weight approach (IWA) as follows [46]: where and are the initial and final weights, respectively, is the current iteration number, and , denotes the maximum number of iterations. In the original GD-LSE method proposed by Jang [29], convergence of parameters is dependent on their initial value. Since this method is a gradient based approach the convergence speed of the algorithm is quite slow, especially for problems with a large set of variables. Furthermore, setting the best learning rate in the backpropagation algorithm is not an easy task and requires trial and error.
The PSO algorithm does not use the gradient of the optimisation problem as opposed to the classic optimisation methods such as GD-LSE. Therefore, it does not require the optimisation problem to be differentiable, however it cannot guarantee convergence to an optimal solution. Moreover, for a determined size of network, training ANFIS using the PSO algorithm is favourable as it is less computationally expensive [37].

Data Collection and Model Implementation
In this experiment, for modelling the evaporator, a set of 756 input-output data pairs are collected from the ORC testing facility by varying the heat source mass flow rate and temperature and working fluid mass flow rate. For the heat source, the mass flow rate and temperature of the supplied Marlotherm SM oil stream is altered using the electric heater in the range of 0.01 to 1.37 kg/s and 93 to 142 °C, respectively. Mass flow rate of the working fluid is also altered in the range of 14.4 to 57.8 g/s by manually changing the pump speed. Four separate multi-input single-output sub-models are trained for prediction of evaporator output temperature ( , ) and evaporator output pressure ( , ). The inputs to sub-models are identical and consist of mass flow rate of heat source ( ̇ ), temperature of heat source ( ) and mass flow rate of the working fluid ( ̇ ). The recorded outputs for the sub-models are the evaporator outlet temperature ( , ) and evaporator outlet pressure ( , ). For evaluating the models, the data set is randomly divided to two subsets of training data set and test data set. The ANFIS network is optimised using the training data set whereas the test data set which is deployed for evaluating the model. In sub-models, 70% of data points are used for training the network and the remaining data points are deployed to test the constructed network. Among the available methods of clustering, fuzzy c-means (FCM) algorithm, due to its high flexibility is used for clustering the input space and generating the base FIS. The GD-LSE and PSO techniques are applied as the learning algorithm to optimise the base FIS. The training parameters for all four sub-models are listed in Table 4. The performance of both training methods is compared in terms of the RMSE and linear correlation coefficient (R) for both sub-models.

Results and Discussion
Two neuro-fuzzy models of evaporator are developed to predict the evaporator outlet temperature and evaporator outlet pressure in a 1-kWe ORC test rig. Figure 5 represents the comparison between evaporator outlet temperature prediction in the models trained using GD-LSE and PSO techniques. As illustrated in Figure 5, for the training dataset, RMSE of 3.5 and 2.4 achieved for GD-LSE and PSO, respectively. Furthermore, to evaluate the generalisation ability of the models, an unseen test dataset is applied to the models. For the test dataset, the obtained RMSEs are equal to 3.4 and 2.4 in the model trained using GD-LSE method and PSO technique, respectively. Comparison of RMSE for the evaporator outlet temperature models clearly indicates the models trained using the PSO algorithm have higher accuracies. For the training dataset, training the network using the PSO algorithm results in reduction of RMSE by 29% as compared to the GD-LSE algorithm. Similarly, for the test dataset, the RMSE reduced by 29% for the model trained using the PSO algorithm which indicates higher accuracy of this model as compared to the model trained using the GD-LSE algorithm. Furthermore, regression plots are shown in Figure 6, to illustrate the deviation of the predicted evaporator outlet temperatures from the experimentally obtained evaporator outlet temperatures. The linear correlation coefficient (R) for both GD-LSE and PSO models are listed in Table 5. Comparison of the R values indicate an acceptable fit for training and test data for both models. However, the R coefficients in the PSO model are closer to one, which imply better fit and greater generalisation ability of the model optimised by the PSO method. For the training and test datasets, the R coefficients improved 1.1% and 0.9%, respectively, by deploying the PSO method for training.  Similarly, to examine the accuracy of the models, comparison of the regression plots for the models trained by GD-LSE and PSO methods are shown in Figure 8. The R coefficient for the training and test data sets in both models are close to one, which indicates the agreement between the predictions from the models and the experimentally measured evaporator outlet pressures. The obtained linear correlation coefficients are listed in Table  6. The R values achieved for the training and test data sets are higher in the PSO model. Furthermore, the highest obtained accuracy is for the refrigerant output pressure model optimised using PSO algorithm with the linear correlation coefficient of 0.98 for the training dataset, and 0.96 for the test dataset. These two sub-models for the evaporator outlet temperature and evaporator outlet pressure can be used to identify the phase of the working medium instantaneously. Therefore, in the application of the ORC for recovery of the wasted heat in IC engines, this neuro-fuzzy model can be deployed to design an accurate control system to ensure the system safety and prevent decomposition of the working fluid by adjusting the pump speed.
The neuro-fuzzy models developed to predict the evaporator outlet temperature and evaporator outlet pressure are very agile due to the modelling benefits of fuzzy systems. Compared to the conventional models of evaporator such as FV and MB models, the neuro-fuzzy models do not require numerical solution of governing differential equations, and therefore, are computationally less expensive. The accuracy and speed of the neuro-fuzzy evaporator models illustrate its potential for real-time control purposes.

Conclusions
In this study, GD-LSE and PSO algorithms have been to train two neuro-fuzzy models for prediction of the evaporator outlet temperature and pressure of a 1-kWe ORC prototype. As system safety is vital in ORC applications for the recovery of waste heat from the exhaust gases of IC engines, accurate modelling of the evaporator outlet temperature, and pressure plays a pivotal role in the design of suitable control systems. Comparisons of experimentally gathered data and predictions from the neuro-fuzzy models reveal an acceptable accuracy in predicting the evaporator outlet temperature and pressure.
Based on the obtained results the main findings from this study are as follows:  The neuro-fuzzy models offer reduced complexity, high accuracy and lower computational burden for prediction of the evaporator outlet temperature and pressure.  The models developed by using neuro-fuzzy technique can be deployed for real-time control of ORC in various applications.  Compared to the models trained using the GD-LSE algorithm, the models trained using the population-based PSO algorithm obtained better accuracy in terms of RMSEs and R coefficients for the training and test datasets. For the evaporator outlet temperature, a 29% improvement in the RMSE was achieved for both the training and test data. Furthermore, the evaporator outlet pressure RMSE improved by 15% and 18% for the training and test data, respectively, by using the PSO algorithm.  The effort to identify the model parameters reduced substantially in the ANFIS models as opposed to the conventional non-adaptive methods of fuzzy system tuning. This work was also supported by the UK Engineering and Physical Sciences Research Council (EPSRC) [grant numbers EP/P004709/1, and EP/R045518/1].

Data Availability Statement:
The data presented in this study are available on request from the first author.

Conflicts of Interest:
The authors declare no conflict of interest.