From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 527/CH8/EX8.11/8_11exam.sce | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 527/CH8/EX8.11/8_11exam.sce (limited to '527/CH8/EX8.11') diff --git a/527/CH8/EX8.11/8_11exam.sce b/527/CH8/EX8.11/8_11exam.sce new file mode 100755 index 000000000..2dbea636d --- /dev/null +++ b/527/CH8/EX8.11/8_11exam.sce @@ -0,0 +1,45 @@ +//Engineering and Chemical Thermodynamics +//Example 8.11 +//Page No:390 + +clear ; clc ; +//Given +R = 8.314 ; +T = 10 + 273.15 ; //[K] +x1 = [0 ,0.0610 ,0.2149 ,0.3187 ,0.4320 ,0.5246 ,0.6117 ,0.7265 ,0.8040 ,0.8830 ,0.8999 ,1] ; //From table E8.9A +P_exp = [6344 ,6590 ,6980 ,7140 ,7171 ,7216 ,7140 ,6974 ,6845 ,6617 ,6557 ,6073 ,6073] ; //From table E8.9A +y1 = [ 1 ,0.0953 ,0.2710 ,0.3600 ,0.4453,0.5106 ,0.5735 ,0.6626 ,0.7312 ,0.8200 ,0.8382, 0 ] ;//From table E8.9A +P_1_sat = 6073 ; //[Pa] +P_2_sat = 6344 ; //[Pa] + +n = 0 ; +for i = 2:11 + x2(1,i) = 1 - x1(1,i) ; + y2(1,i) = 1 - y1(1,i) ; + g_E(1,i) = R * T *( x1(1,i) * log (( y1(1,i) * P_exp(1,i)) / (x1(1,i)* P_1_sat)) + x2(1,i) * log((y2(1,i) * P_exp(1,i)) / (x2(1,i) * P_2_sat)) ) ; + n = n + g_E(1,i) / ((x1(1,i) * x2(1,i)) * 10) ; + ydata(1,i-1) = (g_E(1,i)/(x1(1,i)*x2(1,i))); + xdata(1,i-1) = x1(1,i) - x2(1,i) ; +end +m= 0 ; n=0 ; o = 0 ; p= 0 ;N = 10 ; +for i = 2:11 + m = m + g_E(1,i) * (2 * x1(1,i) - 1) / ( x1(1,i) * x2(1,i)) ; + n = n + g_E(1,i) / ( x1(1,i) * x2(1,i)) ; + o = o + (2 * x1(1,i) - 1) ; + p = p + (2 * x1(1,i) - 1)^2 ; +end +x_bar = o / N ; +y_bar = n / N ; +a1 = (N * m - n * o)/(N * p - o^2) ; +a0 = y_bar - a1 * x_bar ; + +for i = 1:10 + ydata2(1,i) = a0 + a1*xdata(1,i) ; +end +plot(xdata,ydata,"+") ; +plot(xdata,ydata2) ; +xtitle("Figure E8.11","x1-x2","g_E/x1*x2") ; +disp(" Example: 8.11 Page no : 390") ; +printf("\n From average , the value of A = %d J/mol\n",n/10) ; +printf("\n From linear regression best fit line the values of A and B are %.1f J/mol & %.1f J/mol respectively .",a0 , a1) ; +//Readers can refer figure E8.11 . \ No newline at end of file -- cgit