
Developed by Eric Ayars - Published August 1, 2016
DOI: 10.1119/PICUP.Exercise.curvefit
Being able to fit a model to experimental data is an extremely important laboratory skill. Most physics students are familiar with linear curve fitting, often with a spreadsheet or data-collection software such as Data Studio (PASCO Scientific) or Logger Pro (Vernier Software).
This set of exercises takes students beyond these introductory tools into the realm of arbitrary-function curve fitting, with error bars and estimates of parameter uncertainties.
Subject Areas | Experimental / Labs and Mathematical / Numerical Methods |
---|---|
Level | Beyond the First Year |
Available Implementation | Python |
Available Variation |
Non Linear Curve Fitting |
Learning Objectives |
Students who complete this module will gain experience in
|
Time to Complete | 90 min |
These exercises are not tied to a specific programming language. Example implementations are provided under the Code tab, but the Exercises can be implemented in whatever platform you wish to use (e.g., Excel, Python, MATLAB, etc.).
Exercise 1: Linear fit
The data set “calibration.txt” shows the reported position of a rotational sensor (in units of 11024 of a rotation) after N revolutions. If the rotational sensor is properly calibrated, this should be a horizontal line at 0, but it’s not.
- By how much per revolution is the sensor miscalibrated? Plot a graph of the data, with a linear curve fit, to answer. Be sure to include errorbars on the graph, and report the uncertainty in your fit parameters.
Exercise 2: Power fit
Students in a first-semester physics course collected this data showing the angular velocity of a rotating “point mass” m and the force Fc required to keep the mass rotating in a circle of radius R. If you plot this data, it looks linear (except for that one point at (0,0)) but for theoretical reasons we believe that the equation for centripetal force should be
Fc=mRω2- Does this data fit the model for Fc? Plot a graph to support your answer.
- Statistically, the errorbars should intersect the curve fit for about 63% of the data points: Are your errorbars reasonable?
- The rotating mass had m=200 grams, and the radius of rotation was R=18 cm. Is this consistent with parameters from your curve fit?
Exercise 3: Exponential fit
Barium 137 is radioactive. Activity of a sample of Barium 137 was measured as a function of time, and the results are shown in file ‘decay.txt’. We would expect that for radioactive decay,
N=Noe−t/τwhere τ=t1/2ln(2).
- Find the half-life t1/2 for Barium 137. Support your answer with a graph and a curve fit, of course!
Exercise 4: Challenge!
The data in file damped_oscillation.txt is shows the position of a magnetic rotor in a fixed magnetic field. One model for the behavior of this rotor would be “exponentially-damped oscillation”,
θ=θoe−βtcos(ωt+ϕ)+φFind the resonant frequency ω and the damping constant β for this apparatus. You may assume the uncertainty in position is negligible.
Hint: Your initial guesses need to be in the right ballpark!
Download Options
Share a Variation
Credits and Licensing
Eric Ayars, "Curve Fitting," Published in the PICUP Collection, August 2016, https://doi.org/10.1119/PICUP.Exercise.curvefit.
DOI: 10.1119/PICUP.Exercise.curvefit
The instructor materials are ©2016 Eric Ayars.
The exercises are released under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 license
