Santa Monica College Chemistry 12 Linearizing Data using Microsoft Excel© Introduction An important technique in graphical analysis is the transformation of experimental data to produce a straight line. If there is a direct, linear relationship between two variable parameters, the data may be fitted to the equation of a line with the familiar form y = mx + b through a technique known as linear regression. Here m represents the slope of the line, and b represents the y-intercept, as shown in the figure below. This equation expresses the mathematical relationship between the two variables plotted, and allows for the prediction of unknown values within the parameters. best-fit line y data Best-fit line Equation: y = mx + b b οy b = y-intercept m = slope = οy/οx = y2-y1/x2-x1 οx x data A problem that arises, however, is that plotted data will often appear to be distinctly nonlinear. Thus, in this exercise you will learn how to use functions in Microsoft Excel© to manipulate data in order to generate a linear plot. Please note that although Excel can fit curves to nonlinear datasets, this form of analysis is usually not as accurate as linear regression. Students can find Excel 365 on all computers in all the computer centers at SMC. Older versions of Microsoft Excel© may also be used, which while not identical, are similar enough in their user interface and functionality. However, the instructions here are not compatible with any versions of Excel on Apple devices. Note that students can download a copy of Excel 365 to their personal device from the freely available Office 365 (provided by SMC) by signing in at: http://www.smc.edu/TechnologyResources/StudentEmail/Pages/Office365.aspx. Part 1: Using Functions Scenario – An experiment is designed to measure how quickly helium gas diffuses from a source to a detector ten meters away, as a function of the temperature of the source. The data collected are shown below: Temperature (K) 200. 300. 400. 500. 600. 700. 800. Linearizing Data using Microsoft Excel Time of Diffusion (ms) 9.72 7.93 6.87 6.15 5.61 5.19 4.86 Page 1 of 6 Santa Monica College Chemistry 12 a) Launch Excel and open a blank workbook. b) Enter the data into the first two columns in the spreadsheet. • Reserve the first row for column labels. • The x values must be entered to the left of the y values in the spreadsheet. Remember that the independent variable (the one that the experimenter has control of) goes on the x-axis while the dependent variable (the measured data) goes on the y-axis. Which data goes on the x-axis in the left column? Which data goes on the y-axis in the right column? Why did you make these selections? c) Highlight the set of data – not the column labels – that you wish to plot (Figure 1). Click on the Insert tab (top left), then go to Charts, then Scatter (Figure 2). Choose the scatter graph that shows data points only, with no connecting lines – the option labeled Scatter with Only Markers (Figure 3). Figure 1 Figure 2 Figure 3 A graph should now appear on your Excel screen. d) Examination of your graph will reveal that the plotted data is not linear. Your goal is to linearize this data. Doing this requires that you operate on one column of your data values with a function. One of the following functions of temperature will give a straight line when plotted against time: ln(Temp) = the natural log of temperature (Temp)½ = the square root of temperature (Temp)–½ = the inverse of the square root of temperature e) Using functions to manipulate data values in Excel is quite straightforward. As an example, follow the procedure below to obtain a column of ln(Temp) values: • Pick an empty column to the right of your data. In the same row as your original data begins, type "=ln(a2)", where a2 represents the cell in which the first temperature value exists (a1 should contain your column label). When you hit return, the program returns the natural log of that value and puts it into the new cell. • To operate on the rest of the values, click on the cell with the formula near the bottom right corner so that the cursor appears as a solid black cross (not a white cross). Hold the mouse button down and drag down the cell until you are in the same row as the last data point. When you release the mouse, all the cells will fill in with the ln of each temperature value in the correct rows. Note that this is simply a shorthand way to paste the function into many cells at once. Be sure to add a label to this new column of data. Linearizing Data using Microsoft Excel Page 2 of 6 Santa Monica College f) Chemistry 12 Now create a plot of “time versus the new function”. Note that you will have to re-enter the “time” data in the column beside the new “ln(temp)” data before creating the new graph. g) Repeat this procedure (steps e and f) for the other two functions of temperature. Note: • • To obtain the square root of temperature, type “=(a2)^0.5” To obtain the inverse square root of temperature, type “=(a2)^-0.5” h) Examine your three new plots, and then fit a trendline to the plot that is now linear: i) • First "activate" the graph by clicking on any one of the data points. When you do this, all the data points will appear highlighted. • Click the Chart Elements button • Check the Trendline box and click More Options. • Notice that the “Linear” button is already selected. Now select the “Display Equation on Chart” box and the “Display R-squared value on Chart” box. Then click “Close”. • The equation that now appears on your graph is the equation of the fitted trendline. The R2 value gives a measure of how well the data is fit by the equation. The closer the R 2 value is to 1, the better the fit. Generally, R2 values of 0.95 or higher are considered good fits. Note that the program will always fit a trendline to the data no matter how good or awful the data is. You must judge the quality of the fit and the suitability of this type of fit to your dataset. next to the upper-right corner of the chart. Use the results of your graphical analysis to complete all the sections of Part 1 on your report. You are not required to print out and submit the graph you prepared. Part 2: Linearizing Data using the Ideal Gas Law Scenario – An experiment is designed to measure the pressure of a sample of carbon dioxide gas in a sealed steel tube. The tube is fitted with a frictionless piston, which is then used to gradually increase the volume at a constant temperature of 18.0 °C: Pressure (atm) 2.557 1.704 1.278 1.023 0.852 0.730 0.639 0.568 Volume (L) 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 a) Enter this data into a new sheet in Excel by clicking on the Sheet 2 tab at the bottom left of the page. Then create a plot of “Pressure versus Volume” (see Part 1, steps b and c). Remember to think carefully about which set of data goes on the y-axis and x-axis, and to input the x-axis data in the left column. Once again, you should observe that the plotted data is not linear. Linearizing Data using Microsoft Excel Page 3 of 6 Santa Monica College Chemistry 12 b) How can you obtain a linear plot? Recall the Ideal Gas Law: ππ = ππ π Note that n represents the moles of gas used, T is the gas temperature (in K), and R is the gas constant (0.08206 L•atm/K•mol). This equation may then be re-arranged to: 1 π = ππ π ( ) π Note that this takes the form of the equation of a line, where P is y and 1/V is x. Thus, a plot of “pressure versus the inverse of volume” should generate a straight line! c) You will first have to convert your column of volume values into a column of inverse volume values. Follow the procedure described in Part 1 (see steps e and f) but this time typing in "=1/(a2)", to obtain the inverse of volume. Use the click and drag technique to fill in values for all the rows. Add a label to this new column of data. d) Now create a plot of “pressure versus the inverse of volume”. Note that you will have to reenter the “pressure” data in the column beside the new “inverse volume” data before creating the new graph. e) If all looks well, add a title and label the axes of your graph: f) • First, click inside the chart. Switch to the Design tab, and click Add Chart Element > Chart Title > Above Chart. The graph should be given an appropriate title that starts out “Y versus X” followed by a brief description of your system. • Again, click on Add Chart Element > Axis Titles (first select Primary Horizontal Axis Title and then Primary Vertical Axis Title) to add labels to the x- and y-axes. Note that it is important to label axes with both the measurement and the units used. To change the titles, click the text box for each title, highlight the text and type in your new title. Fit a trendline to the plotted data and obtain the equation of the fitted trendline (which should be clearly visible on your graph). Then print out your graph and attach it to your report. g) Use the results of your graphical analysis to complete all the sections of Part 2 on your report. Part 3: Choosing the Correct Parameters for Linearizing Data Scenario – The following data was collected from an experiment which measures the rate constant (k) of a uncatalyzed reaction (decomposition of H2O2) as a function of temperature: Temperature (K) 298 303 308 313 318 323 Linearizing Data using Microsoft Excel Rate Constant, k (s-1) 2.45 x 10-6 5.82 x 10-6 1.33 x 10-5 2.98 x 10-5 6.45 x 10-5 1.35 x 10-4 Page 4 of 6 Santa Monica College Chemistry 12 a) k (rate constant) and T (temperature) are related via the following equation: −Ea k = Ae RT A is called the frequency factor (with identical units to k, in s-1), Ea is the activation energy (in kJ/mol) of the reaction, and R is the thermodynamic gas constant (8.3145 x 10-3 kJ/K•mol). Since the relationship between k and T is exponential, the supplied dataset when plotted will not be linear. Your goal is to linearize it. To do this, you must perform different functions on both k and T before you plot the data. b) How do you take an exponential function and transform it into a linear function? Clearly you have to get rid of the "e" or the exponential term. To do this, simply take the natural logarithm of both sides of the equation. This gives the new, linearized equation below. ln π = ln π΄ − πΈπ π π This is the function that you must plot to get a straight line. But exactly what are you going to plot on the x-axis and y-axis to create this linear graph? If you rearrange the previous equation, it might become evident: ln π = − πΈπ 1 ( ) + ln π΄ π π Identify y, x, m and b within this equation, and record them on your report. Check with your instructor to make sure you have figured it out correctly. Only then should you go ahead and construct your linear plot. c) Enter the data into a new sheet (Sheet 3) of Excel, and use the appropriate functions (as learned in Parts 1 and 2) to linearize it. Then plot these variables to obtain a linear graph. Adding a Second Dataset to a Graph d) Suppose that the rate constant (k) of the same reaction (decomposition of H2O2) is again measured as a function of temperature, but this time a catalyst (MnO2) is used: Temperature (K) 298 303 308 313 318 323 Rate Constant, k (s-1) 1.08 x 10-3 1.92 x 10-3 3.35 x 10-3 5.71 x 10-3 9.55 x 10-3 1.57 x 10-2 You would like to compare the original data for the uncatalyzed reaction to this new data for the catalyzed reaction. To do this you will need to add the new data (once linearized) to the graph you created in step c. Note that this process only works if you have similar axis values and magnitudes. Linearizing Data using Microsoft Excel Page 5 of 6 Santa Monica College Chemistry 12 e) Enter the new data for the catalyzed reaction into empty columns of Sheet 3, and then apply the appropriate functions to linearize this data (same as those used for the original uncatalyzed data). f) To add this new linearized data to your graph: • • • • Activate the graph by clicking on one of the plotted data points. Right-click the chart, and then choose Select Data. The Select Data Source box appears on the worksheet with the source data of the chart. Click the Add tab and type “catalyzed data” for the Series Name. Click the little icon on the right of the box “Series X values”, then highlight the x-axis values of the new linearized catalyzed data. Press enter, then repeat this procedure for the “Series Y Values”, highlighting the y-axis values of new linearized catalyzed data. g) Click OK twice to return to the main Excel window. At this point you should see the new data added to your graph, similar to what is shown in Figure 4 below. 0 0.00305 0.0031 0.00315 0.0032 0.00325 0.0033 0.00335 0.0034 -2 -4 -6 -8 -10 -12 -14 Figure 4 h) Each dataset can now be independently analyzed. Add a trendline and obtain the equation of the fitted trendline for each set of data. i) Complete your graph by adding axis labels, x-axis units (the y-axis values are unitless) and an appropriate title. You may also want to add a Legend (located under Chart Elements or Chart Tools) to identify which dataset was obtained for the uncatalyzed reaction and which was obtained for catalyzed reaction. Then print out your graph and attach it to your report. j) Use the results of your graphical analysis to complete all the sections of Part 3 on your report. Linearizing Data using Microsoft Excel Page 6 of 6
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )