In [1]:

```
#Input data
BHP = 51. #Brake horse power in h.p
N = 1000. #Speed in r.p.m
FHP = 17. #Friction horse power in h.p
#Calculations
IHP = (BHP+FHP) #Indicated Horse power in h.p
mn = (BHP/IHP)*100 #Mechanical efficiency in percent
#Output
print 'Mechanical efficiency of the engine is %i percent'%(mn)
```

In [2]:

```
#Data taken from Ex.No.1
BHP = 51. #Brake horse power in h.p
N = 1000. #Speed in r.p.m
FHP = 17. #Friction horse power in h.p
#Input data
O1 = BHP/2 #Half of b.h.p output in h.p
O2 = 10 #Brake horse power in h.p
#Calculations
#Case(i)
IHP1 = (O1+FHP) #Indicated Horse power in h.p
mn1 = (O1/IHP1)*100 #Mechanical efficiency in percent
#Case(ii)
IHP2 = (O2+FHP) #Indicated Horse power in h.p
mn2 = (O2/IHP2)*100 #Mechanical efficiency in percent
#Output
print 'Mechanical efficiency of the engine when it delivers \
\na) Half the b.h.p output is %3.0f percent \
\nb) 10 b.h.p is %3.0f percent'%(mn1,mn2)
```

In [3]:

```
import math
#Input data
Fc = 220. #Fuel consumption in gm/(b.h.p*hr)
CV = 10600. #Calorific value in kcal/kg
#Calculations
hf = (Fc/1000)*CV #Heat supplied in kcal/hr
O = 632.
#Output in terms of kcal/hr
bn = (O/hf)*100 #Brake thermal efficiency in percent
#Output
print 'Brake thermal efficiency is %3.1f percent'%(bn)
```

In [4]:

```
import math
#Input data
IHP = 45. #Indicated horse power in h.p
Fc = 13. #Fuel consumption in litres/hr
g = 0.8 #Specific gravity of oil
nm = 80. #Mechanical efficiency in percent
CV = 10000. #Calorific value of fuel in kcal/kg
#Calculations
BHP = (IHP*nm)/100 #Brake horse power in h.p
hi = (Fc*g*CV) #Heat supplied in kcal/hour
In = ((IHP*4500*60)/(427*hi))*100 #Indicated thermal efficiency in percent
Bn = (In*(nm/100)) #Brake thermal efficiency in percent
#Output
print 'Indicated thermal efficiency is %3.2f percent \
\nBrake thermal efficiency is %3.2f percent'%(In,Bn)
```

In [5]:

```
import math
#Input data
BHP = 15. #Brake horse power in h.p
In = 28. #Indicated thermal efficiency in percent
mn = 75. #Mechanical efficiency in percent
CV = 10000. #Calorific value of fuel in kcal/kg
#Calculations
Bn = ((In/100)*(mn/100))*100 #Brake thermal efficiency in percent
I = (BHP/(Bn/100))*((4500.*60)/427) #Input in kcal/hr
Fc = (I/CV) #Fuel consumption in kg/hr
#Output
print 'Fuel consumption of the engine is %3.2f kg/hr'%(Fc)
```