summaryrefslogtreecommitdiff
path: root/944/CH2/EX2.2/example2_2_TACC.sce
blob: 6a1428d38a82bc8c57fceb1d8c42ed4e3e8c3d9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//example 2.2

clear;
clc;

//Given:
m=16;//weight of oxygen [grams]
w=32;//molecular weight of oxygen [grams/mol]
T=300;//Temperature during compression [K]
P1=1;//initial pressure of process [atm]
P2=100;//final pressure of process[atm]
R=8.314;//Universal gas constant [J/K/mol]

//To find the minimum work of compression 
n=m/w;//no. of moles of oxygen
W=-n*R*T*log(P1/P2);
printf("Mininmum work done to compress oxygen = %f J " , W )