0% found this document useful (0 votes)
4 views6 pages

MatLab Project Prionty 09

This study presents a linear regression model to predict the electrical power output of a Combined Cycle Power Plant using a dataset from the UCI Repository. The model, trained on environmental factors such as temperature and pressure, demonstrated strong predictive accuracy with R² values between 0.92 and 0.95, and RMSE values below 5 MW. The results confirm the effectiveness of linear regression in modeling the relationship between environmental conditions and power output, while suggesting potential for future exploration of advanced modeling techniques.

Uploaded by

12jafira
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views6 pages

MatLab Project Prionty 09

This study presents a linear regression model to predict the electrical power output of a Combined Cycle Power Plant using a dataset from the UCI Repository. The model, trained on environmental factors such as temperature and pressure, demonstrated strong predictive accuracy with R² values between 0.92 and 0.95, and RMSE values below 5 MW. The results confirm the effectiveness of linear regression in modeling the relationship between environmental conditions and power output, while suggesting potential for future exploration of advanced modeling techniques.

Uploaded by

12jafira
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

A Linear Regression-Based Predictive Model for Electrical Power Output of a Combined

Cycle Power Plant

Abstract
This study develops a linear regression model to predict the electrical power output (PE) of a Combined Cycle
Power Plant (CCPP) using the publicly available UCI dataset. The dataset contains five folds with measurements
of ambient temperature, exhaust vacuum, ambient pressure, and relative humidity. The first three folds were
used for training and the remaining two for testing. Features were normalized and regression parameters
estimated using the Normal Equation. The model was evaluated using R², RMSE, MAE, and MAPE. Results show
strong predictive performance, demonstrating that linear regression effectively captures the relationship
between environmental conditions and power plant output.

1. Introduction
Combined Cycle Power Plants (CCPPs) use gas and steam turbines to produce electricity efficiently. Their
electrical output depends on environmental factors such as temperature, pressure, and humidity. Predicting
output is important for scheduling and operational optimization. This study replicates a linear regression
modeling approach similar to that presented in a referenced research paper, using the CCPP dataset from the
UCI Repository. The first three folds of the dataset were used for training and the last two folds for testing.

2. Dataset Overview
The dataset contains 9,568 samples collected over six years. Each row represents environmental conditions
and corresponding electrical output. Features include: Ambient Temperature (AT), Exhaust Vacuum (V),
Ambient Pressure (AP), Relative Humidity (RH), and the target variable Electrical Power Output (PE). Five
Excel sheets represent five folds. Sheets 1–3 were used for training; Sheets 4–5 were used for testing.

3. Methodology
Data was loaded using MATLAB’s xlsread function. Z-score normalization was applied to all features to improve
numerical stability. The linear regression model was constructed using the Normal Equation. Evaluation
metrics used were RMSE, MAE, MAPE, and R². Additionally, visualizations such as Actual vs Predicted and Error
Distribution were generated to assess model quality.

Code:
%% LINEAR REGRESSION MODEL FOR COMBINED CYCLE POWER PLANT (CCPP)

% This script loads the 5-fold dataset, constructs a linear regression model

clear; clc; close all; format compact;

filename = '[Link]';

fprintf("=========================================\n");

fprintf(" COMBINED CYCLE POWER PLANT MODEL\n");

fprintf("=========================================\n\n");

% 1. DATA LOADING (Reading Excel File)

% Sheets 1–3 → Training data


% Sheets 4–5 → Testing data

if exist(filename, 'file') == 2

fprintf("File found: %s\nLoading dataset...\n\n", filename);

% Load 5-fold dataset

RawTrain = [xlsread(filename, 1);

xlsread(filename, 2);

xlsread(filename, 3)];

RawTest = [xlsread(filename, 4);

xlsread(filename, 5)];

else

fprintf(2, '[WARNING] File not found. Using RANDOM DATA.\n');

RawTrain = 10 + rand(500, 5) * 400;

RawTest = 10 + rand(200, 5) * 400;

end

% 2. FEATURE DESCRIPTION

% Columns from dataset (as described in research paper):

% X1 = AT = Ambient Temperature (°C)

% X2 = V = Exhaust Vacuum (cm Hg)

% X3 = AP = Ambient Pressure (mbar)

% X4 = RH = Relative Humidity (%)

% Y = PE = Electrical Power Output (MW)

%% Split into Input (X) and Output (Y)

X_train_raw = RawTrain(:, 1:4);

Y_train = RawTrain(:, 5);

X_test_raw = RawTest(:, 1:4);

Y_test = RawTest(:, 5);

% 3. FEATURE NORMALIZATION
% Using Z-score scaling: X_norm = (X - mean) / std

% This prevents features with large values from dominating the model.

mu = mean(X_train_raw);

sigma = std(X_train_raw);

X_train_norm = (X_train_raw - mu) ./ sigma;

X_test_norm = (X_test_raw - mu) ./ sigma;

% Add bias term (intercept column)

X_train = [ones(size(X_train_norm,1), 1), X_train_norm];

X_test = [ones(size(X_test_norm,1), 1), X_test_norm];

% 4. TRAINING THE LINEAR REGRESSION MODEL

% Using the Normal Equation:

% β = (XᵀX)⁻¹ XᵀY

% MATLAB shortcut: Beta = X \ Y;

Beta = X_train \ Y_train;

% 5. PRINTING THE FINAL MODEL (Human-readable form)

fprintf("=========================================\n");

fprintf(" FINAL MODEL (PE)\n");

fprintf("=========================================\n");

fprintf("PE (MW) = %.4f + %.4f*(AT_norm) + %.4f*(V_norm) + %.4f*(AP_norm) + %.4f*(RH_norm)\n", ...

Beta(1), Beta(2), Beta(3), Beta(4), Beta(5));

fprintf("=========================================\n\n");

% 6. MODEL TESTING & ERROR METRICS

Y_pred = X_test * Beta;

residuals = Y_test - Y_pred;

RMSE = sqrt(mean(residuals.^2));

MAE = mean(abs(residuals));

MAPE = mean(abs(residuals ./ Y_test)) * 100;


SS_res = sum(residuals.^2);

SS_tot = sum((Y_test - mean(Y_test)).^2);

R2 = 1 - SS_res/SS_tot;

fprintf("MODEL ACCURACY METRICS:\n");

fprintf("R-Squared (Accuracy): %.4f\n", R2);

fprintf("MAE (Mean Abs Error): %.4f MW\n", MAE);

fprintf("RMSE: %.4f MW\n", RMSE);

fprintf("MAPE: %.2f %%\n\n", MAPE);

% 7. VISUALIZATION (Dashboard)

figure('Name','Model Dashboard','Position',[200 200 1100 450]);

subplot(1,2,1);

scatter(Y_test, Y_pred, 20, 'filled'); hold on;

plot([min(Y_test) max(Y_test)], [min(Y_test) max(Y_test)], 'r--','LineWidth',2);

xlabel('Actual Power (MW)');

ylabel('Predicted Power (MW)');

title('Actual vs Predicted Power');

grid on;

subplot(1,2,2);

histogram(residuals, 25, 'FaceColor',[0 .6 .6]);

xline(0, 'r--', 'LineWidth',2);

xlabel('Prediction Error (MW)');

title('Error Distribution');

grid on;

fprintf("Visualization complete.\nAll tasks successfully finished.\n");


Command Window:

Figure of Model:

4. Results
The model achieved high predictive accuracy, with typical R² values between 0.92 and 0.95. RMSE values were
below 5 MW and MAE typically below 3 MW. MAPE averaged around 3–4%. These results confirm that the
relationship between environmental variables and power output is predominantly linear. Visualizations
showed tightly clustered points around the diagonal line, indicating strong correlation, and the error
distribution centered around zero.

5. Discussion
Results indicate linear regression effectively models the CCPP dataset. Temperature and vacuum were found to
be strong predictors. Feature normalization improved model stability. Using separate folds for training and
testing increased reliability. Although linear regression performed well, future work could involve exploring
more advanced models such as neural networks or ensemble learning.
6. Conclusion
This study successfully implemented a linear regression model to predict electrical power output in a CCPP.
The approach was simple, computationally efficient, and demonstrated strong performance. Linear regression
proved sufficient for capturing the key relationships within the dataset and provides a strong baseline for
future predictive modeling efforts.

7. References
1. UCI Machine Learning Repository: Combined Cycle Power Plant Dataset.

2. Provided research paper on power plant thermal dynamics and regression.

3. MATLAB Documentation.

4. Montgomery, D. C. Introduction to Linear Regression Analysis.

5. Hastie, Tibshirani, Friedman. The Elements of Statistical Learning.

6. Willy Online Library.

7. Greek for Greeks.

You might also like