Sie sind auf Seite 1von 7

Math 132L Introductory Lab 1 Spring 2003 Objectives

The purpose of this lab is to get familiar with the software LoggerPro. In future labs, you will be using the software together with the hardware LabPro and various sensors to collect data. You will then be asked to analyze the data using the software and your knowledge of calculus. Today, you will use data that has already been collected. In this lab session, you will Learn to perform simple data analysis with LoggerPro Graph data sets Fit linear and exponential regression models to data sets Perform an approximate integration based on data Print your results

Materials
Power Macintosh or Windows PC Vernier computer interface You should also have a separate Lab Report sheet. The results of your work will be recorded there and handed in. Your lab report is due on the same weekday as your lab, one week later, by 4:30 p.m. in the Mathematics Office (Cupples I, room 100). These instructions will guide you through the first lab. There is a lot of detail since the software is new to you. As you become more familiar with LoggerPro, less hand-holding should be needed.

Procedure
Use the icon on the Desktop to start LoggerPro. At the end of your session, you will be asked whether to Save Changes to .... For this lab, answer No

1) Linear Regression
Opening a file that contains some previously collected data. Select Open from the File menu. In the window that pops up, open the folder Lab1TuTh or Lab1MW (depending on your lab day) and select the file Lab1 Problem1. You should see a Graph Window with five points and a Table Window listing the x- and y-coordinates of the points.

Look at the bars on the tops of the windows. Click on the Graph Window. This window is now the active one. This means that the selections in the menus will be applied to this window. You can tell which window is active by the bar on the top of the window. If it is dark blue, then it is active. With the Graph Window active, click on the Examine button (the one with :x=? on it), or select Examine from the Analyze menu). A floating box containing a point and "y:" will appear in the upper left-hand corner of the graph window. Now move the cursor around in the graph window. As you move along the graph, the coordinates of the point highlighted by the black line should appear in the small box. To stop using this tool, click on the 'x' in the upper right-hand corner of the small box.

Print the table and the graph containing the data points (See Lab Report, Problem 1A) (The printer icon on the toolbar will print the whole window. Insert the team members names on the graph! This is important because many graphs will be going to the same printer and, in the future, they will not all be identicalyou need to be able to identify which is yours.. In the Comment box, mention the Lab Number and Problem Number. If at some later time you want to print only a graph or only a table, you can click to make the graph (table) the active window and then use File, Print from the pulldown menus.

You are going to try to find the line that best fits these five points.

On the graph you printed, sketch in a line that you think might fit best. (See Lab Report, Problem 1a) From the graph, estimate the coordinates of two points on your line (See Lab Report, Problem 1b) Using those points, compute the slope m and y-intercept b for your line. Write the equation of your line in the form y=mx+b. (See Lab Report, Problem 1c)

Graph your line using LoggerPro. To do this, we need a column of new ycoordinates to use with the old x-coordinates. Well name the column of new ycoordinates Guess 1. Select New Column, Formula from the Data menu. The New Column window will appear. Under the Options tab, in the Labels section, type Guess 1 for Long Name, g1 for Short Name and (#) for Units. Click the Definition tab. In the equation box, enter m*x+b, using

your values for m and b. (You can insert x from the Variables scrolling list, or type it directlybut dont forget the marks. Advantages of using the scrolling list of variables are i) that you can see the names of the variables that are defined and available, and ii) the marks are automatically inserted.)

Click Try New Column. If the line looks like the one you drew, click OK. (You may need to click on the small left/right arrows under the graph to move left/right.) If not, check your calculation of the slope and y-intercept. If these look correct, check that you entered the equation correctly. Ask for help if necessary.

Look at the Table Window. The x-values are not shown anymore. To display all columns in the Table Window

Double-click on a blank cell in the table (or, with the Table window active, select Data Table Options from the View menu). Click on the Table Layout tab in the Table Options window that appears. Click in the circle before All Columns All Runs. Click Apply and then OK.

When you look at the Graph Window, you will notice that the original data points are not shown anymore. To make them visible

Double-click on an empty spot in the Graph Window (or select Graph Options from the View menu, making sure the Graph Window is active). Click on the Axis Options tab in the Graph Options window that appears. Select y from the list of variables to graph on the y-axis by clicking in the box in front of it so that there is a checkmark in the box. There should also be a checkmark in the box in front of Guess 1. Click OK. Print the graph showing the data points and your line (See Lab Report, Problem 1d )

See how well your line fits the data points by calculating the sum of the squared deviations (SSD) using LoggerPro. (See the handout from class for the meaning of sum of the squared deviations.) Calculate each of the squared deviations by creating a new column using the formula (y-Guess 1)^2. Select New Column, Formula from the Data menu. The New Column window will appear.

Under the Options tab, in the Labels section, type Sq. Dev. Guess 1 for Long Name, SD Guess1 for Short Name and (#) for Units.

Click the Definition tab. In the Equation box, enter (y-Guess 1)^2. (You can type this in directlydont omit the marksor use the drop down menu for Variables. The drop down menu informs your that you should use Guess 1 rather than the short name g1 in the formula.)

The click New Column, OK. A new column should appear in the Table Window. On the graph you printed, indicate by hand the meaning of the deviation y-Guess 1 using, say, the middle one of the 5 data points. (See Lab Report, Problem 1d )

To calculate the sum of the squared deviations, you can add up the values of the SD Guess 1 column by hand or using LoggerPro as follows Select New Column, Formula from the Data menu. The New Column window will appear. Under the Options tab, in the Labels section, type Sum Sq. Dev. Guess 1 for Long Name, SSDg1 for Short Name and (#) for Units. Then click the Definition tab.

In the Equation box, enter sum("Sq. Dev Guess 1") as follows: select sum() from the Functions list and then select "Sq. Dev Guess 1" from the Variables list. Click on New Column, then OK.

The last entry in the SSD column is the sum of all of the squared deviations for your line. (See Lab Report, Problem 1e )

Find the regression line, i.e. the line with the smallest possible SSD. (See the handout distributed in class about the meaning of regression line.) Click the Automatic Curve Fit button (the next-to-last button on the right on the toolbar.) In the window that appears, click on the Curve Fit tab. Select mx+b Linear from the list of functions.

Select y latest as the variable to Perform Fit On. (If y latest doesnt appear on the list, you need to double click on the graph and Use Graph Options, Axis Options again: be sure the y box is checked on the list of variable to be graphed on the y-axis.) Check the Create Column box. Click Try Fit and then OK. Record the equation of the regression line on the homework sheet.

(See Lab Report, Problem 1f )

Compute SSD for the regression line, this time in a simpler series of steps.

Select New Column, Formula from the Data menu. The New Column window will appear. Under the Options tab, in the Labels section, type Sum Sq. Dev. LinReg for Long Name, SSD LinReg for Short Name and (#) for Units. Then click the Definition tab. In the Equation box, enter sum( (y-CurveFit)^2 ) . (You can type in the formula directlyremember the signsor use the Functions list and the Variables list. Click Try New Column and then click OK. The last entry in the SSD column is the sum of all of the squared deviations for the regression line. (See Lab Report, Problem 1g )

In terms of least squares, is your line or the regression line a better fit for the data? Record the equation of the regression line on the homework sheet. (See Lab Report, Problem 1h )

2) Exponential Curve Fit and Numerical Integration


Close the graph window and table window containing the data for Problem 1. Then open the folder Lab1TuTh or Lab1MW (depending on your lab day) and select the file Lab1Problem 2. You should see a graph window with the label Temperature vs. Time and a Table Window with two columns, Time and Temperature. This data was collected with a temperature probe. The probe was heated to around 50 degrees Celsius and then the temperature of the cooling probe was recorded every 15 seconds for five minutes. The Temp Diff data that you see is the difference of the recorded temperature and the average room temperature during the experiment.

Look at the shape of the data. (See Lab Report, Problem 2a ) Does the data appear to be linear? Is it increasing or decreasing?

There is reason to believe that the data can be modeled by an exponential curve, i.e. one of the form y=A*e^( - C*x)

Use LoggerPro to fit an exponential curve to the data.

Click on the Automatic Curve Fit button (next to last button at right of toolbar)

Choose A*exp( -C*x) + B Natural Exponential function from the scrolling list under the y= box, enter 0 in the box for B Value, and check to box to create a new column of data. Select the variable to Perform Fit On, Temp Diff Latest. Click the Try Fit button to perform the fit, followed by OK.

Expand the table to include all three columns (Time, Temp Diff, and Curve Fit) Print out the graph and table of data. The printout should include LoggerPros box indicating the values of A,B,C in our exponential model (See Lab Report, Problem 2b )

The real data is sampled from the real temperature function T(t) (unknown to us). Over a time interval t=a to t=b, LoggerPro can i) use an approximate integration method to estimate the integral of T(t) (as

we have done in class with left, right, and midpoint approximations given in a table), data. ii) approximate the integral of the exponential function which we fitted to the

(Of course, since the exponential function was created as an approximation to the temperature function T(t), one would hope that i) and ii) produce similar values.)

Use LoggerPro to (approximately) integrate T(t) and your exponential curve over the time interval t=0 to t=2.0 minutes.

Click on the left side of the graph (on the line Time=0). While holding the mouse button down, drag the cursor to the right until Time=2.0. The highlighted data in the table should include Time=0 to Time=2.0. Now click the Integral button, or select Integral from the Analyze menu. Be sure that the boxes Temp Diff and Curve Fit on the drop down menu are checked). LoggerPro will automatically integrate the exponential curve fit and also T(t) (using Temp Diff data). Two floating boxes will appear with LoggerPros estimates of the integrals (area under the curves) as displayed on the graph. (One of the boxes may be on top of the other; you may need to slide the top one one off.) Record the values of the integrals. (Notice the units on the integration results. Are they what you expected? (See Lab Report, Problem 2c )

Finally (See Lab Report, Problem 2d ) and complete the work required there.

Das könnte Ihnen auch gefallen