In [1]:

```
# Variables
p1 = 10; # in bar
p2 = 0.5; # in bar
T1 = 179.9; # in °C
T1 = T1 +273; # in K
T2 = 81.4; # in °C
# Calculations and Results
T2 = T2 + 273; # in K
Eta_carnot = (T1 - T2)/T1*100; # in %
print "Carnot efficiency of an engine when the steam is 0.87 dry in %% is : %.2f"%Eta_carnot
print "Carnot efficiency of an engine when the steam is dry saturated in %% is : %.2f"%Eta_carnot
T1 = T1 + 50; # in K
Eta_carnot1 = (T1 - T2) / T1*100; # in %
print "Carnot efficiency of an engine when the steam is superheated in %% is : %.2f"%Eta_carnot1
```

In [4]:

```
# Variables
h1 = 3015.; # in kJ/kg
h2 = 2326.; # in kJ/kg
h3 = 113; # in kJ/kg
h4 = 114.95; # in kJ/kg
# Calculations and Results
Q = h1 - h4; # in kJ/kg
print "Heat supplied to the boiler in kJ/kg is",Q
W_T = h1 - h2; #/ in kJ/kg
print "Work developed by turbine in kJ/kg is : %.1f"%W_T
W_P = ( h1 - h3) - Q; # in kJ/kg
print "Work absorbed by pump in kJ/kg is : ",W_P
Eta = (W_T - W_P)/Q*100; # in %
print "Efficiency of flow system in %% is : %.2f"%Eta
```

In [2]:

```
import math
# Variables
phi_s = 6.583;
phi_w = 1.091;
phi_s1 = 6.504;
C_p = 2.25;
T_sat =179.9; # in °C
T_sat = T_sat + 273; # in K
T_sup = T_sat + 50; # in K
x2 = (phi_s - phi_w)/phi_s1;
H1 = 2776.2; # in kJ/kg
H_w2 = 340.6; # in kJ/kg
L2 = 2305.;
# Calculations and Results
H2 = H_w2 + (x2 * L2); # in kJ/kg
Eta_rankine = (H1 - H2)/(H1 - H_w2)*100; # in %
print "Rankine efficiency in %% is : %.2f"%Eta_rankine
phi_w1 = 2.138;
x1 = 0.87;
phi_s1 = 4.445;
phi_w2 = 1.091;
phi_s2 = 6.504;
x2 = (phi_w1 + (x1 * phi_s1) - phi_w2) / phi_s2;
H1 = 762.6 + (x1 * 2013.6); # in kJ/kg
H2 = 340.6 + (x2 * 2305); # in kJ/kg
Eta_rankine1 = (H1 - H2) / (H1 - H_w2)*100; # in %
PerDropInRankine= (Eta_rankine - Eta_rankine1)/Eta_rankine * 100; # in %
print "Percentage drop in Rankine efficiency in %% is : %.2f"%PerDropInRankine
phi_s1 = 6.583;
phi_w1 = 1.091;
phi_s2 = 6.504;
x2 = (phi_s1 + C_p * math.log(T_sup/T_sat) - phi_w1)/phi_s2;
H_s1 = 2776.2;
H1 = H_s1 + C_p * (T_sup - T_sat); # in kJ/kg
H2 = 340.6 + (0.88 * 2305); # in kJ/kg
H_w2 = 340.6;
Eta_rankine2 = (H1 - H2) / (H1 - H_w2);
Eta_rankine2 = Eta_rankine2 * 10**2; # in percentage
PerIncInRank = ((Eta_rankine2 - Eta_rankine)/Eta_rankine2) * 100; # in percentage
print "Percentage increase in rankine efficiency in %% is : %.2f"%PerIncInRank
# rounding off error
```

In [1]:

```
# Variables
H2 = 2776.2; # in kJ/kg
p1 = 10.; # in bar
p_2 = 1.; # in bar
p_3 = 0.25; # in bar
p_4 = p_3; # in bar
# w = (H2 - H_2) + ((p_2 - p_3) * v_2); # work done in kJ/kg
phi_2 = 6.583;
phi_d2 = 1.303;
L = 6.057;
x_2 = (phi_2 - phi_d2) / L;
H2_desh = 417.5 + (x_2* 2257.9); # in kJ/kg
v_s = 1.694;
# Calculations and Results
v_2 = x_2 * v_s; # in m**3 per kg
w = (H2 - H2_desh) + ((p_2 - p_3) * v_2); # in kJ/kg
H4 = 282.7; # in kJ/kg
H_w4 =H4; # in kJ/kg
HeatSupplied = H2 - H4; # kJ/kg
Eta_modifiedRankine = w / HeatSupplied*100; # in %
print "Thermal effienciency of the cycle in %% is : %.2f"%Eta_modifiedRankine
HeatRemoved = HeatSupplied - w; # in kJ/kg
print "Heat removed in condenser in kJ/kg is : %.1f"%HeatRemoved
# rounding off error
```

In [7]:

```
# Variables
Q = 1100; # in kW
m = 1; # in kg
p1 = 15; # in bar
p1 = p1 * 10**5; # in Pa
p1 = p1 * 10**-3; # in kPa
p2 = 0.05 * 10**2; # in kPa
v1 = 0.16; # m**3 per kg
v2 = 26; # in m**3 per kg
V1 = 110; # in m per s
V2 = 120; # in m per s
u1 = 2935; # in kJ per kg
u2 = 1885; # in kJ per kg
g = 9.8;
z1 = 0;
z2 = 0;
# Calculations and Results
# Formula Q-W= m*{(u2 - u1) + (p2*v2-p1*v1)+1/2*(V2**2-V1**2)+g*(z2 - z1)}
W =Q-m*((u2 - u1) + (p2*v2-p1*v1)+1./2*(V2**2-V1**2)+g*(z2 - z1)); # in kW
print "Work output per kg in kW is : ",W
SteamFlowRate = Q / W; # in kg/sec
SteamFlowRate = SteamFlowRate * 3600; # in kg per hr
print "flow rate in kg/hr is : %.2f"%SteamFlowRate
```

In [2]:

```
# Variables
h_sen = 191.9; # in kJ/kg
L = 2392; # in kJ/kg
x = 0.95;
t_o = 35; # in °C
t_i = 20; # in °C
C = 4.18;
# Calculations
H_totalwet = h_sen + (x * L); #in kJ/kg
# m_steam * (H_totalwet - h_sen) = m_water * C * (t_o - t_i)
msBYmw = (H_totalwet - h_sen) / ( C * (t_o - t_i)); #
# Results
print "The Ratio of mass flow rate of cooling water to condensing steam is : %.2f"%msBYmw
```