summaryrefslogtreecommitdiff
path: root/3012/CH2/EX2.2
diff options
context:
space:
mode:
Diffstat (limited to '3012/CH2/EX2.2')
-rwxr-xr-x3012/CH2/EX2.2/Ex2_2.sce23
1 files changed, 23 insertions, 0 deletions
diff --git a/3012/CH2/EX2.2/Ex2_2.sce b/3012/CH2/EX2.2/Ex2_2.sce
new file mode 100755
index 000000000..4915ec069
--- /dev/null
+++ b/3012/CH2/EX2.2/Ex2_2.sce
@@ -0,0 +1,23 @@
+// Given:-
+p1 = 3*(10**5) // initial pressure in pascal
+v1 = 0.1 // initial volume in m3
+v2 = 0.2 // final volume
+m = 4.0 // mass of the gas in kg
+deltau = -4.6 // change in specific internal energy in KJ/Kg
+
+// Calculations
+
+constant = p1*(v1**1.5) // p*(v^n) = constant
+
+function v = p(v)
+ v = constant/(v**1.5) // expressing pressure as function of volume
+endfunction
+
+work = intg(v1,v2,p) // integrating pdv from initial to final volume
+w=work(1)/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
+
+// Result
+printf( 'net heat transfer for the process in KJ %.2f',Q)