summaryrefslogtreecommitdiff
path: root/1019/CH5/EX5.4/Example_5_4.sce
blob: fe910cd37fc0510f8eab4265daac8e8a53b94166 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//Example 5.4
clear;
clc;

//Given
n=1;//moles of gas
V1=2;//initial volume in dm^3
V2=20;//final volume in dm^3
R=8.314;//gas constant in J K^-1 mol^-1
T=300//temperature in K

//To determine q,w,delE,delA,delG and delS
w=-R*T*log(V2/V1);//work done in J
delE=0;//isothermal expansion of ideal gas
q=delE-w;//by 1st Law of thermodynamics
delH=0;//delH=delE+del(n*R*T) and both are 0
delA=-n*R*T*log(V2/V1);//helmoltz free energy in J
delG=n*R*T*log(V1/V2);//Gibbs free energy in J
delS=q/T;//entropy change in J K^-1
mprintf('(i) w = %f J mol^-1',w);
mprintf('\n (ii) delE = %f J since it is isothermal expansion of an ideal gas',delE);
mprintf('\n (iii) q = %f J mol^-1',q);
mprintf('\n (iv) delH = %f J mol^-1',delH);
mprintf('\n (v) delA = %f J mol^-1',delA);
mprintf('\n (vi) delG = %f J mol^-1',delG);
mprintf('\n (vii) delS = %f J K^-1 mol^-1',delS);
//end