diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3689/CH2/EX2.4/2_4.sce | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '3689/CH2/EX2.4/2_4.sce')
-rw-r--r-- | 3689/CH2/EX2.4/2_4.sce | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/3689/CH2/EX2.4/2_4.sce b/3689/CH2/EX2.4/2_4.sce new file mode 100644 index 000000000..933bce944 --- /dev/null +++ b/3689/CH2/EX2.4/2_4.sce @@ -0,0 +1,38 @@ +////
+//Variable declaration
+n = 2.0 //moles of ideal gas
+R = 8.314 //Ideal gas constant, bar.L/(mol.K)
+//For reverssible Isothermal expansion
+Pi1 = 25.0 //Initial Pressure of ideal gas, bar
+Vi1 = 4.50 //Initial volume of ideal gas, L
+Pf1 = 4.50 //Fianl Pressure of ideal gas, bar
+Pext = 4.50 //External pressure, bar
+Pint = 11.0 //Intermediate pressure, bar
+
+//Calcualtions reverssible Isothermal expansion
+T1 = Pi1*Vi1/(n*R)
+Vf1 = n*R*T1/Pf1
+w = -n*R*T1*log(Vf1/Vi1)
+
+//Results
+printf("\n For reverssible Isothermal expansion')
+printf("\n Work done = %4.2e J",w)
+
+
+//Calcualtions Single step irreverssible expansion
+
+w = -Pext*1e5*(Vf1-Vi1)*1e-3
+
+//Results
+printf("\n For Single step reverssible expansion')
+printf("\n Work done = %4.2e J",w)
+
+
+//Calcualtions Two step irreverssible expansion
+Vint = n*R*T1/(Pint)
+w = -Pint*1e5*(Vint-Vi1)*1e-3 - Pf1*1e5*(Vf1-Vint)*1e-3
+
+//Results
+printf("\n For Two step reverssible expansion')
+printf("\n Work done = %4.2e J",w)
+
|