summaryrefslogtreecommitdiff
path: root/575/CH4/EX4.6.1/4_6_1.sce
blob: 724df3837935218ea2cd87263b33c0c475c53015 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
clc
pathname=get_absolute_file_path('4_6_1.sce')
filename=pathname+filesep()+'461.sci'
exec(filename)
printf(" All the values in the textbook are Approximated hence the values in this code differ from those of Textbook")
nP=basis*xP
nN=basis*xN
nO2=basis*xA*0.21
if(nN/nP>1)
    disp("NH3 is in excess")
else
    disp("Propene is in excess")
end
if(nO2/nP>1)
    disp("O2 is in excess")
else
    disp("propene is in excess")
end
nO2reacted=nP*1.5
nNreacted=nP*1
ExcessAmmonia=(nN-nNreacted)*100/nNreacted
ExcessO2=(nO2-nO2reacted)*100/nO2reacted
printf(" \n percentage excess Ammonia=%f",ExcessAmmonia)
printf(" \n percentage excess Oxygen=%f",ExcessO2)
nPout=(1-x)*nP
printf(" \n no.of moles of Propylene left= %d mol",nPout)
E=nP-nPout
nNout=nN-E
nO2out=nO2-1.5*E
nAc=E
nW=3*E
printf(" \n no.of moles of Ammonia left= %f mol",nNout)
printf(" \n no.of moles of oxygen left= %f mol",nO2out)
printf(" \n no.of moles of ACN formed= %d mol",nAc)
printf(" \n no.of moles of water formed= %d mol",nW)