Вы находитесь на странице: 1из 32

MEMS 1051: APPLIED THERMODYNAMICS

Group Design Project


December 3, 2014
Team Superheat
Matt Adams
Kyle Fragassi
Rachel Rohr
Steven Terrana
Michelle Underwood

ABSTRACT
Problem Statement
We have been tasked to build a facility that can produce 80 MW of electrical power at minimum
cost. Three different cycle configurations were analyzed due to space considerations: a Brayton
cycle with regeneration, a single-shaft Brayton cycle combined with a Rankine cycle, and a splitshaft Brayton cycle combined with a Rankine cycle. The optimum configuration was then
analyzed to see if it could provide power at a competitive price.
Overview of Analysis
Using the air-standard assumption, the state points of all three configurations were found using a
set of assumptions and known relationships. A cost equation was developed based on machinery
initial costs, maintenance costs, and fuel costs. This cost was then determined for various
pressure ratios using MATLAB and plotted to view the results. This was done for each cycle
independently such that a unique optimum compressor pressure ratio was found corresponding to
the minimum cost for each cycle.
Results/Recommendations
As a result of our analysis, we recommend the second configuration of a single-shaft Brayton
cycle combined with a Rankine cycle. The single-shaft Brayton cycle and Rankine cycle has the
cheapest 10-year cycle (it is $4,110,827.33 less than the next cheapest cycle) while
simultaneously boasting the highest overall cycle efficiency. While this configuration uses a
49.29% higher compressor pressure ratio than the configuration with a split-shaft Brayton cycle,
the maximum pressure is only 1930.11 kPa, well within the safe pressure limits of the
machinery. This configuration will be able to provide power at a competitive price. At the
optimum compressor pressure ratio, the second configuration can provide power at
$0.033537/kWhr.
Risks or Downsides
While this analysis provided a reasonable comparison among the three configurations, in reality,
all three cost analyses are idealized and neglect a number of additional factors. First, by
eliminating the use of the air standard assumption, the cost per kW could be more accurately
predicted. Since atmospheric air is primarily made of ideal gasses, the air standard assumption
could be used to find enthalpy and entropy values. However, air also contains water vapor, which
is not accounted for in the assumption. Next, the cost analysis neglected the cost for piping. It is
also assumed that all machinery will maintain its initial efficient operation, which is not realistic
over a 10-year period. Last, inflation and other economic factors were neglected.
The cost analysis was also limited by the machinery available. While higher power machinery
will be more expensive, it could ultimately allow for a cheaper configuration due to increased
efficiency.
Page 2 of 32

PROBLEM DESCRIPTION
The facility being designed must be able to produce 80 MW of electrical power. Three different
cycle configurations were analyzed due to space considerations: a Brayton cycle with
regeneration, a single-shaft Brayton cycle combined with a Rankine cycle, and a split-shaft
Brayton cycle combined with a Rankine cycle. By combining the Rankine cycle with the
Brayton cycle, the large amount of energy that would have been lost from the Brayton cycle can
power the Rankine cycle and increase the work output, increasing the efficiency.
We first analyzed a Brayton cycle alone that utilizes two compressor stages, intercooling, two
turbine stages, two combustion chambers, and a regenerator.

Figure 1
First Brayton Cycle Configuration
The next two configurations combine both the Rankine and Brayton cycles. The second
configuration uses a single-shaft Brayton cycle with one stage of reheat, no intercooling, and no
regeneration, with a waste heat steam generator to allow for the Brayton cycle to supply the total
heating required for the Rankine cycle. In the single-shaft configuration, the work from each
turbine stage is identical.

Page 3 of 32

Figure 2
Second Configuration Includes a Single-Shaft Brayton Cycle
Combined with a Rankine Cycle
The third configuration uses a split-shaft Brayton cycle with one stage of reheat, no intercooling,
and no regeneration, with a waste heat steam to heat the Rankine cycle. In the split-shaft
configuration, the work produced from the first turbine is equal to the work required by the
compressor.

Figure 3
Third Configuration Includes a Split-Shaft Brayton Cycle
Combined with a Rankine Cycle
Page 4 of 32

The power plant was designed to operate 24 hours a day for 10 years. Each piece of equipment
would require maintenance throughout its life time; each year, the maintenance cost was
approximately 10% of the original cost of the machinery. The cost of each piece of equipment
was related to the cost of operation individually, and fuel costs encompass the whole cycle.
The given values for the cycle state points and machinery operation include:
Rankine Cycle
Turbine Inlet Pressure = 2000 kPa
Turbine Inlet Temperature = 370C
Turbine Outlet Pressure = 14 kPa
Condenser Outlet State = Sat. Liquid
Expansion Efficiency = 85%
Pump Efficiency = 65%

Brayton Cycle
Compressor Inlet Pressure = 101 kPa
(All) Compressor Inlet Temperature = 25C
Combustion/Reheat Exit Temp. = 1000C
Expansion Efficiency (all turbines) = 87%
Compression Efficiency = 85%
Regenerator Efficiency = 80%

The given values for the costs include:


Initial Costs:
Gas Compressor: $50/kW of required power input
Gas Turbine: $45/kW of gross power output
Gas Combustor: $2 per lbm/hr of air flow (note units here!)
Gas Reheat Combustor: $2 per lbm/hr of air flow
Gas Regenerator: $2 per lbm/hr of air flow being heated
Waste Heat Steam Generator: $5 per lbm/hr of steam flow through the generator
Steam Turbine: $40/kW of gross power output
Steam Condenser: $6 per lbm/hr of steam flow
Pump: $150/kW of required power input
Operating Costs:
The power plant will operate 24 hours/day for 10 years. To take leap years into account,
assume that there are 365.25 days/year.
Maintenance Costs:
Each year, each piece of equipment will require approximately 10% its initial cost for
parts and labor.
Fuel Costs:
Fuel costs $4/million Btus of heat transferred into the boilers in the Brayton cycle.

Page 5 of 32

DESCRIPTION OF ANALYSIS
To complete the analysis, the air-standard assumption was used. Air was treated as an ideal gas
without constant specific heats.
For all three Brayton configurations, the known state points were first established and the
enthalpy (h) values and standard entropy (s0) values were found using the Ideal Gas Properties of
Air Table from Fundamentals of Engineering Thermodynamics. For the Rankine cycles in the
second and third configuration, the known state points were established and the h and entropy (s)
values were found from the International Association for the Properties of Water and Steam.
For all three configurations, the following assumptions and equations were then used to find h
and s0 or s values for the unknown state points in each configuration:
1. Pressure stays constant across an intercooler, combustor, regenerator, condenser, and
waste heat steam generator.

2. =

Where:
= turbine/expansion efficiency
= enthalpy of the state point before the turbine
= ideal enthalpy of the state point after the turbine
= actual enthalpy of the state point after the turbine
3. =

Where:
= pump/compression efficiency
4. For the Brayton cycle (air), ideal enthalpy is solely dependent on ideal standard entropy.
Ideal standard entropy was found by treating the compressors and turbines as ideal and
isentropic. Isentropic ideal gases adhere to the following equation:
0 = 0 0 (

Where:
0 = ideal standard entropy of the state point after the compressor or turbine
0 = standard entropy of the state point before the compressor or turbine
= ideal gas constant for air
= pressure of the state point after the compressor or turbine
= pressure of the state point before the compressor or turbine

Page 6 of 32

For the compressor, =

Where:
= the compressor pressure ratio

For the turbine, =

Where:
= the turbine pressure ratio
Once 0 was calculated, could be found from the ideal gas properties air table.
5. For the Rankine cycle (steam), ideal enthalpy is dependent on two known characteristics
of a state point: ideal entropy and temperature, pressure, or quality. Ideal entropy is
found by treating the compressors and turbines as ideal and isentropic:
=
Where:
= ideal entropy of the state point after the compressor or turbine
= entropy of the state point before the compressor turbine
Based on and another known value, could be found from the steam tables.
For the first configuration, the following additional assumptions and equations were used:
1. The pressure ratio across each device was identical:
1 = 2 = 1 = 2 =
2. The mass flow rate of the air ( ) could be determined by the desired electrical power
production of the facility.
= 80,000
1 + 2 + 1 + 2 = 80,000
[(1 2 ) + (3 4 ) + (6 7 ) + (8 9 )] = 80,000
80,000
=
(1 2 ) + (3 4 ) + (6 7 ) + (8 9 )
For the second configuration, the following set of assumptions and equations were used:
1. The work from the first turbine must equal the work from the second turbine.
(3 4 ) = (5 6 ) 3 4 = 5 6

Page 7 of 32

Because all combustors and reheaters have the same exit temperature, the turbine inlet
temperatures are identical and therefore have the same enthalpy and entropy.
3 = 5
3 4 = 3 6 4 = 6
If the exit enthalpies are identical, the turbine outlet temperatures must be the same as
well. Therefore, the standard entropies of the outlets must be the same.
40 30 (
30 = 50
40 = 60
1 = 2 =

1
1
) = 60 50 ( )
1
2

2. Because 1 = 7 = 101 , the ratio by which the air is compressed must be equal to
the ratio by which the air is expanded.
= = 2
=
Therefore, the second configuration only had one variable that could be altered: .
3. The mass flow rate of the steam ( ) could be determined using the mass flow rate of the
air by performing an energy balance of the waste heat steam generator.
| | = | |
(8 11 ) = (6 7 )
6 7
=

8 11
4. The mass flow rate of the air could be determined by the desired electrical power
production of the facility.
= 80,000
+ 1 + 2 + + 3 = 80,000
[(1 2 ) + (3 4 ) + (5 6 )] + [(8 9 ) + (10 11 )] = 80,000
6 7
[(1 2 ) + (3 4 ) + (5 6 ) + (
) [(8 9 ) + (10 11 )]]
8 11
= 80,000
80,000
=
7
(1 2 ) + (3 4 ) + (5 6 ) + ( 6
) [(8 9 ) + (10 11 )]
8 11
Once was found, was calculated.
Page 8 of 32

For the third configuration, the following set of assumptions and equations were used:
1. The work from the first turbine must equal the work required by the compressor.
(3 4 ) = (2 1 ) 3 4 = 2 1
4 = 1 2 + 3
While 1 and 3 were predetermined from known temperatures, 2 varied with .
Once 4 was calculated, 4 could be found using the turbine efficiency equation. Then,
40 was found using the ideal air table and 4 . Using the ideal gas isentropic equation and
knowing 30 and 40 , it was established that 1 was a set value that could not vary
independently:
4 = 3

3 4

4 4

0 = 40 30 (

(4 3 )
1
) 1 =
1

2. Like the second configuration, 1 = 7 = 101 and the ratio by which the air is
compressed must be equal to the ratio by which the air is expanded.
= = 1 2

2 =
= ( )
1
4 3

Therefore, the third configuration had only one variable that could be altered: .
3. The mass flow rate of the steam ( ) could be determined using the mass flow rate of the
air by performing an energy balance of the waste heat steam generator.
| | = | |
(8 11 ) = (6 7 )
6 7
=

8 11
4. The mass flow rate of the air could be determined by the desired electrical power
production of the facility.
= 80,000
+ 1 + 2 + + 3 = 80,000
[(1 2 ) + (3 4 ) + (5 6 )] + [(8 9 ) + (10 11 )] = 80,000

Page 9 of 32

[(1 2 ) + (3 4 ) + (5 6 ) + (

6 7
) [(8 9 ) + (10 11 )]]
8 11

= 80,000
=

80,000
7
(1 2 ) + (3 4 ) + (5 6 ) + ( 6
) [(8 9 ) + (10 11 )]
8 11

Once was found, was calculated.


For the first configuration, the following equations were used to calculate the total cost over 10
years as well as the total cost per kW produced.
First, the initial costs of each piece of equipment were calculated. Note that absolute values of
the change in enthalpies were used because a loss in enthalpy will still correspond to a positive
cost.
$50

= (
) ( ) (|1 2 | + |3 4 |
)

$45

= (
) ( ) (|6 7 | + |8 9 |
)


= (2 ) (

= (

$2
3600 2.20462
) ( ) (
)(
)

$2
3600 2.20462
) ( ) (
)(
)

=
= +
+ +
Next, the yearly maintenance costs were calculated:
= ( )(10%)
Then, the yearly fuel costs were calculated:
=
$4
1

( 6
)(
) ( ) (|6 5 |
10 1.055

3600 24 365.25
+ |8 7 |
)(
)(
)(
)

Page 10 of 32

The total cost of the first configuration over the 10-year period could then be calculated with the
following equation:
= ( ) +
(10 )( + )
For the second and third configurations, the following equations were used to calculate the total
cost over 10 years as well as the total cost per kW produced.
First, the initial costs of each piece of equipment were calculated.
$50

= (
) ( ) (|1 2 |
)

$45

= (
) ( ) (|3 4 | + |5 6 |
)


$2
3600 2.20462
) ( ) (
)(
)

$40

= (
) ( ) (|8 9 |
)

$150

= (
) ( ) (|10 11 |
)

= (2 ) (

= (

$6
3600 2.20462
) ( ) (
)(
)

= (

$5
3600 2.20462
) ( ) (
)(
)

=
= +
+ +
+ +
+
Next, the yearly maintenance costs were calculated:
= ( )(10%)

Page 11 of 32

Then, the yearly fuel costs were calculated:


=
$4
1

( 6
)(
) ( ) (|3 2 |
10 1.055

3600 24 365.25
+ |5 4 |
)(
)(
)(
)

The total cost of the first configuration over the 10-year period could then be calculated with the
following equation:
= ( ) +
(10 )( + )
Using MATLAB, the total cost of each configuration was plotted as a function of the changing
pressure ratio to find the minimum total cost per kW of produced power and the optimum
compressor pressure ratio that resulted in the minimum total cost.

RESULTS AND RECOMMENDATIONS


For the first configuration with only a Brayton cycle, both the 10-year cost divided by the desired
80,000 kW and the price per kWhour were plotted against an increasing pressure ratio for each
device.

Figure 4
Pressure Ratio vs. Cost ($/kW) for the First Cycle Configuration

Page 12 of 32

Figure 5
Pressure Ratio vs. Price per kWhr ($/(kWhr)) for the First Cycle Configuration
The optimum device compressor pressure ratio was found to be 3.40 for a total pressure ratio of
11.56.
Table 1
Optimum Values for the First Cycle Configuration
Results for Configuration 1
Pressure Ratio:
Mass Flow Rate:
Cycle Efficiency:
Optimized Cost:
Optimized Cost per KW:
Optimized Cost per KW HR:

3.40
212.10 (kg/s)
47.85%
$239,301,394.66
$2,991.27
$0.034124

For the second configuration with a single-shaft Brayton cycle combined with a Rankine cycle,
both the 10-year cost divided by the desired 80,000 kW and the price per kWhour were plotted
against an increasing pressure ratio for each device.

Page 13 of 32

Figure 6
Pressure Ratio vs. Cost ($/kW) for the Second Cycle Configuration

Figure 7
Pressure Ratio vs. Price per kWhr ($/(kWhr)) for the Second Cycle Configuration

Page 14 of 32

The optimum compressor pressure ratio was found to be 19.11.


Table 2
Optimum Values for the Second Cycle Configuration
Results for Configuration 2
Compressor Pressure Ratio:
Turbine Pressure Ratio:
Cycle Efficiency:
Brayton Efficiency:
Rankine Efficiency:
Carnot Efficiency:
Brayton Mass Flow Rate:
Rankine Mass Flow Rate:
Optimized Cost:
Optimized Cost Per Kilowatt:
Optimized Cost Per KW HR:
Net Power From Brayton Cycle:
Net Power From Rankine Cycle:

19.11
4.3704
48.5489
32.4275
26.1187
95.8721
165.4867 (kg/s)
34.3728 (kg/s)
$235,190,567.33
$2,939.89
$0.033537
54104.07 KW (67.63%)
25895.93 KW (32.37%)

For the third configuration with a split-shaft Brayton cycle combined with a Rankine cycle, both
the 10-year cost divided by the desired 80,000 kW and the price per kWhour were plotted
against an increasing pressure ratio for each device.

Page 15 of 32

Figure 8
Pressure Ratio vs. Cost ($/kW) for the Third Cycle Configuration

Figure 9
Pressure Ratio vs. Price per kWhr ($/(kWhr)) for the Third Cycle Configuration

Page 16 of 32

The optimum compressor pressure ratio was found to be 12.79.


Table 3
Optimum Values for the Third Cycle Configuration
Results for Configuration 3
Compressor Pressure Ratio:
Turbine Pressure Ratio:
Cycle Efficiency:
Brayton Efficiency:
Rankine Efficiency:
Carnot Efficiency:
Brayton Mass Flow Rate:
Rankine Mass Flow Rate:
Optimized Cost:
Optimized Cost Per KW HR:
Optimized Cost per KW:
Net Power From Brayton Cycle:
Net Power From Rankine Cycle:

12.79
3.1618
46.78
29.8974
26.1187
95.8721
160.4605 (kg/s)
37.3569 (kg/s)
$239,732,241.55
$0.034185
$2,996.66
47946.55 KW (59.93%)
32053.45 KW (40.07%)

As a result of these findings, we recommend the second configuration of a single-shaft Brayton


cycle combined with a Rankine cycle. Configuration two has the cheapest 10-year cycle (it is
$4,110,827.33 less than the next cheapest cycle) while simultaneously boasting the highest
overall cycle efficiency. While configuration two uses a 49.29% higher compressor pressure
ratio than configuration three with a split-shaft Brayton cycle, the maximum pressure is only
1930.11 kPa, well within the safe pressure limits of the machinery.
This configuration will be able to provide power at a competitive price. At the optimum
compressor pressure ratio, the second configuration can provide power at $0.033537/kWhr.
According to the U.S. Energy Information Administrations most recent Electricity Monthly
Update from September 2014, the average national retail cost was $0.1080/kWhr. The average
national residential cost was $0.1294/kWhr. In Pennsylvania, the average residential cost was
even higher at $0.1349/kWhr.

Page 17 of 32

CONCLUSION
While this analysis provided a reasonable comparison among the three configurations, in reality,
all three cost analyses are idealized and neglect a number of additional factors. First, by
eliminating the use of the air standard assumption, the cost per kW could be more accurately
predicted. Since atmospheric air is primarily made of ideal gasses, the air standard assumption
could be used to find enthalpy and entropy values. However, air also contains water vapor, which
is not accounted for in the assumption. Next, the cost analysis neglected the cost for piping. It
also assumed that all machinery will maintain its initial efficient operation, which is not realistic
over a 10-year period. Last, inflation and other economic factors were neglected.
The cost analysis was also limited by the machinery available. While higher power machinery
will be more expensive, it could ultimately allow for a cheaper configuration due to increased
efficiency.
Additionally, although we successfully found a minimum total cost and optimum pressure ratio
for all three configurations, it would be beneficial to investigate the spikes in cost found in the
cost vs. pressure ratio graph to understand their origin.

Page 18 of 32

APPENDIX
References
"Electricity Monthly Update With Data for September 2014." U.S. Energy Information
Administration (EIA). 25 Nov. 2014. Web. 28 Nov. 2014.
<http://www.eia.gov/electricity/monthly/update/end_use.cfm>.
Holmgen, Magnus (1999) XSteam [MATLAB Function] Available at
<http://www.mathworks.com/matlabcentral/fileexchange/9817-x-steam--thermodynamicproperties-of-water-and-steam> (Accessed November 25th, 2014)
Johnsons (Revised) Universal Cyclopedia Scientific and Popular Treasury of Useful
Knowledge. (1886). A.J. Johnson & Company.
Macquorn, William John (2008). Rankine. Complete Dictionary of Scientific Biography.
Miller, Jared (2009) IdealAir [MATLAB Function]. Available at
<http://www.mathworks.com/matlabcentral/fileexchange/25030-ideal-air-properties>
(Accessed November 25th, 2014)

Page 19 of 32

Matlab Code

%% Cycle One
% These variables determine the start and end
% points for the pressure ratio r to be varied.
startpoint = 1;
endpoint
= 10;
step
= 0.1;
% initializes the indexing variable for storing
% the data generated by the loop
i = 1;
for r =startpoint :step: endpoint
% Pressures (KPa)
P1
= 101;
P2
= P1 * r;
P3
= P2;
P4
= P3 * r;
P5
= P4;
P6
= P4;
P7
= P6 / r;
P8
= P7;
P9
= P1;
P10
= P1;

P2_ideal = P2;
P4_ideal = P4;
P7_ideal = P7;
P9_ideal = P9;

% Known Temperatures (K)


T1 = 298;
T3 = T1;
T6 = 1273;
T8 = T6;
% Known Enthalpies and Standard Entropies
S1 = IdealAir(T1,'T','so');
H1 = IdealAir(T1,'T','h');
S3 = IdealAir(T3,'T','so');
H3 = IdealAir(T3,'T','h');
S6 = IdealAir(T6,'T','so');
H6 = IdealAir(T6,'T','h');
S8 = IdealAir(T8,'T','so');
H8 = IdealAir(T8,'T','h');

% Finding Standard Entropies of Ideal States


R = 0.2869;
S2_ideal = S1 + R * log(P2/P1);
S4_ideal = S3 + R * log(P4/P3);
S7_ideal = S6 + R * log(P7/P6);
S9_ideal = S8 + R * log(P9/P8);
% Finding ideal enthalpies by using IdealAir
% to look up thermodynamic properties of air,
based on the ideal entropies found
previously.
h =
IdealAir([S2_ideal,S4_ideal,S7_ideal,S9_ideal],'so
','h');
H2_ideal = h(1);
H4_ideal = h(2);
H7_ideal = h(3);
H9_ideal = h(4);
% Finding actual enthalpies
compressor_efficiency
turbine_efficiency
regeneration_efficiency

= 0.85;
= 0.87;
= 0.80;

% For the statepoints after the


% compressors
H2 = H1 - (H1 - H2_ideal) /
compressor_efficiency;
H4 = H3 - (H3 - H4_ideal) /
compressor_efficiency;
% For the statepoints after the turbines
H7 = H6 - turbine_efficiency * (H6
H7_ideal);
H9 = H8 - turbine_efficiency * (H8
H9_ideal);
% For the statepoint after the regenerator
H5 = regeneration_efficiency * (H9-H4) +
H4;

Page 20 of 32

Matlab Code
% Finding Mass Flow Rate:
% desired_output = m * (Wt1 + Wt2 - Wc1 % Wc2);
desired_output = 80 * 10^3; % KW
m = desired_output / (H6 - H7 + H8 - H9 +
H1 - H2 + H3 - H4); % kg/s
% Finding H10 using a basic energy balance
H10 = H4 - H5 + H9;
% Populates the Pressure_Ratio matrix
Pressure_Ratio(i) = r;

% Finding the rest of the state points, for


% documentation
T2 = IdealAir(H2,'h','T');
S2 = IdealAir(H2,'h','so');
T4 = IdealAir(H4,'h','T');
S4 = IdealAir(H4,'h','so');
T5 = IdealAir(H5,'h','T');
S5 = IdealAir(H5,'h','so');

% Cost Equations
% Initial Costs
% Compressor
a = 50;
Wc1 = m * abs(H1 - H2); % KW into
Wc2 = m * abs(H3 - H4); % KW into
ic_compressors = a * (Wc1 + Wc2);
%Turbine
b = 45;
Wt1 = abs( m * (H6 - H7) ); % KW
Wt2 = abs( m * (H8 - H9) ); % KW
ic_turbines = b * (Wt1 + Wt2);
% Air Flow Costs
ic_airflow = 3 * ( 2 * (m * 3600

% Total Cost for 10 years


Total_Cost(i) = initial_costs + 10 *
(Maintenance + Fuel_Cost);

T7 = IdealAir(H7,'h','T');
S7 = IdealAir(H7,'h','so');
compressor 1
compressor 2

T9 = IdealAir(H9,'h','T');
S9 = IdealAir(H9,'h','so');
T10 = IdealAir(H10,'h','T');
S10 = IdealAir(H10,'h','so');

out of T1
out of T2
* 2.20462));

initial_costs = ic_compressors + ic_turbines +


ic_airflow;
% Maintenance Costs Per Year
Maintenance = (0.10) * initial_costs;
% Fuel Costs Per Year
Qin1 = abs( m * (H5 - H6) ); %KW into C1
Qin2 = abs( m * (H7 - H8) ); %KW into C2
Qin = Qin1 + Qin2;
Fuel_Cost = Qin * 1000 * 365.25 * 24 * 3600 *
(1/1055.05585) * (4 / 106);

% This if statement stores the mass flow rate,


% optimized pressure ratio, and statepoint
% data for the minimized cost.
if Total_Cost(i) == min(Total_Cost)
ideal_m = m;
Ideal_Pressure_Ratio = Pressure_Ratio(i);
Minimized_Cost = Total_Cost(i);
Ideal_Cycle_Efficiency = desired_output /
Qin * 100;
T = [T1 T2 T3 T4 T5 T6 T7 T8 T9 T10];
H = [H1 H2 H3 H4 H5 H6 H7 H8 H9 H10];
S = [S1 S2 S3 S4 S5 S6 S7 S8 S9 S10];
end

Page 21 of 32

Matlab Code
% These logical constructs show a plot of the
% cost per kilowatt over the life of the plant
% as they update in real time based on the
% progress of the for loop. A horizontal
% black dotted line is created at the minimum
% cost piont, as well as a stem plot at the
% minimum to clearly identify it. These also
% update in real time with the loop.
if i == 2
% Plotting our results
figs(1)=figure('WindowStyle','docked','Name',
'Cycle 1 Pressure Ratio Versus
Cost/KW','NumberTitle','off');
h1= plot(Pressure_Ratio(2),Total_Cost(2)/desired_output,
'LineWidth',2); hold on;
xlabel('Pressure Ratio','FontSize',20)
ylabel('Total Cost
($/KW)','FontSize',20)
title('Pressure Ratio Versus
Cost','FontSize',22)
set(gca,'FontSize',15)
axis([ 0 endpoint 0 6000])
h2 =
stem(Ideal_Pressure_Ratio,Minimized_Cost/desired_output,
'color','r','LineWidt
h',2);
h3 = line( [ 0 endpoint ],
Minimized_Cost/desired_output *
ones(1,2),'LineStyle','--','Color','k');
h4 =
plot(Pressure_Ratio(2),Total_Cost(2)/desired_outpu
t,'*','LineWidth',2,'MarkerFaceColor','y','MarkerE
dgeColor','r');
tilefigs
elseif i>2
set(h1,'XData',Pressure_Ratio(2:end),'YData',
Total_Cost(2:end)/desired_output)

set(h2,'XData',Ideal_Pressure_Ratio,'YData',
Minimized_Cost/desired_output)
set(h3,'Ydata', Minimized_Cost/desired_output *
ones(1,2))
set(h4,'XData',Pressure_Ratio(end),'YData',
Total_Cost(end)/desired_output)
End
pause(0.01) % for lack of better words, without
% this pause the script trips over
% itself.
i = i + 1;
end
% Finding the minimum cost and ideal pressure
ratio
[Minimized_Cost,index] = min(Total_Cost);
Ideal_Pressure_Ratio
=
Pressure_Ratio(index);
% Converting the money into a readable format
dollars = commas(floor(Minimized_Cost));
cents = Minimized_Cost floor(Minimized_Cost);
cents = ceil(cents * 100);
money = ['$',dollars,'.',num2str(cents)];
% Converting the price per KW into a readable
format
perkw
= Minimized_Cost / (desired_output);
dollars = commas(floor(perkw));
cents
= perkw - floor(perkw);
cents
= ceil(cents * 100);
perkw
= ['$',dollars,'.',num2str(cents)];
% Finding price per kilowatt hour
kwhr = desired_output * 10 * 365.25 * 24;
priceperkwhr = Minimized_Cost / kwhr ;

Page 22 of 32

Matlab Code
axis([ 0 endpoint 0 .05])
% Converting the mass flow rate into a readable
format
n = commas(floor(ideal_m));
d = ideal_m - floor(ideal_m);
dec = ceil(d * 100);
flow = [n,'.',num2str(dec)];
% Display the results
disp(' ')
cprintf('_black','
Results for Cycle 1
\n')
cprintf('black',['
Ideal Pressure Ratio:
',num2str(Ideal_Pressure_Ratio),'\n'])
cprintf('black',['
Mass Flow Rate:
',flow,' (kg/s)\n'])
cprintf('black',[' Ideal Cycle Efficiency:
',num2str(Ideal_Cycle_Efficiency),' %%
\n\n'])
cprintf('black',['
Optimized Cost:
',money,'\n'])
cprintf('black',['
Optimized Cost per KW:
',perkw,'\n'])
cprintf('black',['Optimized Cost per KW HR:
$',num2str(priceperkwhr),'\n'])
disp(' ')
% Plotting Price Vs. Compressor Pressure Ratio
figs(2)=figure('WindowStyle','docked','Name',
'Cycle 1 - Pressure Ratio vs Cost Per
KW-HR','NumberTitle','off');
plot(Pressure_Ratio,Total_Cost/(desired_output *
10 * 365.25 * 24),'LineWidth',2); hold
on;
ax(2) = gca;
xlabel('Pressure Ratio','FontSize',20)
ylabel('Price per KW-HR
($)','FontSize',20)
title('Pressure Ratio Versus
Cost','FontSize',22)
set(gca,'FontSize',15)

stem(Ideal_Pressure_Ratio,Minimized_Cost/(
desired_output * 10 * 365.25 *
24),'color','r','LineWidth',2);
line( [ 0 endpoint],Minimized_Cost/(desired_output
* 10 * 365.25 * 24) * ones(1,2),
'LineStyle','--','Color','k');
clear all;
%% Cycle Two
% RANKINE PORTION OF THE CYCLE
% Pressures
P8 = 20;
P9 = .14;
P10 = P9;
P11 = P8;

%
%
%
%

BAR
BAR
BAR
BAR

% Known Temperatures
T8 = 370; % deg C
% Enthalpy and Entropy for State 8 as a
% function of Pressure and Temperature
H8 = XSteam('h_pT',P8,T8);
S8 = XSteam('s_pT',P8,T8);
% Ideal Entropy for State 9
S9_ideal = S8;
% Finding ideal enthalpy at State 9
H9_ideal = XSteam('h_ps',P9,S9_ideal);
% Finding H9 and subsequently T9
rankine_turbine_efficiency = 0.85;
H9 = H8 - rankine_turbine_efficiency * (H8 H9_ideal);
T9 = XSteam('T_ph',P9,H9); % deg C
S9 = XSteam('s_ph',P9,H9);

Page 23 of 32

Matlab Code
% Finding enthalpy and entropy for State 10 and
subsequently T10
% At state 10, x = 0;
H10 = XSteam('hL_p',P10);
S10 = XSteam('sL_p',P10);
T10 = XSteam('T_ph',P10,H10); % deg C
% Finding ideal entropy for State 11
S11_ideal = S10;
% Finding ideal enthalpy for State 11
H11_ideal = XSteam('h_ps',P11,S11_ideal);
% Finding actual enthalpy for State 11 and
% subsequently T11
rankine_pump_efficiency
= 0.65;
H11 = H10 + (H11_ideal - H10) /
rankine_pump_efficiency;
T11 = XSteam('T_ph',P11,H11); % C
S11 = XSteam('s_ph',P11,H11);
%
%
%
%
%
%
%

Determines the start and end points for the


compressor pressure ratio as well as the turbine
pressure ratio and sets the steps to increase
by. Every combination of compressor pressure
ratio and turbine pressure ratio between the
start and end points will be analyzed for a
minimum cost.
step = .1;
startpointc = 1;
endpointc
= 30;

% initializes the indexing variable to store the


% data generated by the for loops.
i = 1;
for compressor_pressure_ratio = startpointc :step:
endpointc

% Known Temperatures
T1 = 298;
%
T3 = 1273;
%
T5 = T3;
%
T7 = T11 + 273 + 30;%

K
K
K
K

% Known Enthalpies and Standard Entropies


S1 = IdealAir(T1,'T','so');
H1 = IdealAir(T1,'T','h');
S3 = IdealAir(T3,'T','so');
H3 = IdealAir(T3,'T','h');
S5 = IdealAir(T5,'T','so');
H5 = IdealAir(T5,'T','h');
S7 = IdealAir(T7,'T','so');
H7 = IdealAir(T7,'T','h');
% Define the turbine pressure ratio so P7 = P1;
turbine_pressure_ratio =
sqrt(compressor_pressure_ratio);
% Finding Standard Entropies of Ideal States
R = 0.2869;
S2_ideal = S1 + R *
log(compressor_pressure_ratio);
S4_ideal = S3 + R * log(1 /
turbine_pressure_ratio);
S6_ideal = S5 + R * log(1 /
turbine_pressure_ratio);
% Finding ideal enthalpies
h=IdealAir([S2_ideal,S4_ideal,S6_ideal],'so','h');
H2_ideal = h(1);
H4_ideal = h(2);
H6_ideal = h(3);

% BRAYTON PORTION OF CYCLE

Page 24 of 32

Matlab Code
% Finding actual enthalpies
brayton_compressor_efficiency
brayton_turbine_efficiency

= 0.85;
= 0.87;

H2 = H1 - (H1 - H2_ideal) /
brayton_compressor_efficiency;
T2 = IdealAir(H2,'h','T');
S2 = IdealAir(H2,'h','so');
H4 = H3 - brayton_turbine_efficiency * (H3
H4_ideal);
T4 = IdealAir(H4,'h','T');
S4 = IdealAir(H4,'h','so');
H6 = H5 - brayton_turbine_efficiency * (H5
H6_ideal);
T6 = IdealAir(H6,'h','T');
S6 = IdealAir(H6,'h','so');
% Determining Mass Flow Rates from the net work
% equation and the energy balance of the waste
% heat generator
desired_output = 80 * 10^3; % KW
waste_heat_generator_efficiency = 1 ;
constant = H1 - H2 + H3 - H4 + H5 - H6 +
waste_heat_generator_efficiency *
((H6-H7)/(H8-H11))* (H8-H9+H10-H11);
m_brayton = desired_output / constant;
m_rankine = ( (H6 - H7)/(H8-H11) ) * m_brayton *
waste_heat_generator_efficiency;
% Populating the pressure ratio matrices
cpr_matrix(i)
= compressor_pressure_ratio;

% Cost Equation
% Initial Costs
% Rankine Turbine
c = 40;
Wt3 = m_rankine * abs(H8 - H9); % KW out of T1
ic_rankine_turbine = c * Wt3;
% Rankine Pump
d = 150;
Wp = m_rankine * abs(H10 - H11); % KW into pump
ic_rankine_pump = d * Wp;
% Waste Heat Steam Generator Air Flow Cost
ic_waste_heat_airflow = 5 * (m_rankine * 3600 *
2.20462);
% Condenser Air Flow Cost
ic_rankine_condenser_airflow = 6 * (m_rankine *
3600 * 2.20462);
Rankine_Initial_Costs = ic_rankine_turbine +
ic_rankine_pump +
ic_waste_heat_airflow +
ic_rankine_condenser_airflow;
Rankine_Power = Wt3 - Wp;
% Brayton Compressor
a = 50;
Wc = m_brayton * abs(H1 - H2); % KW into comp.
ic_brayton_compressors = a * Wc;
% Brayton Turbines
b = 45;
Wt1 = m_brayton * abs(H3 - H4); % KW out of T1
Wt2 = m_brayton * abs(H5 - H6); % KW out of T2
ic_brayton_turbines = b * (Wt1 + Wt2);
% Brayton Air Flow Costs
ic_brayton_airflow = 2 * ( 2 * (m_brayton * 3600 *
2.20462));
Brayton_Initial_Costs = ic_brayton_compressors +
ic_brayton_turbines +
ic_brayton_airflow;
Brayton_Power = Wt1 + Wt2 - Wc;

Page 25 of 32

Matlab Code

% Determines the total inital costs


initial_costs = Rankine_Initial_Costs +
Brayton_Initial_Costs;
% Maintenance Costs Per Year
Maintenance = (0.10) * initial_costs;
% Fuel Costs Per Year
Qin1 = m_brayton * abs(H2 - H3); %KW into C1
Qin2 = m_brayton * abs(H4 - H5); %KW into C2
Qin = Qin1 + Qin2;

Ideal_Cycle_Efficiency =
cycle_efficiency(i);
Ideal_Carnot_Efficiency = carnot;
Ideal_Brayton_Efficiency =
brayton_efficiency(i);
Ideal_Rankine_Efficiency =
rankine_efficiency(i);
Minimized_Cost = Total_Cost(i);
ideal_T = [T1 T2 T3 T4 T5 T6 T7 T8+273
T9+273 T10+273 T11+273];
ideal_S = [S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11];
ideal_H = [H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11];
end

Fuel_Cost = Qin * 1000 * 365.25 * 24 * 3600 *


(1/1055.05585) * (4 / 10^6);
% Total Cost for 10 years
Total_Cost(i) = initial_costs + 10 * (Maintenance
+ Fuel_Cost);
% Calculates the efficiencies of each cycle
% overall efficiency
cycle_efficiency(i) = desired_output / Qin * 100;
% brayton effiency
brayton_efficiency(i) = (Wt1 + Wt2 - Wc) / Qin *
100;
% rankine efficiency
heat_transferred = m_rankine * abs(H11 - H8);
rankine_efficiency(i) = (Wt3 - Wp)/
heat_transferred * 100;
% carnot efficiency
T = [T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11];
carnot = (1 - min(T)/max(T)) * 100;
if Total_Cost(i) == min(Total_Cost)
ideal_m_brayton = m_brayton;
ideal_m_rankine = m_rankine;
Ideal_Compressor_Ratio =
compressor_pressure_ratio;
Ideal_Turbine_Ratio =
turbine_pressure_ratio;

% These graphs update in real time as the for


% index.
if i == 2
% Plotting Price Vs. Compressor
Pressure Ratio
figs(3)=figure('WindowStyle','docked','Name',
'Cycle 2 - CPR vs Cost Per
KW','NumberTitle','off');
h5 = plot(cpr_matrix(2),Total_Cost(2)/desired_output,
'LineWidth',2); hold on;
ax(2) = gca;
xlabel('Compressor Pressure
Ratio','FontSize',20)
ylabel('Total Cost
($/KW)','FontSize',20)
title('Compressor Pressure
Ratio Versus
Cost','FontSize',22)
set(gca,'FontSize',15)
axis([ 0 endpointc 0 max(Total_Cost)/desired_output])

h6 = stem(Ideal_Compressor_Ratio,Minimized_Cost/
desired_output,'color','r','LineWidth',2);

Page 26 of 32

Matlab Code
h7 = line( [ 0 endpointc],
Minimized_Cost/desired_output *
ones(1,2),'LineStyle','--','Color','k');
h8 = plot(cpr_matrix(2),Total_Cost(2)/desired_output,

'*','LineWidth',2,'MarkerFaceColor','y',
'MarkerEdgeColor','r');
% makes the figure windows equally sized
Tilefigs(figs)
elseif i>2
set(h5,'XData',cpr_matrix,'YData',Total_Cost/
desired_output)
set(h6,'Xdata',Ideal_Compressor_Ratio,'YData',
Minimized_Cost/desired_output)
set(h7,'YData',Minimized_Cost/desired_output *
ones(1,2))
set(h8,'XData',cpr_matrix(end),'YData',
Total_Cost(end)/desired_output)
end
pause(.001)
i = i + 1;
end
% Converting the money into a readable format
dollars = commas(floor(Minimized_Cost));
cents = Minimized_Cost floor(Minimized_Cost);
cents = ceil(cents * 100);
money = ['$',dollars,'.',num2str(cents)];
% Converting the price per KW into a readable
format
perkw
= Minimized_Cost / desired_output;
dollars = commas(floor(perkw));
cents
= perkw - floor(perkw);
cents
= ceil(cents * 100);
perkw
= ['$',dollars,'.',num2str(cents)];

% Finding price per kilowatt hour


kwhr = desired_output * 10 * 365.25 * 24;
priceperkwhr = Minimized_Cost / kwhr ;
% Display the results
disp(' ')
cprintf('_black','
Results for Cycle 2
\n')
cprintf('black',[' Ideal Compressor Pressure
Ratio: ',
num2str(Ideal_Compressor_Ratio),'\n'])
cprintf('black',['
Ideal Turbine Pressure
Ratio: ',
num2str(Ideal_Turbine_Ratio),'\n\n'])
cprintf('black',['
Ideal Cycle
Efficiency: ',
num2str(Ideal_Cycle_Efficiency),'\n'])
cprintf('black',['
Ideal Brayton
Efficiency: ',
num2str(Ideal_Brayton_Efficiency),'\n'])
cprintf('black',['
Ideal Rankine
Efficiency: ',
num2str(Ideal_Rankine_Efficiency),'\n'])
cprintf('black',['
Carnot
Efficiency: ',
num2str(Ideal_Carnot_Efficiency),'\n\n'])
cprintf('black',['
Ideal Brayton Mass Flow
Rate: ',
num2str(ideal_m_brayton),' (kg/s)\n'])
cprintf('black',['
Ideal Rankine Mass Flow
Rate: ',
num2str(ideal_m_rankine),
' (kg/s)\n\n'])
cprintf('black',['
Optimized
Cost: ',money,'\n'])
cprintf('black',['
Optimized Cost Per
Kilowatt: ',perkw,'\n'])
cprintf('black',['
Optimized Cost Per
KW HR: $',
num2str(priceperkwhr),'\n\n'])

Page 27 of 32

Matlab Code
cprintf('black',['
Net Power From Brayton
Cycle: ',
num2str(Brayton_Power,'%.2f'),' KW (',
num2str(Brayton_Power/desired_output *
100,'%.2f'),'%%) \n'])
cprintf('black',['
Net Power From Rankine
Cycle: ',
num2str(Rankine_Power,'%.2f'),' KW (',
num2str(Rankine_Power/desired_output *
100,'%.2f'),'%%) \n'])
disp(' ')
% Plotting Price Vs. Compressor Pressure Ratio
figs(4)=figure('WindowStyle','docked','Name',
'Cycle 2 - CPR Vs Cost Per KWHR','NumberTitle','off');
plot(cpr_matrix,Total_Cost/(desired_output * 10 *
365.25 * 24),'LineWidth',2); hold on;
ax(2) = gca;
xlabel('Compressor Pressure
Ratio','FontSize',20)
ylabel('Price per KW-HR
($)','FontSize',20)
title('Compressor Pressure Ratio
Versus Cost','FontSize',22)
set(gca,'FontSize',15)
axis([ 0 endpointc 0 .05])
stem(Ideal_Compressor_Ratio,Minimized_Cost/
(desired_output * 10 * 365.25 *
24),'color','r','LineWidth',2);
line( [ 0 endpointc], Minimized_Cost/
(desired_output * 10 * 365.25 * 24) *
ones(1,2),'LineStyle','--','Color','k');
%% Cycle Three
clear all;

% RANKINE PORTION OF THE CYCLE


% Pressures
P8 = 20;
P9 = .14;
P10 = P9;
P11 = P8;

%
%
%
%

% Temperatures
T8 = 370;

% deg C

BAR
BAR
BAR
BAR

% Enthalpy and Entropy for State 8 as a


% function of Pressure and Temperature
H8 = XSteam('h_pT',P8,T8);
S8 = XSteam('s_pT',P8,T8);
% Ideal Entropy for State 9
S9_ideal = S8;
% Finding ideal enthalpy at State 9
H9_ideal = XSteam('h_ps',P9,S9_ideal);
% Finding H9
rankine_turbine_efficiency = 0.85;
H9 = H8 - rankine_turbine_efficiency * (H8 H9_ideal);
T9 = XSteam('T_ph',P9,H9); % deg C
% Finding
H10 =
S10 =
T10 =

enthalpy and entropy for State 10


XSteam('hL_p',P10);
XSteam('sL_p',P10);
XSteam('T_ph',P10,H10); % deg C

% Finding ideal entropy for State 11


S11_ideal = S10;
% Finding ideal enthalpy for State 11
H11_ideal = XSteam('h_ps',P11,S11_ideal);

Page 28 of 32

Matlab Code
% Finding actual enthalpy for State 11
rankine_pump_efficiency
= 0.65;
H11 = H10 + (H11_ideal - H10) /
rankine_pump_efficiency;
% Finding the temperature at State 11
T11 = XSteam('T_ph',P11,H11); % C
% BRAYTON PORTION OF CYCLE
% Temperatures
T1 = 298;
%
T3 = 1273;
%
T5 = T3;
%
T7 = T11 + 273 + 30;%

K
K
K
K

% Known Enthalpies and Standard Entropies


S1 = IdealAir(T1,'T','so');
H1 = IdealAir(T1,'T','h');
S3 = IdealAir(T3,'T','so');
H3 = IdealAir(T3,'T','h');
S5 = IdealAir(T5,'T','so');
H5 = IdealAir(T5,'T','h');
S7 = IdealAir(T7,'T','so');
H7 = IdealAir(T7,'T','h');
step = .1;
startpointc = 1;
endpointc
= 30;
i=1;
for compressor_pressure_ratio = startpointc :step:
endpointc
% Finding Standard Entropies of Ideal States
R = 0.2869;
S2_ideal = S1 + R *
log(compressor_pressure_ratio);

% Finding actual enthalpies


brayton_compressor_efficiency
brayton_turbine_efficiency

= 0.85;
= 0.87;

H2 = H1 - (H1 - H2_ideal) /
brayton_compressor_efficiency;
T2 = IdealAir(H2,'h','T');
H4 = H1 + H3 - H2;
T4 = IdealAir(H4,'h','T');
S4 = IdealAir(H4,'h','so');
H4_ideal = H3 - (H3H4)/brayton_turbine_efficiency;
S4_ideal = IdealAir(H4_ideal,'h','so');
Brayton_T1_Ratio = exp( -1 * (S4_ideal-S3)/R);
Brayton_T2_Ratio = compressor_pressure_ratio /
Brayton_T1_Ratio;
S6_ideal = S5 + R * log(1 / Brayton_T2_Ratio);
H6_ideal = IdealAir(S6_ideal,'so','h');
H6 = H5 - brayton_turbine_efficiency * (H5 H6_ideal);
T6 = IdealAir(H6,'h','T');
% Create Temperature Matrix
T = [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
T11];
% Determining Mass Flow Rates
desired_output = 80 * 10^3; % KW
waste_heat_generator_efficiency = 1 ;
constant = H1 - H2 + H3 - H4 + H5 - H6 +
waste_heat_generator_efficiency *
((H6-H7)/(H8-H11))* (H8-H9+H10-H11);
m_brayton = desired_output / constant;
m_rankine = ( (H6 - H7)/(H8-H11) ) * m_brayton *
waste_heat_generator_efficiency;

% Finding ideal enthalpies


h = IdealAir(S2_ideal,'so','h');
H2_ideal = h(1);

Page 29 of 32

Matlab Code
% Populating the pressure ratio matrices
cpr_matrix(i)
= compressor_pressure_ratio;
% Cost Equation
% Initial Costs
% Rankine Turbine
c = 40;
Wt3 = m_rankine * abs(H8 - H9); % KW out of T3
ic_rankine_turbine = c * Wt3;
% Rankine Pump
d = 150;
Wp = m_rankine * abs(H10 - H11); % KW into pump
ic_rankine_pump = d * Wp;
% Waste Heat Steam Generator Air Flow Cost
ic_waste_heat_airflow = 5 * (m_rankine * 3600 *
2.20462);
% Condenser Air Flow Cost
ic_rankine_condenser_airflow = 6 * (m_rankine *
3600 * 2.20462);
Rankine_Initial_Costs = ic_rankine_turbine +
ic_rankine_pump +
ic_waste_heat_airflow +
ic_rankine_condenser_airflow;
Rankine_Power = Wt3 - Wp;
% Brayton Compressor
a = 50;
Wc = m_brayton * abs((H1 - H2) ); % KW into comp
ic_brayton_compressors = a * Wc;
% Brayton Turbines
b = 45;
Wt1 = m_brayton * abs(H3 - H4); % KW out of T1
Wt2 = m_brayton * abs(H5 - H6); % KW out of T2
ic_brayton_turbines = b * (Wt1 + Wt2);
% Brayton Air Flow Costs
ic_brayton_airflow = 2 * ( 2 * (m_brayton * 3600 *
2.20462));

Brayton_Initial_Costs = ic_brayton_compressors +
ic_brayton_turbines +
ic_brayton_airflow;
Brayton_Power = Wt1 + Wt2 - Wc;
initial_costs = Rankine_Initial_Costs +
Brayton_Initial_Costs;
% Maintenance Costs for one year
Maintenance = (0.10) * initial_costs;
% Fuel Costs for one year
Qin1 = m_brayton * abs(H2 - H3); %KW into C1
Qin2 = m_brayton * abs(H4 - H5); %KW into C2
Qin = Qin1 + Qin2;
Fuel_Cost = Qin * 1000 * 365.25 * 24 * 3600 *
(1/1055.05585) * (4 / 1000000);
cycle_efficiency(i) = desired_output / Qin * 100;
brayton_efficiency(i) = (Wt1 + Wt2 - Wc) / Qin *
100;
heat_transferred = m_rankine * abs(H11 - H8);
rankine_efficiency(i) = (Wt3 - Wp)/
heat_transferred * 100;
% Total Cost for 10 years
Total_Cost(i) = initial_costs + 10 * (Maintenance
+ Fuel_Cost);
carnot = (1 - min(T)/max(T))

* 100;

Page 30 of 32

Matlab Code
if Total_Cost(i) == min(Total_Cost)
ideal_m_brayton = m_brayton;
ideal_m_rankine = m_rankine;
Ideal_Compressor_Ratio =
compressor_pressure_ratio;
Ideal_Turbine_Ratio = Brayton_T2_Ratio;
Ideal_Cycle_Efficiency =
cycle_efficiency(i);
Ideal_Brayton_Efficiency =
brayton_efficiency(i);
Ideal_Rankine_Efficiency =
rankine_efficiency(i);
Ideal_Carnot_Efficiency = carnot;
Minimized_Cost = Total_Cost(i);
end

if i == 2
% Plotting Price Vs. Compressor Pressure Ratio
figs(5)=figure('WindowStyle','docked','Name',
'Cycle 3 - CPR versus Cost per
KW','NumberTitle','off');

h12 = plot(cpr_matrix(2),Total_Cost(2)/desired_output,

'*','LineWidth',2,'MarkerFaceColor','y',
'MarkerEdgeColor','r');
tilefigs(figs)
elseif i>2
set(h9,'XData',cpr_matrix,'YData',Total_Cost/
desired_output)
set(h10,'Xdata',Ideal_Compressor_Ratio,'YData',
Minimized_Cost/desired_output)
set(h11,'YData',Minimized_Cost/desired_output *
ones(1,2))
set(h12,'XData',cpr_matrix(end),'YData',
Total_Cost(end)/desired_output)
end
pause(.001)
i = i + 1;
end

h9 = plot(cpr_matrix(2),Total_Cost(2)/desired_output,

'LineWidth',2); hold on;


ax(2) = gca;
xlabel('Compressor Pressure
Ratio','FontSize',20)
ylabel('Total Cost ($/KW)','FontSize',20)
title('Compressor Pressure Ratio Versus
Cost','FontSize',22)
set(gca,'FontSize',15)

% Converting the money into a readable format


dollars = commas(floor(Minimized_Cost));
cents = Minimized_Cost floor(Minimized_Cost);
cents = ceil(cents * 100);
money = ['$',dollars,'.',num2str(cents)];

axis([ 0 endpointc 0 max(Total_Cost)/desired_output])

h10 = stem(Ideal_Compressor_Ratio,Minimized_Cost/
desired_output,
'color','r','LineWidth',2);
h11 = line( [ 0 endpointc],
Minimized_Cost/desired_output *
ones(1,2),'LineStyle','--','Color','k');

% Converting the price per KW into a readable


format
perkw
= Minimized_Cost / desired_output;
dollars = commas(floor(perkw));
cents
= perkw - floor(perkw);
cents
= ceil(cents * 100);
perkw
= ['$',dollars,'.',num2str(cents)]

Page 31 of 32

Matlab Code
% Finding price per kilowatt hour
kwhr = desired_output * 10 * 365.25 * 24;
priceperkwhr = Minimized_Cost / kwhr ;
% Display the results
disp(' ')
cprintf('_black','
Results for Cycle 3
\n')
cprintf('black',[' Ideal Compressor Pressure
Ratio: ',
num2str(Ideal_Compressor_Ratio),'\n'])
cprintf('black',['
Ideal Turbine Pressure
Ratio: ',
num2str(Ideal_Turbine_Ratio),'\n\n'])
cprintf('black',['
Ideal Cycle
Efficiency: ',
num2str(Ideal_Cycle_Efficiency),'\n'])
cprintf('black',['
Ideal Brayton
Efficiency: ',
num2str(Ideal_Brayton_Efficiency),'\n'])
cprintf('black',['
Ideal Rankine
Efficiency: ',
num2str(Ideal_Rankine_Efficiency),'\n'])
cprintf('black',['
Carnot
Efficiency: ',
num2str(Ideal_Carnot_Efficiency),'\n\n'])
cprintf('black',['
Ideal Brayton Mass Flow
Rate: ',
num2str(ideal_m_brayton),' (kg/s)\n'])
cprintf('black',['
Ideal Rankine Mass Flow
Rate: ',
num2str(ideal_m_rankine),'
(kg/s)\n\n'])
cprintf('black',['
Optimized
Cost: ',money,'\n'])
cprintf('black',['
Optimized Cost Per
KW HR: $',
num2str(priceperkwhr),'\n'])
cprintf('black',['
Optimized Cost
per KW: ',perkw,'\n\n'])

cprintf('black',['
Net Power From Brayton
Cycle: ',
num2str(Brayton_Power,'%.2f'),' KW (',
num2str(Brayton_Power/desired_output *
100,'%.2f'),'%%) \n'])
cprintf('black',['
Net Power From Rankine
Cycle: ',
num2str(Rankine_Power,'%.2f'),' KW (',
num2str(Rankine_Power/desired_output *
100,'%.2f'),'%%) \n'])
disp(' ')
% Plotting Price Vs. Compressor Pressure Ratio
figs(6)=figure('WindowStyle','docked','Name',
'Cycle 3 - CPR versus Cost per KWHR','NumberTitle','off');
h5 = plot(cpr_matrix,Total_Cost/(desired_output *
10 * 365.25 * 24),'LineWidth',2);
hold on;
ax(2) = gca;
xlabel('Compressor Pressure
Ratio','FontSize',20)
ylabel('Price per KW-HR
($)','FontSize',20)
title('Compressor Pressure Ratio Versus
Cost','FontSize',22)
set(gca,'FontSize',15)
axis([ 0 endpointc 0 .05])
h6 = stem(Ideal_Compressor_Ratio,Minimized_Cost/
(desired_output * 10 * 365.25 *
24),'color','r','LineWidth',2);
h7 = line( [ 0 endpointc],
Minimized_Cost/(desired_output * 10 * 365.25
* 24) * ones(1,2),'LineStyle',
'--','Color','k');

Page 32 of 32

Вам также может понравиться