Experiment-2 MATLAB Codes +plots
Experiment-2 MATLAB Codes +plots
Experiment-2
xlabel('Output (MW)');
THERMAL UNITS USING MATLAB % Manually set limits and ticks for x and y axes for Figure-2
set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10
a = 550;
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
b = 8.1;
a = 550;
% Define Range for Power Output
b = 8.1;
p = 10:10:100;
c = 2.8;
% Calculate Function
% Calculate
P = a + b * p + c * (p).^2;
F_P = a./p + b + c * p;
% Plot Function in Figure-1
figure;
plot(p, P);
plot(p, dP_P);
title('Convex Input-Output Characteristics');
xlabel('Output (MW)');
ylabel('MBTU/hr or Rs./hr');
grid on;
% Manually set limits and ticks for x and y axes for Figure-1
% Manually set limits and ticks for x and y axes for Figure-2
xlim([0, 110]); % Set x-axis limits from 0 to 110
set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
% Define Parameters for Function
c = 2.8;
dF_dP = b + 2 * c * p;
figure;
plot(p, dF_dP);
Convex Incremental Heat Rate Characteristics Plot xlim([0, 110]); % Set x-axis limits from 0 to 110
Function-1 (Procedure):
ylim([0, 2000]); % Set y-axis limits from 0 to 2000
set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
a = 309;
b = 8.1;
c = 5.6;
figure;
plot(p, dF_dP);
xlabel('Output (MW)');
grid on;
% Manually set limits and ticks for x and y axes for Figure-2
MATLAB Code Convex Characteristics xlim([0, 110]); % Set x-axis limits from 0 to 110
% Define Parameters for Function set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10
a = 309; set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
c = 0.056; a = 309;
p = 10:10:100; c = 5.6;
figure; figure;
% Manually set limits and ticks for x and y axes for Figure-1 % Manually set limits and ticks for x and y axes for Figure-2
xlim([0, 110]); % Set x-axis limits from 0 to 110
MATLAB Code Convex Characteristics
ylim([0, 2000]); % Set y-axis limits from 0 to 2000 (Procedure) Function-3:
set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10 % Define Parameters for Function
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100 a = 307;
b = 8.1;
Convex Input-Output Characteristics Plot Function-2
(Procedure): c = 0.056;
p = 10:10:100;
% Calculate Function
P = a + b * p + c * (p).^2;
figure;
plot(p, P);
xlabel('Output (MW)');
ylabel('MBTU/hr or Rs./hr');
grid on;
set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
a = 307;
b = 8.1;
c = 5.6;
dF_dP = b + 2 * c * p;
Convex Net Heat Rate Characteristics Plot Function-2 % Plot Function in Figure-2
(Procedure):
figure;
plot(p, dF_dP);
xlabel('Output (MW)');
grid on;
% Manually set limits and ticks for x and y axes for Figure-2
set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
Convex Net Heat Rate Characteristics Plot Function-3
% Define Parameters for Function (Procedure):
a = 307;
b = 8.1;
c = 5.6;
% Calculate
F_P = a./p + b + c * p;
figure;
plot(p, dP_P);
xlabel('Output (MW)');
MATLAB Code Non-Convex Characteristics
ylabel('Unit Heat Rate Curve (Btu/kWh)');
(Procedure) Function-1:
grid on;
% Define the Parameters
% Manually set limits and ticks for x and y axes for Figure-2
a = 550;
xlim([0, 110]); % Set x-axis limits from 0 to 110
b = 8.1;
ylim([0, 2000]); % Set y-axis limits from 0 to 2000
c = 0.00028;
set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10
e = 300;
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
f = 0.035;
p = 10:10:100;
figure;
plot(p, P);
xlabel('Output (MW)');
ylabel('MBTU/hr or Rs./hr');
Convex Incremental Heat Rate Characteristics Plot Function-3 (Procedure):
xlim([0, 110]);
ylim([0, 2000]);
xticks([0:10:110]);
yticks([0:100:2000]);
grid on;
a = 550;
b = 8.1;
c = 0.028;
e = 300;
f = 0.035; Non-Convex Input-Output Characteristics Plot Function-1 (Procedure):
figure;
plot(p, dF_dP);
xlabel('Output (MW)');
xticks([0:10:110]);
yticks([0:100:2000]);
grid on;
a = 550;
b = 8.1;
c = 2.8;
e = 300;
f = 0.035;
Non-Convex Net Heat Rate Characteristics Plot
figure;
plot(p, F_P);
xlabel('Output (MW)');
xlim([0, 110]);
ylim([0, 2000]);
xticks([0:10:110]);
a = 309;
b = 8.1;
c = 0.00056;
e = 200;
f = 0.042;
% Define the Output Power Range f = 0.042;
% Calculate the Non-Convex Input-Output Characteristics F_P = a./p + b + c * p + abs(e * sin(f * (10 - p)))./p;
P = a + b * p + c * (p).^2 + abs(e * sin(f * (10 - p))); % Plot Non-Convex Net Heat Rate Characteristics
xticks([0:10:110]); yticks([0:100:2000]);
a = 309;
b = 8.1;
c = 0.056;
e = 200;
f = 0.042;
xlabel('Output (MW)');
xlim([0, 110]);
ylim([0, 2000]);
xticks([0:10:110]);
yticks([0:100:2000]);
grid on;
a = 309;
b = 8.1;
c = 5.6;
e = 200;
dF_dP = b + 2 * c * (p).^2 + abs(e * cos(f * (10 - p)) - f);
Non-Convex Net Heat Rate Characteristics Plot Function-2 (Procedure): % Plot Non-Convex Incremental Heat Rate Characteristics
figure;
plot(p, dF_dP);
xlabel('Output (MW)');
xlim([0, 110]);
ylim([0, 2000]);
xticks([0:10:110]);
b = 8.1; a = 307;
c = 0.00056; b = 8.1;
e = 150; c = 5.6;
f = 0.042; e = 150;
% Calculate the Non-Convex Input-Output Characteristics F_P = a./p + b + c * p + abs(e * sin(f * (10 - p)))./p;
P = a + b * p + c * (p).^2 + abs(e * sin(f * (10 - p))); % Plot Non-Convex Net Heat Rate Characteristics
xticks([0:10:110]); yticks([0:100:2000]);
yticks([0:100:2000]); grid on
grid on;
a = 307;
b = 8.1;
c = 0.056;
e = 150;
f = 0.042;
figure;
plot(p, P);
xlabel('Output (MW)');
ylabel('MBTU/hr or Rs./hr');
grid on;
% Manually set limits and ticks for x and y axes for Figure-1
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
a = 500;
b = 5.3;
c = 4;
dF_dP = b + 2 * c * p;
xlabel('Output (MW)');
grid on;
% Manually set limits and ticks for x and y axes for Figure-2
set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
a = 500;
b = 5.3;
b = 5.3;
c = 4;
c = 0.04;
% Calculate
p = 10:10:100;
% Plot Function in Figure-3
% Calculate Function
figure;
plot(p, dP_P); Convex Net Heat Rate Characteristics Plot Function-1 (Exercise):
xlabel('Output (MW)');
grid on;
% Manually set limits and ticks for x and y axes for Figure-2
set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
a = 400;
b = 5.5;
c = 0.06;
p = 10:10:100;
% Calculate Function
P = a + b * p + c * (p).^2;
figure;
Convex Incremental Heat Rate Characteristics Plot Function-1 (Exercise):
plot(p, P);
xlabel('Output (MW)');
ylabel('MBTU/hr or Rs./hr');
grid on;
% Manually set limits and ticks for x and y axes for Figure-1
set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
a = 400;
b = 5.5;
c = 6;
dF_dP = b + 2 * c * p;
% Plot Function in Figure-2 Convex Input-Output Characteristics Plot Function-2 (Exercise):
figure;
plot(p, dF_dP);
xlabel('Output (MW)');
grid on;
% Manually set limits and ticks for x and y axes for Figure-2
set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
b = 5.5;
c = 6;
% Calculate
F_P = a./p + b + c * p;
figure;
plot(p, dP_P);
xlabel('Output (MW)');
Convex Net Heat Rate Characteristics Plot Function-2 (Exercise):
grid on;
% Manually set limits and ticks for x and y axes for Figure-2
set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
a = 200;
b = 5.8;
c = 0.09;
p = 10:10:100;
% Calculate Function figure;
xlabel('Output (MW)'); % Manually set limits and ticks for x and y axes for Figure-2
% Maually set limits and ticks for x and y axes for Figure-1 set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10
xlim([0, 110]); % Set x-axis limits from 0 to 110 set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
ylim([0, 2000]); % Set y-axis limits from 0 to 2000 Convex Input-Output Characteristics Plot Function-3 (Exercise):
set(gca, 'XTick', 0:10:110); % Set x-axis ticks from 0 to 110 with step of 10
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
a = 200;
b = 5.8;
c = 9;
dF_dP = b + 2 * c * p;
% Plot Function in Figure-2 Convex Incremental Heat Rate Characteristics Plot Function-3 (Exercise):
figure;
plot(p, dF_dP);
xlabel('Output (MW)');
grid on;
% Manually set limits and ticks for x and y axes for Figure-2
set(gca, 'YTick', 0:100:2000); % Set y-axis ticks from 0 to 2000 with step of 100
a = 200;
b = 5.8;
c = 9;
% Calculate
F_P = a./p + b + c * p;