summaryrefslogtreecommitdiff
path: root/1019/CH7/EX7.6/Example_7_6.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /1019/CH7/EX7.6/Example_7_6.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '1019/CH7/EX7.6/Example_7_6.sce')
-rw-r--r--1019/CH7/EX7.6/Example_7_6.sce24
1 files changed, 24 insertions, 0 deletions
diff --git a/1019/CH7/EX7.6/Example_7_6.sce b/1019/CH7/EX7.6/Example_7_6.sce
new file mode 100644
index 000000000..f95405386
--- /dev/null
+++ b/1019/CH7/EX7.6/Example_7_6.sce
@@ -0,0 +1,24 @@
+//Example 7.6
+clear;
+clc;
+
+//Given
+R=0.08205;//gas constant in atm dm^3 K^-1 mol^-1
+R1=8.314;//gas constant in J K^-1 mol^-1
+T=300;//temperature in K
+VCH4=4;//initial volume of methane in dm^3
+VAr=1;//initial volume of argon in dm^3
+Vf=3;//final volume
+P=1;//Initial Pressure in atm
+
+//To calculate delGmix,delHmix and delSmix
+nCH4=(P*VCH4)/(R*T);//moles of methane taken
+nAr=(P*VAr)/(R*T);//moles of Argon taken
+xCH4=nCH4/(nCH4+nAr);//mole fraction of methane in the mixture
+xAr=nAr/(nCH4+nAr);//mole fraction of Argon in the mixture
+pf=(R*T*(nCH4+nAr))/Vf;//final pressure in atm
+delGmix=R1*T*((nCH4*log(xCH4*pf))+(nAr*log(xAr*pf)));//free energy change in J
+delHmix=0;//since the gases are ideal
+delSmix=-delGmix/T;//entropy change in J K^-1
+mprintf('delGmix = %f J \n delHmix = %f J \n delSmix = %f J K^-1',delGmix,delHmix,delSmix);
+//end \ No newline at end of file