Machine Learning for Modeling a Hybrid Solar and Gas Turbine
Project Teammate: Domenico Squarillo
In the Fall of 2022, I took the “Machine Learning for Energy Conversion Processes” class with Prof. Van Carey. The course introduced various machine-learning tools and showed me how to use them effectively in energy-related research and technology development. In this class, we covered a variety of machine learning tools, such as genetic algorithms, neural networks, recurrent neural networks, and convoluted neural networks. We also learned ways to process data and helpful tools, such as using dropout layers to solve overfitting problems or principle component analysis to help interpret important trends and patterns in the data. To implement these models, we used Python programming.
Here I highlight a project in which we used a neural network to analyze a hybrid solar fossil-fuel gas turbine, shown in Figure 1 below. This project aimed to construct a neural network model of the gas turbine system's performance. Specifically, we are looking at the required air-to-fuel ratios to achieve the required turbine inlet temperature T4 under varying conditions.
Figure 1: Schematic of Hybrid Solar and Gas Turbine
Project Background
In this system, air at atmospheric pressure P1 = 101 kPa and at a temperature T1 enters the compressor inlet. The air flowing out of the compressor at the high-side pressure is first heated to temperature T2r in the regenerator, transferring waste heat from the turbine exhaust stream. The gas is heated further in an exchanger that delivers solar thermal heat input, raising the temperature to T3 . Finally, the air flows into a burner, where fuel is injected and burned to raise the temperature to T4 . Having T4 as high as possible is thermodynamically advantageous, resulting in higher system efficiency for higher values of T4 . However, if T4 is too high, the components of the turbine may be damaged.
The burner in the system is designed to burn pure methane or a mixture of methane (CH4) with some added propane (C3H8). The mixture ratio may be dictated by cost factors and availability, resulting in the mole fraction of the fuels ranging from 0% propane and all methane, to 50% propane and 50% methane, by mole. Key parameters here are the molar air-to-fuel ratio α and the fuel-propane mole fraction γ.
A stoichiometric mixture has just enough oxygen in the air to convert all the propane and methane to H2O and CO2, with no oxygen left over. The burner operates adiabatically, and the hottest exit temperature corresponds to stoichiometric conditions. Therefore, adding excess air is a way of controlling burner exit temperature.
Air inlet temperature T1, solar heat input Qs, and the fuel mixture fraction vary during system operation, and consequently, the rate of fuel injection in the burner must be varied to hold the turbine inlet temperature T4 at the target level of 1473 K.
To facilitate model-based control of T4, a model that predicts the required air-to-fuel ratio to achieve this turbine inlet temperature under varying conditions can be used by a controller to set the fuel flow rate at the proper values.
(Project description adjusted from Prof. Van Carey’s project handout)
Creating the Neural Network
We were given values of 𝛼 (air-to-fuel ratio), and ηsys (system efficiency) for a set of the input variables T1 (inlet temperature) , γ (fuel-propane mol fraction), Qs (the rate of solar thermal heat input).
Our first step was normalizing the data.
Then, we create a neural network with three input variables in the first dense layer of the network list. We set the first dense layer with 16 neurons and added two more hidden dense layers with 32 and 16 neurons. In all of these layers the activation function was set to ‘K.relu.’ Finally, we added one more output dense layer with 2 neurons (one for each output).
Initial weights were created using a uniform distribution of randomly selected numbers between -0.2 and 1.2.
from keras import backend as K
#initialize weights with values between -0.2 and 1.2
initializer = keras.initializers.RandomUniform(minval= -0.2, maxval=0.5)
model = keras.Sequential([ keras.layers.Dense(16, activation=K.relu, input_shape=[3], kernel_initializer=initializer, name="input"),keras.layers.Dense(32, activation=K.relu, kernel_initializer=initializer, name="HL-1"), keras.layers.Dense(16, activation=K.relu, kernel_initializer=initializer, name="HL-2"), keras.layers.Dense(2, kernel_initializer=initializer, name="output") ])
The ‘RMSprop’ optimizer was used, and a learning rate of 0.001 was set:
#from tf.keras import optimizers
rms = keras.optimizers.RMSprop(0.001) model.compile.(loss=’mean_absolute_error’, optimizer=rms)
Finally, the number of epochs was set to 600:
es = keras.callbacks.EarlyStopping( monitor='loss',
mode='min',
patience = 80, restore_best_weights = True, verbose=1)
historyData = model.fit(xarray,yarray,epochs=600,callbacks=[es])
The model was run five times, achieving a minimum mean absolute error of 0.02918 (~2.92%). A surface plot was used to visually see the variation of predicted 𝛼 values with respect to temperature and input solar heat flux shown in Figure 2.
Figure 2: Predicted air-to-fuel ratio values for respective heat flux and inlet temperature T1.
We used a separate set of testing data to compare the results of our trained model. We created a log-log plot displaying the actual vs. predicted values of air-to-fuel ratio shown in Figure 3 and found a root-mean-square deviation of 4.29.
Figure 3: Log-log plot of predicted values from model and actual values from data
Discussion
The keras model can be modified to explore how changing its features affects prediction accuracy.
For example, we found that changing the activation function from ReLU to ELU resulted in a larger deviation or error. The activation function significantly affects the performance of the neural network. Non-linear activation functions inside hidden layers are best as they introduce non-linearity to the network to learn complex patterns. ReLU is typically used in these types of feedforward artificial neural networks.
Also, we found that decreasing the number of neurons required more epochs to converge, but also resulted in the lowest error. Conversely, increasing the total neuron count resulted in the lowest number of epochs to converge, at the expense of the highest error. This can be a sign that the larger neuron count was causing overfitting.
Conclusion
In class, we discussed the following:
Neural network modeling is a suitable approach for performance prediction in the analysis of power generation systems.
Certainly, we could build a physical model to achieve this. However, physical models generally incorporate idealizations that may not be completely accurate, and they may require knowledge of system parameters that may not be known with complete accuracy.
For example, the regenerative heat exchanger may be modeled with the assumption that its heat transfer conductance is uniform throughout the unit (which may not be accurate) or the value of the conductance may not be known precisely.
Creating a machine learning model does require obtaining test data. However, this model would account for the real parametric effects and requires no assumptions or idealizations. Additionally, more data can be obtained to update the model and account for variation of performance during its operational lifetime.