summaryrefslogtreecommitdiff
path: root/555/CH4
diff options
context:
space:
mode:
Diffstat (limited to '555/CH4')
-rw-r--r--555/CH4/EX4.1/1.sce18
-rw-r--r--555/CH4/EX4.2/2.sce26
-rw-r--r--555/CH4/EX4.3/3.sce31
-rw-r--r--555/CH4/EX4.4/4.sce24
-rw-r--r--555/CH4/EX4.5/5.sce32
5 files changed, 131 insertions, 0 deletions
diff --git a/555/CH4/EX4.1/1.sce b/555/CH4/EX4.1/1.sce
new file mode 100644
index 000000000..4f50b097c
--- /dev/null
+++ b/555/CH4/EX4.1/1.sce
@@ -0,0 +1,18 @@
+// Implementation of example 4.1
+// Basic and Applied Thermodynamics by P.K.Nag
+// page 72
+
+clc
+clear
+
+// First law of Thermodynamics for stationary system is dQ = dU+W
+dQ=-37.6 // (heat transfer in kJ)
+v1=0.3 // (initial volume in m^3)
+p=0.105 // (pressure in MPa)
+v2=0.15 // (final volume in m^3)
+
+W=p*(v2-v1)*1000;
+// now according to first law
+dU=W-dQ;
+printf("Change in internal energy of gas is = %.2f kJ",dU);
+// end \ No newline at end of file
diff --git a/555/CH4/EX4.2/2.sce b/555/CH4/EX4.2/2.sce
new file mode 100644
index 000000000..6208ed766
--- /dev/null
+++ b/555/CH4/EX4.2/2.sce
@@ -0,0 +1,26 @@
+// Implementation of example 4.2
+// Basic and Applied Thermodynamics by P.K.Nag
+// page 73
+
+clc
+clear
+
+Qacb=84 // (heat flow into system along path acb in kJ)
+Wacb=32 // (work done by system along path acb in kJ)
+Wadb=10.5 // (work done by system along path adb in kJ)
+Wab=21 // (work done on system along curved path b to a in kJ)
+Ua=0 // (internal energy at a in kJ)
+Ud=42 // (internal energy at d in kJ)
+Wdb=0 // (since it is following an isochoric path)
+
+Uab=Qacb-Wacb;
+Qadb=Uab+Wadb;
+Qab=(Uab+Wab);
+Wad=Wadb-Wdb;
+Qad=(Ud-Ua)+Wad;
+Qdb=Qadb-Qad;
+printf("Heat flow into the system along path adb = %.2f kJ \n",Qadb);
+printf("The system liberates %.2f kJ of heat \n",Qab);
+printf("heat absorbed along path ad = %.2f kJ \n",Qad);
+printf("heat absorbed along path db = %.2f kJ \n",Qdb);
+// end \ No newline at end of file
diff --git a/555/CH4/EX4.3/3.sce b/555/CH4/EX4.3/3.sce
new file mode 100644
index 000000000..3cae08ecb
--- /dev/null
+++ b/555/CH4/EX4.3/3.sce
@@ -0,0 +1,31 @@
+// Implementation of example 4.3
+// Basic and Applied Thermodynamics by P.K.Nag
+// page 73-74
+
+clc
+clear
+
+Q=-170 // (sum of all heat transfers during a cycle in kJ)
+
+Qab=0 // (heat transfer in process a-b in kJ/min)
+Qbc=21000 // (heat transfer in process b-c in kJ/min)
+Qcd=-2100 // (heat transfer in process c-d in kJ/min)
+Wab=2170 // (work done in process a-b in kJ/min)
+Wbc=0 // (work done in process b-c in kJ/min)
+dEcd=-36600 // (change in internal energy in kJ/min)
+
+dEab=Qab-Wab;
+dEbc=Qbc-Wbc;
+Wcd=Qcd-dEcd;
+// The system completes 100 cycles per min
+Qda=(Q*100)-(Qab+Qbc+Qcd);
+// Now dE=0,since cyclic integral of any property is zero
+dEda=-(dEab+dEbc+dEcd);
+Wda=Qda-dEda;
+printf("change in internal energy in a-b is = %.2f kJ/min \n",dEab);
+printf("change in internal energy in b-c is = %.2f kJ/min \n",dEbc);
+printf("work done in c-d is = %.2f kJ/min \n",Wcd);
+printf("change in internal energy in d-a is = %.2f kJ/min \n",dEda);
+printf("work done in d-a is = %.2f kJ/min \n",Wda);
+printf("heat transfer in d-a is = %.2f kJ/min \n",Qda);
+// end \ No newline at end of file
diff --git a/555/CH4/EX4.4/4.sce b/555/CH4/EX4.4/4.sce
new file mode 100644
index 000000000..e60c6acba
--- /dev/null
+++ b/555/CH4/EX4.4/4.sce
@@ -0,0 +1,24 @@
+// Implementation of example 4.4
+// Basic and Applied Thermodynamics by P.K.Nag
+
+clc
+clear
+
+//Initial pressure p1 volume V1, final pressure p2 volume V2
+//internal energy u = 3.56*p*v+84, pv^n=constant
+p1=500;//kPa
+V1=0.22;//m^3
+p2=100;//kPa
+n=1.2;
+V2=V1*(p1/p2)^(1/n);
+//change in internal energy 'dU'
+dU = 3.56*(p2*V2-p1*V1);
+//Work done 'Wa'
+Wa = (p2*V2-p1*V1)/(1-n);
+//Heat transfer 'Qa'
+Qa=dU+Wa;
+//Part b
+Qb = 30;//kJ
+Wb=Qb-dU;
+printf(' (a):Change in internal energy = %0.0f kJ \n Work done W = %0.1f kJ \n Heat transfer Q = %0.1f kJ \n (b): W = %0.0f kJ \n The work in (b) is not equal to integral of pdV since the process is not quasi-static',dU,Wa,Qa,Wb);
+// end \ No newline at end of file
diff --git a/555/CH4/EX4.5/5.sce b/555/CH4/EX4.5/5.sce
new file mode 100644
index 000000000..e5260bc6e
--- /dev/null
+++ b/555/CH4/EX4.5/5.sce
@@ -0,0 +1,32 @@
+// Implementation of example 4.5
+// Basic and Applied Thermodynamics by P.K.Nag
+
+clc
+clear
+
+//pressure in initial state 'p1',Volume in initial state 'V1',
+//pressure in final state 'p2',Volume in final state 'V2',
+//internal energy U = (34 + 3.15 * p * V);
+p1 = 170; //kPa
+V1 = 0.03; //m3
+p2 = 400; //kPa
+V2 = 0.06; //m3
+dU = 3.15 * (p2 *V2 - p1 * V1); //kJ
+
+
+A = [1 V1;1 V2];
+C = [p1;p2];
+B = inv(A)*C;
+a = round(B(1,1));
+b = round(B(2,1));
+
+function p = pdV(V)
+ p = a+b*V;
+endfunction
+//Work transfer involved during the process 'W12'
+W12 = intg(V1,V2,pdV); //kJ
+printf("Work done by the system, W12 = %0.2f kJ\n\n",W12);
+//Heat transfer 'Q12'
+Q12 = dU + W12;
+printf("Heat flow into the system during the process, Q12 = %0.2f kJ",Q12);
+// end \ No newline at end of file