In [1]:

```
#Variable declaration
WC=1.508 #weight of coal sample in grams#
WH110=1.478 #weight of sample after heating at 110 degrees in grams#
m=WC-WH110 #weight of moisture in the sample#
#Calculation
pm=m*100/WC #percentage of moisture in the sample#
WH950=1.068 #weight of sample after heating at 950 degrees in grams#
vm=WH110-WH950 #volatile matter in grams#
pvm=vm*100/WC #percentage of voltaile matter#
#Result
print'Weight of moisture in the sample=',m,"g"
print'Percentage of moisture in the sample=',round(pm,2),"%"
print'\nWeight of volatile matter in the sample=',vm,"g"
print'Percentage of volatile matter in the sample=',round(pvm,2),"%"
```

In [2]:

```
#Variable declaration
CR=7.8 #compression ratio for first case#
E1=1.0-(1.0/CR)**0.258 #Energy efficiency corresponding to CR value 7.8#
CR=9.5 #compreesion ratio for second case#
#Calculation
E2=1.0-(1.0/CR)**0.258 #Energy efficiency corresponding to CR value 9.5#
IE=E2-E1 #Increase in efficiency#
PIE=round(IE,2)*100.0/round(E2,3) #percentage of increase in efficiency#
#Result
print'\nIncrease in efficiency=IE=%f',round(IE,2)
print'\nPercentage of increase in efficiency=PIE=%f',PIE,"%"
print "NOTE:Calculation mistake in book for % increase"
```

In [3]:

```
#Variable declaration
C=3.0 #weight of carbon in 1kg of coal sample in Kimath.lograms#
WO2=C*32/12.0 #weight of oxygen in carbon sample in Kimath.lograms#
#Calculation
WA=WO2*100/23.0 #weight of air in the carbon sample in Kimath.lograms#
MA=WA/28.92 #mol of air in kimath.lograms#
VA=MA*22.4 #Volume of air required in m3 air#
#Result
print'weight of air required for combustion of carbon=',round(WA,1),"kg"
print'\nVolume of air required=',round(VA,1),"m**3 air"
```

In [4]:

```
#Variable declaration
CO=0.46 #volume of carbon monoxide in 1kg of gas sample in m3#
C2H2=0.020 #volume of C2H2 in 1kg of gas sample in m3#
CH4=0.1 #volume of CH4 in 1kg of gas sample in m3#
N2=0.01 #volume of nytrogen in 1kg of gas sample in m3#
H2=0.40 #volume of hydrogen in 1kg of gas sample in m3#
#Calculation
VA=0.68*(100/21.0) #volume of air needed in m3#
#Result
print'\nVolume of air needed=',round(VA,3),"m**3"
```

In [5]:

```
#Variable declaration
C=624.0 #weight of carbon in 1kg of coal sample in grams#
O=69.0 #weight of oxygen in 1kg of coal sample in grams#
S=8.0 #weight of Sulphur in 1kg of coal sample in grams#
N=12.0 #weight of nytrogen in 1kg of coal sample in grams#
H=41.0 #weight of hydrogen in 1kg of coal sample in grams#
CO2=129 #weight of CO2 in 1kg of coal sample in grams#
CO=2.0 #weight of CO in 1kg of coal sample in grams#
#Calculation
MO=C*32/12.0+H*16/2.0+S*32/32.0-O #minimum weight of oxygen needed in grams#
MA=MO*0.1/23 #minimum weight of air needed in kimath.lograms#
WC=CO2*(12/44.0)+CO*(12/28.0) #weight of C in fuel gas/kg#
WF=C/WC #Weight of fuel gas/kg of coal in g#
O2=2*16/28.0 #O2 needed to convert CO to CO2 in Kg#
RWO2=(61.0-O2)/1000.0 #remaining weight of O2/kg of fuel gas in Kg#
WO2=WF*RWO2 #weight of O2 obtained by burning 1kg coal in kg#
AR=WO2*100/23.0 #air required in kimath.lograms#
WAS=MA+AR #weight of air actually supplied/kg coal burnt in kg#
#Result
print'(i) Weight of air theoretically needed=',round(MA,3),"kg"
print'\n(ii) Weight of C in fuel gas/kg=',round(WC ,2),"g"
print'\n Weight of fuel gas/kg of coal=',round(WF,3),"kg"
print'\n(iii) Weight of air actually supplied/kg coal burnt',round(WAS,1),"kg air"
```

In [6]:

```
#Variable declaration
w=1080.0 #quantity of water in grams#
W=150.0 #Water equivalent of calorimeter in grams#
x=0.681 #quantity of fuel carried out in combustion in grams#
dt=3.61 #rise in temperature of water in degree C#
#Calculation
Q=(w+W)*(dt)/x #calorific value of the fuel in cal per grams#
#Result
print'Calorific value of the fuel=',round(Q,1),"cal/g =",round(Q/1000,3),"kcal/g"
```

In [7]:

```
#Variable declaration
w=1080.0 #quantity of water taken in grams#
W=150.0 #Water equivalent of calorimeter in grams#
m=0.681 #weight of coal taken or mass of fuel in grams#
dt=3.61 #rise in temperature of water in degree C#
AC=50.0 #Acid correction in calories#
FC=5.0 #Fuse wire correction in calories#
CC=0.05 #cooling correction in calories#
#Calculation
GCV=((w+W)*(dt+CC)-(AC+FC))/m #Gross calorific value of the sample in cal per grams#
#Result
print'Gross Calorific value of the fuel=',round(GCV,1),"cal/g =",round(GCV/1000,3),"kcal/g"
```

In [8]:

```
#Variable declaration
C=90.2 #percentage of carbon#
O=2.9 #percentage of oxygen#
H=2.40 #percentage of hydrogen#
#Calculation
GCV=(8080.0*C+34400.0*(H-O/8.0))/100.0 #Gross calorific value of the sample in cal per grams#
#Result
print"\nGross Calorific value of the fuel=%.2e"%GCV,"cal/g"
```

In [9]:

```
#Variable declaration
a=0.9 #absorptivity#
e=0.04 #emissivity#
P=750 #Sun light energy available in W/m2#
Q=5.67*10**-8 #conductivity
import math
#Calculation
T4=a*P/(Q*e)
T=math.pow(T4,1.0/4.0)
#Result
print'Maximum temeperature that can be achieved=',round(T,1),"K"
```

In [10]:

```
#Variable declaration
w=1500 #quantity of water in grams#
W=125 #Water equivalent of calorimeter in grams#
x=1.050 #quantity of fuel carried out in combustion in grams#
t1=25 #initial temperature of water in degree C#
t2=27.8 #final temperature of water in degree C#
#Calculation
Q=(w+W)*(t2-t1)/x #calorific value of the fuel in cal per grams#
#Result
print'Calorific value of the fuel=',round(Q/1000,1),"kcal/g"
```

In [7]:

```
from scipy.optimize import fsolve
#Variable declaration
C=90.0 #percentage of carbon#
O=3.0 #percentage of oxygen#
S=0.5 #percentage of sulphur#
N=0.5 #percentage of nytrogen#
LCV=8500 #Law calorific value#
#Calculation
def f(H):
GCV1=LCV+(9*H/100.0)*587
GCV2=(8080.0*C+34500*(H-O/8.0)+2240*S)/100.0 #Gross calorific value of the sample in cal per grams#
return(GCV1-GCV2)
h=fsolve(f,1)
GCV=LCV+(9*h/100.0)*587
#Result
print'percentage of hydrogen=H=',round(h[0],1),"%"
print'\nGross Calorific value of the fuel=',round(GCV[0]),"kcal/g"
```

In [13]:

```
#Variable declaration
w=500.0 #quantity of water taken in grams#
W=2000.0 #Water equivalent of calorimeter in grams#
m=1.000 #weight of coal taken or mass of fuel in grams#
t1=24.0 #initial temperature of water in degree C#
t2=26.2 #final temperature of water in degree C#
AC=50.0 #Acid correction in calories#
FC=10.0 #Fuse wire correction in calories#
CC=0.0 #cooling correction in calories#
#Calculation
GCV=((w+W)*(t2-t1+CC)-(AC+FC))/m #Gross calorific value of the sample in cal per grams#
H=6.0 #percentage of hydrogen#
C=93.0 #percentage of carbon#
LCV=GCV-(9*H*580/100.0) #Net calorific value of the sample in cal per gram#
#Result
print'Gross Calorific value of the fuel=',GCV,"cal/g"
print'Net calorific value of the sample=LCV=',LCV,"cal/g"
print"\nNOTE:Calculation mistake in book,wrongly written as 5540 and 5226.8"
```

In [14]:

```
#Variable declaration
WC=1.5642 #weight of coal sample in grams#
WH110=1.5022 #weight of sample after heating at 110 degrees in grams#
#Calculation
m=WC-WH110 #weight of moisture in the sample#
pm=m*100/WC #percentage of moisture in the sample#
WH950=0.7628 #weight of sample after heating at 950 degrees in grams#
vm=WH110-WH950 #volatile matter in grams#
pvm=vm*100/WC #percentage of voltaile matter#
ac=0.2140 #Ash content left in the last in grams#
pac=ac*100/WC #percentage of Ash content laft#
pfc=100-(pm+pvm-pac) #percentage of fixaed carbon#
#Result
print'\npercentage of fixed carbon in the sample=',round(pfc,2),"%"
```

In [15]:

```
#Variable declaration
WBaSO4=0.0482 #weight of BaSO4 in grams#
W=0.5248 #weight of sample in grams#
#Calculation
PS=32*WBaSO4*100/(233*W) #percentage of sulphur in the sample#
#Result
print'Percentage of sulphur in the sample=',round(PS,2),"%"
```

In [16]:

```
#Variable declaration
W=10 #weight of Water heated of calorimeter in Kimath.lograms#
V=0.1 #volume of gas used in metrecube#
t1=22 #inlet temperature of water in degree C#
t2=30 #outlet temperature of water in degree C#
#Calculation
GCV=W*(t2-t1)/V #Gross calorific value of the sample in Kilocal per metre3#
L=580 #latent heat of water in cal/g#
Ws=0.025 #weight of steam condensed in grams#
LCV=GCV-(Ws*L/V) #Net calorific value of the sample in Kcal per meter3#
#Result
print'Gross Calorific value of the fuel=',GCV ,"Kcal/m3"
print'\nNet calorific value of the sample=',LCV,"Kcal/m3"
```

In [17]:

```
#Variable declaration
C=90.0 #percentage of carbon#
O=3.0 #percentage of oxygen#
S=0.5 #percentage of sulphur#
N=0.5 #percentage of nytrogen#
H=3.5 #percentage of hydrogen#
H2O=0.1 #percentage of H2O#
#Calculation
AO=900*32.0/12.0+35*16.0/2.0+5*32.0/32.0 #amount of oxygen required in grams#
AN=2655*100/23.0 #amount of air needed in grams#
#Result
print'\nAmount of air needed=',round(AN/1000,3),"kg"
```

In [18]:

```
#Variable declaration
CH4=0.14 #volume of CH4 in 1m3 volume of gaseous fuel in m3#
H2=0.32 #volume of H2 in 1m3 volume of gaseous fuel in m3#
N2=0.40 #volume of N2 in 1m3 volume of gaseous fuel in m3#
O2=0.14 #volume of O2 in 1m3 volume of gaseous fuel in m3#
#Calculation
V_ch4=O2*2
v_H2=H2*0.5
Total_O2=V_ch4+v_H2
Net_O2=(Total_O2-O2)*1000 # Net O2 needed in L
V_req=Net_O2*(100/21.0)*(125/100.0)
#Result
print"Volume of air required assuming 21% =",round(V_req,1),"L"
```

In [19]:

```
#Variable declaration
C=750.0 #weight of carbon in 1kg of coal sample in grams#
O=121.0 #weight of oxygen in 1kg of coal sample in grams#
A=45.0 #weight of Ash in 1kg of coal sample in grams#
N=32.0 #weight of nytrogen in 1kg of coal sample in grams#
H=52.0 #weight of hydrogen in 1kg of coal sample in grams#
#Calculation
MO=C*32/12+H*16/2-O #minimum weight of oxygen needed in grams#
MA=MO*100/23 #minimum weight of air needed in grams#
GCV=(808*C+3450*(H-O/8))/100 #Gross calorific value of the sample in cal per grams#
LCV=GCV-0.09*H*0.1*587 #law calorific value of the sample in cal/gram#
#Result
print'\nGross Calorific value of the fuel=',round(GCV,2),"kcal/g"
print'\nNet calorific value of the sample',round(LCV),"kcal/g"
```

In [20]:

```
#Variable declaration
C=810.0 #weight of carbon in 1kg of coal sample in grams#
O=80.0 #weight of oxygen in 1kg of coal sample in grams#
S=10.0 #weight of Sulphur in 1kg of coal sample in grams#
N=10.0 #weight of nytrogen in 1kg of coal sample in grams#
H=50.0 #weight of hydrogen in 1kg of coal sample in grams#
#Calculation
MO=C*32/12.0+H*16/2.0+S*32/32.0 #minimum weight of oxygen needed in grams#
MA=2490*100/23.0 #minimum weight of air needed in grams#
print'\nminimum amount of air needed=',round(MA/1000,3) ,"kg"
NF=10+MA*0.77 #weight of nitrogen present in the products in grams#
WD=2970.0+20.0+8346.0 #total weight of dry products in grams#
PCO2=2970*100/WD #percentage composition of CO2#
print'\nPercentage composition of CO2=',round(PCO2 ,2),"%"
PSO2=20*100/WD #percentage composition of SO2#
print'\nPercentage composition of SO2=',round(PSO2 ,3),"%"
PN2=8346*100/WD #percentage composition of N2#
#Result
print'\nPercentage composition of N2=',round(PN2,2),"%"
```

In [21]:

```
#Variable declaration
CO=0.205 #volume of carbon monoxide in 1kg of gas sample in m3#
CO2=0.060 #volume of CO2 in 1kg of gas sample in m3#
CH4=0.042 #volume of CH4 in 1kg of gas sample in m3#
N=0.501 #volume of nytrogen in 1kg of gas sample in m3#
H2=0.194 #volume of hydrogen in 1kg of gas sample in m3#
#Calculation
VA=0.283*(100/21)*(130/100) #volume of air needed in m3#
VDCO2=0.06+0.205*1+0.042*1 #volume of dry products containig CO2 formed in m3#
VDN2=0.501+1.752*79/100 #volume of dry products containig N2 formed in m3#
VDO2=1.755*21/100 #volume of dry products containig O2 formed in m3#
TVD=VDCO2+VDN2+VDO2 #total volume of dry products formed in m3#
PDCO2=VDCO2*100/TVD #percentage of dry products containig CO2 formed#
PDN2=VDN2*100/TVD #percentage of dry products containig N2 formed#
PDO2=VDO2*100/TVD #percentage of dry products containig O2 formed#
#Result
print'\nPercentage of dry products containing CO2 formed=',round(PDCO2,2),"%"
print'\nPercentage of dry products containing N2 formed=',round(PDN2 ,2),"%"
print'\nPercentage of dry products containing O2 formed=',round(PDO2 ,2),"%"
```

In [22]:

```
#Variable declaration
C=780.0 #weight of carbon in 1kg of coal sample in grams#
O=120.0 #weight of oxygen in 1kg of coal sample in grams#
S=12.0 #weight of Sulphur in 1kg of coal sample in grams#
N=21.0 #weight of nytrogen in 1kg of coal sample in grams#
H=41.0 #weight of hydrogen in 1kg of coal sample in grams#
#Calculation
MO=C*32/12+H*16/2+S*32/32-O #minimum weight of oxygen needed in grams#
MA=MO*100/23.0 #minimum weight of air needed in grams#
#Result
print'minimum weight of oxygen needed=',MO/1000,"kg"
print'\nminimum amount of air needed=',MA/1000,"kg"
```

In [23]:

```
#Variable declaration
C=1.5 #weight of carbon in 1kg of coal sample in Kimath.lograms#
#Calculation
WO2=C*32/12 #weight of oxygen in carbon sample in Kimath.lograms#
WA=WO2*100/23 #weight of air in the carbon sample in Kimath.lograms#
O2_4000=22.4/32.0*4000 #Volume in 4000 g oxygen
V=100/21.0*O2_4000 #Volume of air with 21 % O2
#Result
print'\nweight of air in the carbon sample=',round(WA,2),"kg"
print "Volume of air is",round(V/1000,2),"m^3"
```