summaryrefslogtreecommitdiff
path: root/3689/CH1/EX1.4
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3689/CH1/EX1.4
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 '3689/CH1/EX1.4')
-rw-r--r--3689/CH1/EX1.4/1_4.sce20
1 files changed, 20 insertions, 0 deletions
diff --git a/3689/CH1/EX1.4/1_4.sce b/3689/CH1/EX1.4/1_4.sce
new file mode 100644
index 000000000..ef0d283ec
--- /dev/null
+++ b/3689/CH1/EX1.4/1_4.sce
@@ -0,0 +1,20 @@
+////Variable Declaration
+T = 300.0 //Nitrogen temperature, K
+v1 = 250.00 //Molar volume, L
+v2 = 0.1 //Molar volume, L
+a = 1.37 //Van der Waals parameter a, bar.dm6/mol2
+b = 0.0387 //Van der Waals parameter b, dm3/mol
+R = 8.314e-2 //Ideal Gas Constant, L.bar/(mol.K)
+n = 1.
+//Calculations
+
+p1 = n*R*T/v1
+p2 = n*R*T/v2
+pv1 = n*R*T/(v1-n*b)- n**2*a/v1**2
+pv2 = n*R*T/(v2-n*b)- n**2*a/v2**2
+
+//Results
+printf("\n Pressure from ideal gas law = %4.2e bar nad from Van der Waals equation = %4.2e bar ",p1, pv1)
+
+printf("\n Pressure from ideal gas law = %4.1f bar nad from Van der Waals equation = %4.1f bar ",p2, pv2)
+