# Calculations
Q = 84-8.4-21+4.2;
# Results
print 'The Net Work Done = %2.1f kJ'%(Q); #Displaying result
#Declaring values
Q = -700.;
W = -3000.;
m = 5.;
# Calculations
U = Q-W;
Us = U/m;
# Results
print 'Change in Specific Energy = %3.0f J/kg'%(Us); #print laying result
#Declaring values
Q = 50;
W = 40;
# Calculations
U = Q-W;
# Results
print 'Change in Internal Energy = %2.0f kJ'%(U);
# Variables
m = 3000.; #mass in kg
P = 736.; #Power in kW
t = 5.*3600; #Time in seconds
HV = 27170. #Heating value in kJ/kg
# Calculations
E = P/((m/t)*HV);
Eff = E*100;
# Results
print 'Thermal Efficiency = %2.2f %%'%(Eff);
# Variables
U = 22.; #Internal Energy in kJ/s
P2 = 0.95*1000; #Pressure in kPa
V2 = 0.09; #Volume in m**3/s;
P1 = 0.5*1000;
V1 = 0.15;
# Calculations
X = (P2*V2)-(P1*V1);
H = U+X;
# Results
print 'Change in Enthalpy: %2.1f kJ/s'%(H);
# Variables
Th = 0.22; #Thermal Efficiency
Hr = 1260.; #Heat Rejected in MJ/hr
CV = 42.; #Calorific Value of Coal
X = 1-Th;
HI = Hr/X; #Heat Input in MJ/hr
# Calculations
O = ((HI-Hr)*1000)/3600; #Output
Mf = HI/CV; #Mass of Fuel Used
# Results
print 'Power Output is %2.2f kW'%(O);
print 'Mass of Fuel used per hour: %2.1f kg/hr'%(Mf);
import math
# Variables
m = 2.; #mass in kg
T1 = 30.+273; #Temperature in K
T2 = 60.+273;
Cp = 4.187;
# Calculations
T = T2/T1;
X = (math.log(T));
S = m*Cp*X;
# Results
print 'Entropy Change of Water: %1.4f kJ/K'%(S);
#Declaring Values
m = 600.; #Mass in kg
z = 50000.; #Dismath.tance in meters
V = 2500000.; #Velocity in m/hr
g = 7.9; #Gravitational Field in m/s**2
# Results
Vel = V/3600;
KE = (0.5*m*Vel*Vel)/1000000; #Kinetic Energy in MJ
PE = (m*g*z)/1000000; #Potential Energy in MJ
#Displaying Results
print 'The Kinetic Energy is %3.2f MJ'%(KE);
print 'The Potential Energy is %3.2f MJ'%(PE);