Experiment 0
Computing and Graphing

Exp0 - Plotting Data on a PC

Introduction

 In Physics 191 we use the computer to acquire data from instruments via interface cards and associated software. In addition, we will make extensive use of Kaleidagraph [Kgraph], a software package for graphing and data analysis. Kgraph is a substantial program but is nonetheless intuitive and extremely easy to use. Three major needs that Kgraph will address for us are:

1. Making high quality graphs of your data.

2. Algebraic manipulation of numbers, equivalent to a powerful calculator;

3. Curve fitting, i.e., finding the parameters of a theoretical function that best describe your data.

Projects in the first Laboratory Period

 In the first lab [Experiment 0], we will learn how to use Kgraph on a PC equipped with the Windows 98 operating system. Your lab report will document the steps that you have followed to carry out the following exercises. It will contain printouts of the graphs that you generate. Since most of the ensuing labs will require Kgraph for plotting and analyzing data, this lab report will also serve as your guide for remembering how to do some basic operations.

Navigating Kgraph

Reading some selected Kgraph documentation will make completing the Exercises easier:

1.Start by reading the Kgraph Quick Start.pdf on your desktop. You don't have to perform the tutorial steps, but it will help you get a feel for what's in each menu. You can search the file with the binoculars button.

2. You will also find Kgraph's Help system useful; it is arranged by menus, with some further detail on the Plot Tools, and on Formulas and Curve Fitting. The >> spins you through successive menu entries. You can also use Help/Search.

3. In general, you can modify an existing graph by clicking on objects to bring up a menu for that object.

4. For exercise 3, see Help/Functions/Bin Data (this is a useful compact notation to record your procedures). Another method of varying the binning can be found in Format/Histogram Options and by clicking on the axis to change minimum and maximum x axis values.

5. For exercise 4b, you'll need the value of the fit at each data point. Our version of Kgraph does not have Curve_Fit/View/Copy Curve Fit described in Quick Start. However, it's still quite easy. Suppose you want the polynomial fit value in column 5, and your (x,y) were in columns (1,2). Use Windows/Formula then enter c5 = poly(c1,c2) and hit Run. For further help, see Help/Formula/Curve Fit Functions and Help/Formula/Syntax.


Exercises

1. Make a folder on your PC with the name c:\phy191\secn\exp0. Replace n with the number of your section, e.g., c:\phy191\sec1\exp0. Data from each week’s lab will be kept in a different, consecutively numbered folder.

2 a) Make a Scatter Plot of (x,y) data points in c:\phy191\samples\data1. Do NOT save your results in the samples directory. Make the size of the data points to be 16 point. (Under Plot/Plot Style, change the "marker size" to 16.)  Label the axes of the graph with names and units, e.g., Velocity (m/s) and Temperature (K). Explain your procedures and results at each step, of each exercise.

2 b) Convert the column 1 data, given in SI units, m/s, to ft/hr. Convert the data, given in Kelvins (K) to degrees Celsius. Label the axes of the graph with names and units, e.g., Velocity (ft/hr) and Temperature (degrees Celsius). Print a table with original and converted data.

2 c) Give each plot a title; include your name, section, experiment, and date in the upper right hand corner of the graph. Make sure that the graph labels, legends, etc. do not overwrite any significant part of the graph. Save both plots and print them on the laserjet printer. Note: To make the plot print correctly, you may have to make sure the graphics setup of the printer is chosen to print "raster graphics" rather than "vector graphics". You can ask your instructor for help if you are confused with these instructions.

3. Make a vertical bar (column) plot, and stack histogram plot of the file c:\phy191\samples\data2. In a histogram, data points are grouped into bins, with the number of points in each bin represented by the height of the stack or line. Experiment with the effect of changing the bin size. Do this for at least two different bin sizes. Try menu items Functions/Bin Data and /Statistics. Print the table and the two graphs. Explain the graphs.

4a) Create a least squares fit to data1. Least squares minimizes the sum of the square of the error ("residual") between the original data and the values predicted by an equation believed to describe the data. Apply a linear and a fifth order polynomial function to the data for V vs. T. Print the graphs with the fit parameters included as labels on the figure. You may need to make two plots in order to show both fits.

4b) Residuals are defined as the difference: residual = fit - data, at each data point. Plot one set of residuals vs. T on another graph.

4c) Make a stack histogram plot of the residuals. Use "Statistics" to examine the residuals.

4d) Print out the table which contains the original data and the residuals. Make sure the columns of the table are labeled.

5. When you exit Kaleidagraph, select "None" in the dialogue box when you are asked whether you want to save changes. If  you don't, you risk messing up the setup for another student. If for any reason, you need to log in to windows, use the username "msu" and password "msu". Any other choice may prevent printing from your computer.
 

Reading and problems: (1 point per problem)
1. Read chapters 1, 2, and sections 3.1-3.5 of Taylor.

2. Do problems: 2.4, 2.6, 3.2, 3.12, 3.16