summaryrefslogtreecommitdiff
path: root/1019/CH2/EX2.12/Example_2_12.sce
blob: 001d3070f06fafaf628089b2d9233440e0048692 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//Example 2.12
clear;
clc;

//Given
R=0.082;// gas constant in atm dm^3 K^-1 mol^-1
v1=1;// initial volume in dm^3 mol^-1
v2=50;// fina volume in dm^3 mol^-1
T=273;// temperature in K
a=6.5;// van der waals constant inatm dm^6 mol^-2
b=0.056;//atm dm^3 K^-1 mol^-1
n=1; //moles of given gas

// To determine t2,w,delH and delE
w=(-1)*101.325*R*T*log(v2/v1);//work done in J mol^-1
W=101.325*(-1)*((R*T*log((v2-(n*b))/(v1-(n*b))))+(a*n*n*((1/v2)-(1/v1))));//work done in J in terms of van der waals gas
delE=(-1)*101.325*a*((1/v2)-(1/v1));//change in internal energy in J mol^-1
q=delE-W;
mprintf('(i) For ideal gas, W = %f J mol^-1, delE = 0,q = 0',w);
mprintf('\n (ii) For Van der Waals gas, W = %f J mol^-1,delE = %f J mol^-1,q = %f J mol^-1',W,delE,q);
//end