summaryrefslogtreecommitdiff
path: root/572/CH2/EX2.2/c2_2.sce
blob: 128f5ddaefc09504cf37031c7b0a8fa1858a96e2 (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
28
29
30
31
32
33
// (2.2) Four kilograms of a certain gas is contained within a piston–cylinder assembly. The gas undergoes a process for which the pressure–volume relationship is p*(v^1.5) = constant. The initial pressure is 3 bar, the initial volume is 0.1 m3, and the final volume is 0.2 m3. The change in specific internal energy of the gas in the process is u2-u1 =- 4.6 kJ/kg. There are no significant changes in kinetic or potential energy. Determine the net heat transfer for the process, in kJ.

// solution

//variable initialization
p1 = 3*(10^5) // initial pressure in pascal
v1 = .1       // initial volume in m3
v2 = .2      // initial volume in m3
m = 4        //mass of the gas in kg
deltau = -4.6 // change in specific internal energy in KJ/Kg


funcprot(0);
function [constant] = f1(n)
    constant = p1*(v1^n);                      //p*(v^n) = constant
endfunction;

function [p] = f2(v,n)                         
    p = f1(n)/(v^n);                          //expressing pressure as function of volume        
endfunction;

function [work] = f3(n)
    work = intg(v1,v2,f2);                   //integrating pdv from initial to final volume 
endfunction;

w = f3(1.5)/1000;                           // divided by 1000 to convert to KJ

deltaU = m*deltau;                           // change in internal energy in KJ
Q = deltaU + w;                              // neglecting kinetic and potential energy changes

disp(Q,"net heat transfer for the process in KJ")