In [1]:

```
# Variables
d = 200.; #diameter of cylinder in mm
L = 300.; #stroke of cylinder in mm
Vc = 1.73; #Clearance volume in litres
imep = 650.; #indicated mean effective pressure in kN/(m**2)
g = 6.2; #gas consumption in (m**3)/h
CV = 38.5; #Calorific value in MJ/(m**3)
y = 1.4; #Ratio of specific heats
N = 150.; #No. of firing cycles per minute
# Calculations
Vs = ((3.1415/4)*(d**2)*L)*(10**-6); #Stroke volume in litres
Vt = Vs+Vc; #Total volume in litres
rv = (Vt/Vc); #Compression ratio
n = (1-(1/rv**(y-1)))*100; #Air standard efficiency
IP = imep*(Vs*10**-3)*(N/60); #Indicated power in kW
F = (g*CV*1000)/3600; #Fuel energy input in kW
nT = (IP/F)*100; #Indicated thermal efficiency
# Results
# 1st answer is wrong in book
print 'Air Standard Efficiency is %3.1f percent \
\nIndicated Power is %3.1f kW \
\nIndicated thermal efficiency is %3.0f percent'%(n,IP,nT)
```

In [2]:

```
# Variables
Vs = 0.0008; #Swept volume in m**3
Vc = 0.00015; #Clearance volume in m**3
CV = 38.; #Calorific value in MJ/(m**3)
v = 0.45; #volume in m**3
IP = 81.5; #Indicated power in kW
y = 1.4; #Ratio of specific heats
# Calculations
rv = (Vs+Vc)/Vc; #Compression ratio
n = (1-(1/rv**(y-1))); #Air standard efficiency
Ps = (v*CV*1000.)/60; #Power supplied in kW
nact = IP/Ps; #Actual efficiency
nr = (nact/n)*100; #Relative efficiency
# Results
print 'Relative Efficiency is %3.2f percent'%(nr)
# rounding error in book answer. please check.
```

In [2]:

```
# Variables
n = 6.; #No. of cylinders
d = 0.61; #Diameter in m
L = 1.25; #Stroke in m
N = 2.; #No.of revolutions per second
m = 340.; #mass of fuel oil in kg
CV = 44200.; #Calorific value in kJ/kg
T = 108.; #Torque in kN-m
imep = 775.; #Indicated mean efective pressure in kN/(m**2)
# Calculations
IP = (imep*L*3.1415*(d**2)*N)/(8); #Indicated power in kW
TotalIP = (n*IP); #Total indicated power in kW
BP = (2*3.1415*N*T); #Brake power in kW
PI = (m*CV)/3600.; #Power input in kW
nB = (BP/PI)*100.; #Brake thermal efficiency
bmep = (BP*8)/(n*L*3.1415*(d**2)*2); #Brake mean effective pressure in kN/(m**2)
nM = (BP/TotalIP)*100; #Mechanical efficiency
bsfc = m/BP; #Brake specific fuel consumption in kg/kWh
# Results
print 'Total Indicated Power is %3.1f kW \
\nBrake Power is %3.1f kW \
\nBrake thermal efficiency is %3.1f percent \
\nBrake mean effective pressure is %3.1f kN/m**2 \
\nMechanical efficiency is %3.1f percent \
\nBrake specific fuel consumption is %3.3f kg/kW.hr'%(TotalIP,BP,nB,bmep,nM,bsfc)
```

In [2]:

```
# Variables
Hm = 21.; #Mean height of indicator diagram in mm
isn = 27.; #indicator spring number in kN/(m**2)/mm
Vs = 14.; #Swept volume in litres
N = 6.6; #Speed of engine in rev/s
Pe = 77.; #Effective brake load in kg
Re = 0.7; #Effective vrake radius in m
mf = 0.002; #fuel consumed in kg/s
CV = 44000.; #Calorific value of fuel in kJ/kg
mc = 0.15; #cooling water circulation in kg/s
Ti = 311.; #cooling water inlet temperature in K
To = 344.; #cooling water outlet temperature in K
C = 4.18; #specific heat capacity of water in kJ/kg-K
Ee = 33.6; #Energy to exhaust gases in kJ/s
g = 9.81; #Acceleration due to geravity in m/(s**2)
# Calculations
imep = isn*Hm; #Indicated mean efective pressure in kN/(m**2)
IP = (imep*Vs*N)/(2000); #Indicated Power in kW
BP = (2*3.1415*N*g*Pe*Re)/1000; #Brake Power in kW
nM = (BP/IP)*100; #Mechanical efficiency
Ef = mf*CV; #Eneergy from fuel in kJ/s
Ec = mc*C*(To-Ti); #Energy to cooling water in kJ/s
Es = Ef-(BP+Ec+Ee); #Energy to surroundings in kJ/s
p = (BP*100)/Ef; #Energy to BP in %
q = (Ec*100)/Ef; #Energy to coolant in %
r = (Ee*100)/Ef; #Energy to exhaust in %
w = (Es*100)/Ef; #Energy to surroundings in %
# Results
print 'Indicated Power is %3.1f kW \
\nBrake Power is %3.0f kW \
\nMechanical Efficiency is %3.0f percent \
\nENERGY BALANCE kJ/s Percentage \
\nEnergy from fuel %3.0f 100 \
\nEnergy to BP %3.0f %3.0f \
\nEnergy to coolant %3.01f %3.1f \
\nEnergy to exhaust %3.1f %3.1f \
\nEnergy to surroundings, etc %3.1f %3.1f'%(IP,BP,nM,Ef,BP,p,Ec,q,Ee,r,Es,w)
```

In [6]:

```
# Variables
t = 30.; #duration of trial in minutes
N = 1750.; #speed in rpm
T = 330.; #brake torque in Nm
m = 9.35; #mass of fuel in kg
CV = 42300.; #Calorific value in kJ/kg
mj = 483.; #jacket cooling water circulation in kg
Ti = 290.; #inlet temperature in K
T0 = 350.; #outlet temperature in K
ma = 182.; #air consumption in kg
Te = 759.; #exhaust temperature in K
Ta = 256.; #atmospheric temperature in K
nM = 0.83; #Mechanical efficiency
ms = 1.25; #mean specific heat capacity of exhaust gas in kJ/kg-K
Cw = 4.18; #specific heat capacity of water in kJ/kg-K
# Calculations
BP = (2*3.1415*T*N)/(60*1000); #Brake power in kW
sfc = (m*2)/BP; #specific fuel consumption in kg/kWh
IP = BP/nM; #Indicated power in kW
nIT = IP/(m*2/3600*CV)*100 #Indicated thermal efficiency
Ef = (m/t*CV) #Eneergy from fuel in kJ/min
EBP = BP*60; #Energy to BP in kJ/min
Ec = (mj*Cw*(T0-Ti))/t; #Energy to cooling water in kJ/min
Ee = ((ma+m)*ms*(Te-Ti))/30; #Energy to exhaust in kJ/min
Es = Ef-(EBP+Ec+Ee); #Energy to surroundings in kJ/min
# Results
print 'Break power is %3.1f kW \
\nSpecific fuel consumption is %3.3f kg/kWh \
\nIndicated thermal efficiency is %3.1f percent \
\nEnergy from fuel is %3.0f kJ/min \
\nEnergy to BP is %3.0f kJ/min \
\nEnergy to cooling water is %3.0f kJ/min \
\nEnergy to exhaust is %3.0f kJ/min \
\nEnergy to surroundings is %d kJ/min'%(BP,sfc,nIT,round(Ef,-2),EBP,Ec,Ee,Es)
# rounding off error
```

In [6]:

```
# Variables
BP0 = 12.; #Brake Power output in kW
BP1 = 40.5; #Brake Power in trial 1 in kW
BP2 = 40.2; #Brake Power in trial 2 in kW
BP3 = 40.1; #Brake Power in trial 3 in kW
BP4 = 40.6; #Brake Power in trial 4 in kW
BP5 = 40.7; #Brake Power in trial 5 in kW
BP6 = 40.0; #Brake Power in trial 6 in kW
# Calculations
BPALL = BP0+BP6; #Total Brake Power in kW
IP1 = BPALL-BP1; #Indicated Power in trial 1 in kW
IP2 = BPALL-BP2; #Indicated Power in trial 2 in kW
IP3 = BPALL-BP3; #Indicated Power in trial 3 in kW
IP4 = BPALL-BP4; #Indicated Power in trial 4 in kW
IP5 = BPALL-BP5; #Indicated Power in trial 5 in kW
IP6 = BPALL-BP6; #Indicated Power in trial 6 in kW
IPALL = IP1+IP2+IP3+IP4+IP5+IP6; #Total Indicated Power in kW
nM = (BPALL/IPALL)*100; #Mechanical efficiency
# Results
print 'Indicated Power of the engine is %3.1f kW \
\nMechanical efficiency of the engine is %3.1f percent'%(IPALL,nM)
```

In [5]:

```
import math
# Variables
n = 2.; #No. of cylinders
N = 4000.; #speed of engine in rpm
nV = 0.77; #Volumetric efficiency
nM = 0.75; #Mechanical efficiency
m = 10.; #fuel consumed in lit/h
g = 0.73; #spcific gravity of fuel
Raf = 18.; #air-fuel ratio
Np = 600.; #piston speed in m/min
imep = 5.; #Indicated mean efective pressure in bar
R = 281.; #Universal gas constant in J/kg-K
T = 288.; #Standard temperature in K
P = 1.013; #Standard pressure in bar
# Calculations
L = Np/(2*N); #Piston stroke in m
mf = m*g; #mass of fuel in kg/h
ma = mf*Raf; #mass of air required in kg/h
Va = (ma*R*T)/(P*60*(10**5)); #volume of air required in (m**3)/min
D = math.sqrt((2*Va)/(nV*L*N*3.1415)); #Diameter in m
IP = (2*imep*100*L*3.1415*(D**2)*N)/(4.*60); #Indicated Power in kW
BP = nV*IP; #Brake Power in kW
# Results
print 'Piston Stroke is %3.3f m \
\nBore diameter is %3.4f m \
\nBrake power is %3.1f kW'%(L,D,BP)
# rounding off error
```