Scientific Graphing Lab

13
Graphing, Computer Graphing, and Computer Assisted Calculations One of the most important aspects of being a successful scientist is the ability to clearly and concisely display information. Most data obtained in a laboratory setting comes in the form of mixed data points, such as those seen in the table below (Table 1). Table 1 shows how much carbon dioxide (CO 2 ), a notorious greenhouse gas, is in the air at the Mauna Loa collection site in Hawaii as a function of month in 2012. Table 1: Concentration of CO 2 by month Month CO 2 (in ppm) January 393.07 February 393.34 March 394.37 April 396.45 May 396.87 June 395.88 July 394.52 August 392.54 September 391.14 October 391.02 November 392.99 December 394.39 Judging from this table, some general trends can be identified, such as the highest value of CO 2 in the atmosphere is in the month of May. However, to better visualize trends, a graph of CO 2 concentration versus month may be clearer. Graph 1 below is a visualization of the above data. Graph 1: The concentration of CO 2 at the Mauna Loa site versus the month the measurement was recorded is displayed for 2012. CO 2 concentration (ppm) Month (numerically assigned) Concentration of CO 2 in the atmosphere at the Mauna Loa site in 2012 versus month

Transcript of Scientific Graphing Lab

Page 1: Scientific Graphing Lab

Graphing, Computer Graphing, and Computer Assisted Calculations

One of the most important aspects of being a successful scientist is the ability to clearly and concisely display information. Most data obtained in a laboratory setting comes in the form of mixed data points, such as those seen in the table below (Table 1). Table 1 shows how much carbon dioxide (CO2), a notorious greenhouse gas, is in the air at the Mauna Loa collection site in Hawaii as a function of month in 2012.

Table 1: Concentration of CO2 by month Month CO2 (in ppm) January 393.07

February 393.34 March 394.37 April 396.45 May 396.87 June 395.88 July 394.52

August 392.54 September 391.14

October 391.02 November 392.99 December 394.39

Judging from this table, some general trends can be identified, such as the highest value of CO2 in the atmosphere is in the month of May. However, to better visualize trends, a graph of CO2 concentration versus month may be clearer. Graph 1 below is a visualization of the above data.

Graph 1: The concentration of CO2 at the Mauna Loa site versus the month the measurement

was recorded is displayed for 2012.

CO

2concentration (ppm)

Month (numerically assigned)

Concentration of CO2 in the atmosphere at the Mauna Loa site in 2012 versus month

Page 2: Scientific Graphing Lab

The previous graph highlights a few points that are true in all graphs (hand or computer):

The graph consists of two axes at right angles. The horizontal axis is referred to as the x-axis. The vertical axis is referred to as the y-axis.

The x-axis displays the variable that a scientist directly manipulates in an experiment (typically called the independent variable). The y-axis displays the variable that changes as a function of the experiment (typically called the dependent variable). Always include units in any graph you create. A number without units is mostly meaningless in chemistry.

The title of the graph gives all relevant information pertaining to what is displayed in the graph. When instructed to make a graph, the y-axis is listed first, followed by the x-axis. (i.e. Concentration of CO2 vs. Month).

Choose a scale for the x and y axes that allow for a maximum portion of the graph to be used. Note: you do NOT have to start a graph at zero and the x and y axes do not have to have the same scale.

In this lab, there are two types of graphs that we will be making: smooth curve plots and linear plots. Graph 1 is an example of a smooth curve plot. Smooth curve plots draw a smooth curve through the data; do not play connect the dots with straight lines between the data points. A linear plot is better represented if we take a step back and look at the concentration of CO2 at Mauna Loa over a longer time period than just one year. Graph 2 below shows data from 1980-2012. Remember that this data comes from a huge data set, much, much larger than table 1. Imagine trying to visualize the below graph if just given the data points!

Graph 2: The concentration of CO2 at the Mauna Loa site versus month over the period from

1980-2012 shows a linear trend.

y = 0.142x + 335.98R² = 0.9767

CO

2concentration (ppm)

Month (numerically assigned)

Concentration of CO2 in the atmosphere at the Mauna Loa site between 1980-2012 versus month

Page 3: Scientific Graphing Lab

Linear graphs are represented by individual "scatter plot" points that are then connected by a trendline (the black straight line in graph 2). The trendline is crucial in establishing a relationship between your independent and dependent variables. A computer graphing program can be used to create a trendline and the corresponding linear equation. This equation takes the form of y = mx + b, where m is the slope of your line, and b is the y-intercept of the graph. This equation allows you to calculate any y-value given any x-value. Additionally, the computer program generates an R2 value that describes how well the linear equation fits your experimental data. An R2 value close to 1 indicates an excellent linear fit, whereas an R2 value <0.90 suggests your data is not accurately modeled by a line.

Use of Excel for graphing and calculations The most common graphing and spreadsheet program that most people have access to is Excel. Although it is not the most powerful graphing program, it can easily perform a multitude of calculations and provide very useable plots. Data Entry

The program opens into a spreadsheet, with rows and lettered columns. Enter the data that you want to be on the x-axis in column A, and the data for the y-axis in column B. (Remember: if you are instructed to make a graph of "volume vs. temperature" then the volume is the y-axis and the temperature is the x-axis)

Formulas Excel makes performing mathematical operations on a series of data very easy. You can add columns of numbers or do any other type of operation. Formulas always start with an “=” sign. Mathematical symbols, in order of operation, include: Parentheses () or brackets [] to group expressions Exponents (a caret symbol, ^) Division (a forward slash, /) Multiplication (an asterisk, *)

Addition (a plus symbol, +) Subtraction (a minus symbol, -) Statistical Functions Functions can be used to calculate the average, standard deviation, etc. on a large

set of data. Common functions include: Average: =average(cell range) Standard deviation: =stdev(cell range) Minimum: =min(cell range)

Maximum: =max(cell range) Other functions: (see the drop down list adjacent to the sigma (Σ) button)

Page 4: Scientific Graphing Lab

Graphing To make a graph, highlight the data in both columns and click on the INSERT tab

on the tool bar. Select the Scatter with only markers option, (use the plot with only the points, no line).

Once the graph appears and is selected, click the LAYOUT tab and select both

Chart Title and Axis Titles options to assign the appropriate titles. Also, select the GRIDLINES tab and eliminate all gridlines.

You will notice a small square off to the right of the graph saying “Series 1”. This is generally only helpful if you are plotting more than one line on the same graph. The rest of the time it is useless. To get rid of if, click on it and press DELETE.

You can modify the axes to fit the range of your data in order to more fully fill the axes. To do so, select an axis, right click, and select Format Axis from the menu. Appropriate values for min, max, etc. can be entered. For example, note the range of the Y axis in the Before vs. After figures below.

Page 5: Scientific Graphing Lab

Drawing a Line Through the Data Points If your graph is best modeled by a line, you will need to show the equation for the

best-fit line through your data points. Click on a data point on your graph. Right click on the data point and select the

ADD TRENDLINE option. Under trendline options, make sure that a LINEAR fit is chosen (it usually is by default). Click the two boxes that are options for "display equation on chart" and "display R2 value on chart"

When you are ready to print, make sure you have the graph selected and then hit

PRINT (see example graph below).

y = x + 5R² = 1

y‐axis

x‐axis

y‐axis vs. x‐axis

Page 6: Scientific Graphing Lab

Miscellaneous

To place more than one set of data on the same graph, add the second set of y data to column C, highlight all three columns and choose INSERT as before. To make the degree symbol when using temperature

For PC’s – hold down the ALT key and type 0186 using the number pad. For Macs – hold down the Option & Shift key and type 8

To enter data that is in scientific notation, use the letter “E” for “x10”. For example, 5.4 x 10-5 would be entered as 5.4E-5. For subscript text, such as the “2” in H2O, highlight the desired characters and simultaneously press: CONTROL + “=” For superscript text, such as the “3” in cm3, highlight the desired characters and simultaneously press: CONTROL + SHIFT + “=” To enter a carriage return in a text field, in order to get text on two lines, press: ALT + ENTER. (The enter key by itself navigates to the next field.)

Cells can either be individually referenced (B4), as a list (B4,C6,D8) or as a range of cells (B4:B23). A range of cells can be easily selected by simultaneously holding down and dragging the cursor across a range of cells.

Page 7: Scientific Graphing Lab

Experimental Procedure: In this experiment, you will be asked to make 4 graphs: two by hand and two using the computer program Excel. You will also explore Excel’s calculation and formula capabilities.

Part 1: Graphing By Hand Following the information on page 1, make the following graphs, using the graph paper attached. Graph 1: Using the following data, plot temperature vs. time on the provided graph paper

and draw a best fit straight line through the data. Be sure to include proper labels and use a ruler to draw lines.

Time, minutes Temperature, °C

1 23.4 2 24.6 3 25.8 4 26.3 5 27.4 6 29.3 7 30.2 8 31.1 9 32.9 10 34.2

Graph 2: Using the following data, plot A vs. wavelength on the provided graph paper and draw a smooth curve (not a straight line) through the data points. Once again, be sure to include all labels.

wavelength, nm A 300 0.100 350 0.150 400 0.300 450 0.754 500 0.648 550 0.432 600 0.333 650 0.432 700 0.655

Page 8: Scientific Graphing Lab

Part 2: Graphs Using Excel Be sure to follow the information given on pages 1-3 regarding graphing and especially those regarding the use of Excel to make the following plots. Graph 1: Using Excel, make a linear graph of the following data of density vs. percent

ethanol. Display the equation of the line and r-squared value, and appropriately label the axes and chart title.

% Ethanol Density (g/mL) 0.0 0.998 10.0 0.982 30.0 0.954 50.0 0.914 70.0 0.868 90.0 0.818 100.0 0.789 Graph 2: Using the following data, make a smooth curve plot of pH vs. volume. To make a

smooth curve plot, when choosing “scatter plot”, choose the one with the smooth curve through the data points. Appropriately label the axes and chart title.

Volume, mL pH

0 4.335 4.44

10 4.5115 4.6220 4.8825 6.1530 7.6535 9.1540 9.4545 9.5550 9.6555 9.7260 9.7865 9.8570 9.92

Page 9: Scientific Graphing Lab

Part 3: Spreadsheet And Formula Entry

1. Enter the following headers into top cells of 8 columns of the spreadsheet: Mass (g), Volume (mL), Density (g/mL), Ave Mass (g), % Dev Mass, Ave Density (g/mL), True Density (g/mL), % Error

2. Enter the following data into the first 2 columns, under the Mass and Volume headers:

Mass (g) Volume (mL) 3.2204 10.32

3.2041 10.30 3.2991 10.33 3.2000 10.27 3.2518 10.29

3 Use the entered data to perform calculations for density. Remember that: density = mass/volume Using the appropriate syntax for a spreadsheet formula (start the formula with “=”) that will use the data in the first 2 columns for this calculation, enter a formula in the first cell under the Density header. If the values for the first row of data, 3.2204 and 10.32 are in cells A2 and B2 respectively, the formula in cell C2 should be the expression “=A2/B2”, and the value displayed should be the results of the calculation.

4 Copy the density formula in cell C2 into the cells below it. This can be accomplished by

copying the density formula in the first cell and pasting it into the remaining cells below. Alternatively, select the first cell (C2), then drag the lower right-hand “+” sign in the cell down the column. This will apply the formula to the other relative mass and volume data there. Density values should now appear in all cells under the Density (g/mL) header.

5 Adjust the display format of the calculated cells to the correct number of significant

figures. (Increase/Decrease Decimal buttons) 6 In the first cell under the Ave Mass (g) header, enter a formula for determining the

average of the mass values. Alternatively, Excel contains the special function “Average” for this formula. An average value should now appear in the cell.

7 Perform a percent deviation analysis on the mass measurement data. Remember the

equation for percent deviation,

(experimental value – average value) x 100 % = % deviation (+ or -) average value

In the first cell directly under the %Dev Mass header, enter a spreadsheet formula for determining the percent deviation of the mass value on the same row, using the newly calculated average mass value in its permanent cell position. When using a permanent cell location in a formula (like the average value in this calculation), a “$” sign must be placed in front of the cell letter and cell number (e.g. $C$9 instead of C9). A percent

Page 10: Scientific Graphing Lab

deviation value should now appear in the cell. Check the spreadsheet’s value by performing the same calculation on your scientific calculator.

8 When the spreadsheet formula for the percent deviation calculation is correct in the first

cell, then select that cell and drag the lower right-hand “+” sign down the column to apply the formula to the other relative mass data in each row. Percent deviation values should appear in all cells under the % Dev Mass header now. If necessary, format the new values to the appropriate amount of sig figs.

9 To calculate an average density value in the cell under Ave Density (g/mL) header, enter a spreadsheet formula that is similar to the formula that was entered for the average mass in step 6. Check the spreadsheet calculation by performing the same calculation on your scientific calculator. If necessary, format the new value to the appropriate amount of sig figs.

10 Enter the following true density value in the cell under True Density (g/mL): 0.31779

11 Perform a percent error analysis on the average density value. Remember the equation for percent error:

(experimental value – true value) x 100 % = % error (+ or -) true value

In the first cell directly under the % Error header, enter a spreadsheet formula for determining the percent error of the average density value as compared to the above true density value. A percent error value should now appear in the cell. Check the spreadsheet’s value by performing the same calculation on your scientific calculator. Format the new value to the appropriate amount of sig figs.

12 The display should be similar to this, with appropriately rounded and formatted values for all X’s:

Mass (g) Volume (mL)

Density (g/mL)

Ave Mass (g)

%Dev Mass

Ave Density (g/mL)

True Density (g/mL)

%Error

3.2204 10.32 X X X X X X 3.2041 10.30 X X 3.2991 10.33 X X 3.2000 10.27 X X 3.2518 10.29 X X

Page 11: Scientific Graphing Lab

Part 4 – Scatter Graphs and Trendlines

1. Enter the following data into a new spreadsheet:

Concentration (M) Absorbance Unknown 1 Absorbance Unknown 1 Concentration (M) 0.000 0.000 0.550 0.100 0.324 0.150 0.488 0.200 0.650 0.250 0.796 0.300 0.944 0.400 1.256

2. Insert an XY Scatter chart (only dots, no line) with Concentration data as the horizontal (X)

axis and Absorbance data as the Series (Y) axis. Select the entire set of cells with numbers above to set the Data Range.

3. Format the chart to add minor gridlines on both axes. Label each axis and title the graph.

4. Add a linear trendline to the plot, which will give a line that is a “best fit” to the data. The trendline may be “forced” to include the (0,0) data point if desired. Then, format the trendline to display the R2 value and the equation of the line on the graph. The equation of the line represents the relationship between the concentration and absorbance values, and can be used to calculate any other values on lying on the line. The R2 value gives a numerical value to how well the data points “fit” on the line (with 1.000 being the best fit, when all data points are on the line).

5. The trendline equation represents the relationship between the concentration values and the absorbance values. This equation can now be utilized to calculate the unknown concentration of a solution when the solution’s absorbance is known. Select the cell under the “Unknown 1 Concentration” and enter a spreadsheet formula that will calculate the unknown’s concentration, using the trendline equation (rearranged) and the unknown’s absorbance data. Perform the same calculation on your calculator to check the spreadsheet value for accuracy. Re-format the displayed value if it does not display the appropriate amount of sig figs.

6. The display should be similar to this, with appropriately rounded and formatted value for X:

Concentration (M) Absorbance Unknown 1 Absorbance Unknown 1 Concentration (M) 0.000 0.000 0.550 X 0.100 0.324 0.150 0.488 0.200 0.650 0.250 0.796 0.300 0.944 0.400 1.256

Print and turn in the two graphs from Part 2, the displays of results of Excel generated calculations from Parts 2 & 3, and this chart.

Page 12: Scientific Graphing Lab

NAME _______________________________

Page 13: Scientific Graphing Lab

NAME _______________________________