diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /167/CH13/EX13.1/ex1.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '167/CH13/EX13.1/ex1.sce')
-rwxr-xr-x | 167/CH13/EX13.1/ex1.sce | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/167/CH13/EX13.1/ex1.sce b/167/CH13/EX13.1/ex1.sce new file mode 100755 index 000000000..dfd953c31 --- /dev/null +++ b/167/CH13/EX13.1/ex1.sce @@ -0,0 +1,23 @@ +//example 1
+//Mass and Mole Fractions of a Gas Mixture
+clear
+clc
+m=20 //total mass of the mixture in kg
+mfO2=3/m //mass fraction of oxygen
+mfN2=5/m //mass fraction of nitrogen
+mfCH4=12/m //mass fraction of methane
+NO2=3/32 //no.of kilo moles of oxygen
+NN2=5/28 // no.of kilo moles of nitrogen
+NCH4=12/16 //no.of kilo moles of methane
+N=NO2+NN2+NCH4//total no. of moles
+yO2=NO2/N //mole fraction of O2
+yN2=NN2/N //mole fraction of N2
+yCH4=NCH4/N // mole fraction of CH4
+Mm=m/N //average molar mass of gas in kg/kmol
+printf("\n Mass fraction of oxygen is = %.2f. \n",mfO2);
+printf("\n Mass fraction of Nitrogen is = %.2f. \n",mfN2);
+printf("\n Mass fraction of Methane is = %.2f. \n",mfCH4);
+printf("\n Mole fraction of Nitrogen is = %.3f. \n",yN2);
+printf("\n Mole fraction of Oxygen is = %.3f. \n",yO2);
+printf("\n Mole fraction of Methane is = %.3f. \n",yCH4);
+printf("\n Average Molar mass of gas is = %.1f kg/mol. \n",Mm);
\ No newline at end of file |