summaryrefslogtreecommitdiff
path: root/1019/CH2/EX2.3/Example_2_3.sce
blob: a079f91d520b9065e50387e9e77c1307e530cf4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//Example 2.3
clear;
clc;

//Given
p1=1013.25;//initial pressure in N m^-2
p2=101325;//final pressure in N m^-2
R=8.314;// gas constant in J K^-1 mol^-1
T=300;// temperature in K
n=0.5;//moles of oxygen present

// To determine minimum work required
w=n*R*T* log(p2/p1);// w in joule
mprintf('minimum work required (w) = %f Joule',w);
//end