42 Chapter 7: Numerical Integration II From Physical Chemistry, 6th Edition by Peter Atkins: Problem 4.19 The compound 1,3,5-trichloro-2,4,6-trifluorobenzene is an intermediate in the conversion of hexachlorobenzene to hexafluorobenzene, and its thermodynamic properties have been examined by measuring its heat capacity over a wide temperature range. Calculate the molar enthalpy relative to its value at T = 0 and the 3rd Law entropy of the compound at these temperatures in kJ/mol and J/K mol, respectively. T, K: C p, J K - 1 mol- 1 : 14.14 9.492 16.33 20.03 31.15 44.08 64.81 100.90 12.70 18.18 32.54 46.86 66.36 95.05 T, K: C p, J K - 1 mol- 1 : 140.86 121.3 183.59 144.4 225.10 163.7 à 262.99 180.2 298.06 196.4 At constant pressure, the change in the molar enthalpy is dH = Cp dT. The equation can T2 be otherwise written as H (T2) - H (T1) = T1 C p â T . Plot Cp vs. T and calculate the area under the curve from T = 0 to T = 298.06 K. 88 < < 8 < @ D 88 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 <8 <8 << Make a list of the t and cp values given in the problem. Using those lists make a new list of {t, cp} values. Don't forget to transpose. t = 14.14, 16.33, 20.03, 31.15, 44.08, 64.81, 100.90, 140.86, 183.59, 225.10, 262.99, 298.06 ; cp = 9.492, 12.70, 18.18, 32.54, 46.86, 66.36, 95.05, 121.3, 144.4, 163.7, 180.2, 196.4 ; points = t, cp ; data = Transpose points 14.14 , 31.15 , 100.9 , 225.1 , 9.492 32.54 95.05 163.7 , , , , 16.33 , 12.7 , 20.03 , 18.18 , 44.08 , 46.86 , 64.81 , 66.36 , 140.86 , 121.3 , 183.59 , 144.4 , 262.99 , 180.2 , 298.06 , 196.4 43 @ 8 Scatter plot the points with ListPlot: < @D D dataplot = ListPlot data, AxesLabel ® "T,K", "Cp,J K- 1 mol- 1 " , PlotLabel ® "Molar Enthalpy", PlotStyle ® PointSize 0.015 ; Cp ,J K - 1 mol - 1 200 Molar Enthalpy 150 100 50 50 100 150 200 250 300 T,K We need to extrapolate the data to T = 0. The easiest way to do this is by fitting a function to the curve. Since we can use the trapezoid rule for all the points between T=14.14 K and T = 298.06 K, we only need the function to fit the first few data points. 8 < 8 < 8 @ <D 88 <8 <8 <8 < < @ 8 < D @ 8 < D @ 8 < D Make a new list of {t, cp} values using the first four data points: t4pts = 14.14, 16.33, 20.03, 31.15 ; cp4pts = 9.492, 12.70, 18.18, 32.54 ; pts4 = t4pts, cp4pts ; data4pts = Transpose pts4 14.14 , 9.492 , 16.33 , 12.7 , 20.03 , 18.18 , 31.15 , 32.54 Fit a 2nd order polynomial to the data points and check the fit by plotting the points and the function together. Remember that if you suppress the graphs with DisplayFunction, you must unsuppress when you use Show. fiteqn1 = Fit data4pts, 1, x, x^2 , x - 14.4242 + 1.83899 x - 0.0106327 x2 fitplot1 = Plot fiteqn1, x, 0, 31.154 , DisplayFunction ® Identity ; Show dataplot, fitplot1 , DisplayFunction ® $DisplayFunction ; 44 Cp ,J K - 1 mol - 1 200 Molar Enthalpy 150 100 50 20 40 60 80 100 120 T,K 140 Calculate the area as follows: 1) Integrate the area from T = 0 to T = 14.14 K using the fit equation. 2) Find the area from T = 14.14 to T = 298.06 K using the trapezoid rule. 3) Sum up the two areas to find dH in J/mol. 4) Convert dH to kJ/mol and print the result. @8 <D @ H@ @D D@ @ D D LH @ @D D@ @ D D L8 <D @ D @ D area0to14 = Integrate fiteqn1, x, 0, 14.14 - 30.1355 There are 12 data points and 11 trapezoids, so i will range from 1 to 11. area14to298 = 1 * Sum cp i + 1 2 + cp i * t i+1 - t i , i, 1, 11 34475.8 totalAreaJ = area0to14 + area14to298; totalAreakJ = totalAreaJ 1000; Print "dH = ", totalAreakJ, " kJ mol" dH = 34.4456 kJ mol Since dH = H (298.06) - H (0) and H (0) = 0, then H (298.06) = dH. Print "Molar enthaply relative to 0 K = ", totalAreakJ, " kJ mol" Molar enthaply relative to 0 K = 34.4456 kJ mol 45 à Cp At constant pressure, the change in the molar entropy is dS = T T2 be otherwise written as S (T2) - S (T1) = T1 dT. The equation can Cp Cp â T . Plot T vs. T and calculate T the area under the curve from T = 0 to T = 298.06 K. The list of t and cp values was defined previously. Make a new list of cp/t values and use it to make a list of {t, cp/t} values. Make sure to name your definitions with different names. 8 < @ D 88 < 8 < 8 8 < 8 < 8 8 < 8 < 8 8 <8 <8 @ 8 cpT = cp t; points2 = t, cpT ; data2 = Transpose points2 14.14 , 31.15 , 100.9 , 225.1 , < << << < @D D 0.671287 , 16.33 , 0.77771 , 20.03 , 0.907639 , 1.04462 , 44.08 , 1.06307 , 64.81 , 1.02392 , 0.942022 , 140.86 , 0.861139 , 183.59 , 0.786535 0.727232 , 262.99 , 0.685197 , 298.06 , 0.658928 Scatter plot the points with ListPlot: , dataplot2 = ListPlot data2, AxesLabel ® "T,K", "Cp T,J K- 2 mol- 1 " , PlotLabel ® "3rd Law Entropy", PlotStyle ® PointSize 0.015 Cp T,J K - 2 mol - 1 50 3rd Law Entropy 100 150 200 250 300 T,K 0.9 0.8 0.7 Similar to molar enthalpy, extrapolate the data to T = 0 by fitting a function to the first few data points. Given the shape of the curve, it's best to fit an equation to only three points, instead of four. Make a list of the first three t and cp values. Then define a list of cp/t values to make a new list of {t, cp/t} values. ; 88 << 8 @<D 88 <8 <8 < < @ 8 <D @ 8 < D @ 8 < D 46 t3pts = 14.14, 16.33, 20.03 ; cp3pts = 9.492, 12.70, 18.18 ; cpT3pts = cp3pts t3pts; points3 = t3pts, cpT3pts ; data3pts = Transpose points3 14.14 , 0.671287 , 16.33 , 0.77771 , 20.03 , 0.907639 Fit a 2nd order polynomial to the data points and check the fit by plotting the points and the function together. Remember that if you suppress the graphs with DisplayFunction, you must unsuppress when you use Show. fiteqn2 = Fit data3pts, 1, x, x^2 , x - 0.544258 + 0.118324 x - 0.00228844 x2 fitplot2 = Plot fiteqn2, x, 0, 20.03 , DisplayFunction ® Identity ; Show dataplot2, fitplot2 , DisplayFunction ® $DisplayFunction ; Cp T,J K - 2 mol - 1 3rd Law Entropy 1 0.75 0.5 0.25 25 50 75 100 125 150 T,K -0.25 -0.5 Calculate the area as follows: 1) Integrate the area from T = 0 to T = 14.14 K using the fit equation. 2) Find the area from T = 14.14 to T = 298.06 K using the trapezoid rule. 3) Sum up the two areas to find dS in J/K mol. @8 <D @ H @ @ D D @ @ D D L H @ @ D D @ @ D D L 8 <D @ D @ D 47 Sarea0to14 = Integrate fiteqn2, x, 0, 14.14 1.97639 There are 12 data points and 11 trapezoids, so i will range from 1 to 11. Sarea14to298 = 1 * Sum cpT i + 1 2 i, 1, 11 239.268 + cpT i * t i+1 - t i , totalSAreaJ = Sarea0to14 + Sarea14to298; Print "dS = ", totalSAreaJ, " J K mol" dS = 241.244 J K mol Since dS = S (298.06) - S (0) and S (0) = 0, then S (298.06) = dS. Print "3rd law entropy relative to 0 K = ", totalSAreaJ, " J K mol" 3rd law entropy relative to 0 K = 241.244 J K mol From Physical Chemistry, 6th Edition by Peter Atkins: Problem 4.18 The heat capacity of anhydrous potassium hexacyanoferrate(II) varies with temperature. Calculate the molar enthalpy relative to its value at T = 0 and the 3rd Law entropy of the compound at these temperatures in kJ/mol and J K-1 mol-1, respectively. T, K: C p, J K - 1 mol- 1 : T, K: C p, J K - 1 mol- 1 : 10 20 30 40 50 60 70 80 90 2.09 14.43 36.44 62.55 87.03 111.0 131.4 149.4 165.3 100 110 150 160 170 180 190 200 179.6 192.8 237.6 247.3 256.5 265.1 273.0 280.3 Ù à At constant pressure, the change in the molar enthalpy is dH = Cp dT. The equation can T be otherwise written as H (T2) - H (T1) = T12 C p â T . Since H (0) = 0, dH = H (200 K). Plot Cp vs. T and calculate the area under the curve from T = 0 to T = 200 K. Cp At constant pressure, the change in the molar entropy is dS = T dT. The equation can T2 Cp â T . Since S (0) = 0, dS = S (200 K). be otherwise written as S (T2) - S (T1) = T1 T Ù T Plot T12 C p â T vs. T and calculate the area under the curve from T = 0 to T = 200 K. 48 Answer: Problem 4.18 88 < < 8 < @ D 88 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 <8 <8 <8 << @ 8 @D < D Make a list of the t and cp values given in the problem. Using those lists make a new list of {t, cp} values. Don't forget to transpose. t = 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 150, 160, 170, 180, 190, 200 ; cp = 2.09, 14.43, 36.44, 62.55, 87.03, 111.0, 131.4, 149.4, 165.3, 179.6, 192.8, 237.6, 247.3, 256.5, 265.1, 273.0, 280.3 ; points = t, cp ; data = Transpose points 10 , 2.09 , 20 , 14.43 , 60 , 111. , 70 , 131.4 , 100 , 179.6 , 110 , 192.8 170 , 256.5 , 180 , 265.1 30 , 36.44 , 40 , 62.55 , 50 , 87.03 , 80 , 149.4 , 90 , 165.3 , , 150 , 237.6 , 160 , 247.3 , , 190 , 273. , 200 , 280.3 Scatter plot the points with ListPlot: dataplot = ListPlot data, AxesLabel ® "T,K", "Cp,J K- 1 mol- 1 " , PlotLabel ® "Molar Enthalpy", PlotStyle ® PointSize 0.015 ; Cp ,J K - 1 mol - 1 Molar Enthalpy 250 200 150 100 50 50 100 150 200 T,K We need to extrapolate the data to T = 0. The easiest way to do this is by fitting a function to the curve. Since we can use the trapezoid rule for all the points between T=14.4 K and T = 298.06 K, we only need the function to fit the first few data points. Given the shape of the curve, three points might be best. 49 8 < 8 < 8 @ <D 88 <8 <8 < < @ 8 <D @ 8 < @ 8 < Make a new list of {t, cp} values using the first three data points: t3pts = 10, 20, 30 ; cp3pts = 2.09, 14.43, 36.44 ; pts3 = t3pts, cp3pts ; data3pts = Transpose pts3 10, 2.09 , 20, 14.43 , 30, 36.44 Fit a 2nd order polynomial to the data points and check the fit by plotting the points and the function together. Remember that if you suppress the graphs with DisplayFunction, you must unsuppress when you use Show. fiteqn1 = Fit data3pts, 1, x, x^2 , x - 0.58 - 0.2165 x + 0.04835 x2 D D fitplot1 = Plot fiteqn1, x, 0, 30 , DisplayFunction ® Identity ; Show dataplot, fitplot1 , DisplayFunction ® $DisplayFunction ; Cp ,J K - 1 mol - 1 Molar Enthalpy 250 200 150 100 50 20 40 60 80 100 120 T,K Calculate the area as follows: 1) Integrate the area from T = 0 to T = 10 K using the fit equation. 2) Find the area from T = 10 to T = 200 K using the trapezoid rule. 3) Sum up the two areas to find dH in J/mol. 4) Convert dH to kJ/mol and print the result. @8 <D @ H@ @D D@ @ D D LH @ @D D@ @ D D L8 <D @ D @ D 8< @ D 88 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 < 8 <8 <8 << 50 area0to10 = Integrate fiteqn1, x, 0, 10 - 0.508333 There are 17 data points and 16 trapezoids, so i will range from 1 to 16. area10to200 = 1 * Sum cp i + 1 2 31962.5 + cp i * t i+1 - t i , i, 1, 16 totalAreaJ = area0to10 + area10to200; totalAreakJ = totalAreaJ 1000; Print "dH = ", totalAreakJ, " kJ mol" dH = 31.9619 kJ mol Since dH = H (298.06) - H (0) and H (0) = 0, then H (298.06) = dH. Print "Molar enthaply relative to 0 K = ", totalAreakJ, " kJ mol" Molar enthaply relative to 0 K = 31.9619 kJ mol The list of t and cp values is already defined. To calculate dS, make a new list of cp/t values and use it to make a list of {t, cp/t} values. Make sure to name your definitions with different names. cpT = cp t; points2 = t, cpT ; data2 = Transpose points2 10 , 0.209 , 20 , 0.7215 , 30 , 1.21467 , 40 , 1.56375 , 50 , 1.7406 , 60 , 1.85 , 70 , 1.87714 , 80 , 1.8675 , 90 , 1.83667 , 100 , 1.796 , 110 , 1.75273 150 , 1.584 , 160 , 1.54563 , 170 , 1.50882 , 180 , 1.47278 , 190 , 1.43684 , 200 , 1.4015 , 51 Scatter plot the points with ListPlot: @ 8 < @D D dataplot2 = ListPlot data2, AxesLabel ® "T,K", "Cp T,J K- 2 mol- 1 " , PlotLabel ® "3rd Law Entropy", PlotStyle ® PointSize 0.015 Cp T,J K - 2 mol - 1 ; 3rd Law Entropy 1.75 1.5 1.25 1 0.75 0.5 0.25 50 100 150 200 T,K 8 @< D 88 <8 <8 < < @ 8 < D @ 8 < @ 8 < D Similar to molar enthalpy, extrapolate the data to T = 0 by fitting a function to the first three data points. You can use the lists already defined for the first 3 points and just make a new list of cp/t values. Using those lists, make a new list of {t, cp/t} values. cpT3pts = cp3pts t3pts; points3 = t3pts, cpT3pts ; dataS = Transpose points3 10, 0.209 , 20, 0.7215 , 30, 1.21467 Fit a 2nd order polynomial to the data points and check the fit by plotting the points and the function together. Remember that if you suppress the graphs with DisplayFunction, you must unsuppress when you use Show. fiteqn2 = Fit dataS, 1, x, x^2 , x D - 0.322833 + 0.05415 x - 0.0000966667 x2 fitplot2 = Plot fiteqn2, x, 0, 30 , DisplayFunction ® Identity ; Show dataplot2, fitplot2 , DisplayFunction ® $DisplayFunction ; 52 Cp T,J K - 2 mol - 1 3rd Law Entropy 1.5 1 0.5 50 100 150 200 T,K Calculate the area as follows: 1) Integrate the area from T = 0 to T = 10 K using the fit equation. 2) Find the area from T = 10 to T = 200 K using the trapezoid rule. 3) Sum up the two areas to find dS in J/K mol. @8 <D @ H @ @ D D @ @ D D L H @ @ D D @ @ D D L 8 <D @ D @ D Sarea0to10 = Integrate fiteqn2, x, 0, 10 - 0.553056 There are 17 data points and 16 trapezoids, so i will range from 1 to 16. Sarea10to200 = 1 * Sum cpT i + 1 2 i, 1, 16 295.79 + cpT i * t i+1 - t i , totalSAreaJ = Sarea0to10 + Sarea10to200; Print "dS = ", totalSAreaJ, " J K mol" dS = 295.237 J K mol Since dS = S (200) - S (0) and S (0) = 0, then S (200) = dS. Print "3rd law entropy relative to 0 K = ", totalSAreaJ, " J K mol" 3rd law entropy relative to 0 K = 295.237 J K mol