From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 858/CH2/EX2.2/example_2.sce | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 858/CH2/EX2.2/example_2.sce (limited to '858/CH2/EX2.2') diff --git a/858/CH2/EX2.2/example_2.sce b/858/CH2/EX2.2/example_2.sce new file mode 100755 index 000000000..0c2176d66 --- /dev/null +++ b/858/CH2/EX2.2/example_2.sce @@ -0,0 +1,25 @@ +clc +clear +printf("example 2.2 page number 71\n\n") + +//to find volumetric composition,partial pressue of each gas and total pressure of mixture + +nCO2=2/44; //moles of CO2 +nO2=4/32; //moles of O2 +nCH4=1.5/16; //moles of CH4 + +total_moles=nCO2+nO2+nCH4; +yCO2=nCO2/total_moles; +yO2=nO2/total_moles; +yCH4=nCH4/total_moles; + +printf (" Composition of mixture = \nCH4 = %f \nO2 = %f \n CO2 = %f \n\n",yCH4,yO2,yCO2) + +pCO2=nCO2*8.314*273/(6*10^-3); +pO2=nO2*8.314*273/(6*10^-3); +pCH4=nCH4*8.314*273/(6*10^-3); + +printf ("pressure of CH4 = %f kPa \npressure of O2 = %f kPa\n pressure of CO2 =%f kPa\n\n",pCH4*10^-3,pO2*10^-3,pCO2*10^-3) + +total_pressure=pCO2+pCH4+pO2; +printf ("total pressure = %f Kpa",total_pressure*10^-3) -- cgit