PH 393

Name

Solution

Non-Linear Curve Fitting Exercises

 

For each exercise below you are to provide the MATLAB m-files, a clean copy from the command window showing the answers properly labeled as comments at the end of the m-file.  Clean copy means have the command window only show the answers asked for.  Please remove all excess spaces, blank lines, etc. Where asked produce full page plots with appropriate titles, axis labels, etc.

 

On my classes website http://physics.nmu.edu/~ddonovan/classes.html in the PH 393 section there is a link Data for Linear and Non-linear Curve Fitting Exercises.  This will provide you with a zip file that contains data files to be used for these two sets of homework related to curve fitting.  Download this file and extract the files to a folder in your MATLAB path so that you can load and use the data files.  They are all two column data files in which the first column is the x data and the second is the f(x) or y data.

 

You are to fill in this document and when it is completed, print it out and turn in with MATALB interspersed appropriately. (i.e. after problem 1 put the MATLAB work that belongs to problem 1, after problem 2, put the MATALAB work that belongs to problem 2 etc.)  Your name should also be printed and not hand written.

 

For each of the data files you are to complete the following steps:

 

a) Plot the raw data as a line on its own page.

 

b) Use this plot to determine rough “starting guesses” for the parameters, you may draw in pencil on this plot to show how you arrived at the “starting guesses”.

 

c) Find the parameters that provide “a reasonably good fit to the data”.  If the fitted line does not look anything like the data, it is not “a reasonably good fit.”  There are possible values of the parameters that provide very good fits.  Do not quit with very bad fits.  There will be little if any partial credit in such cases.

 

If the program stops with a number of iterations exceeded message, you should start with the final parameters as your new starting guesses and see if you can get better convergence.

 

You should try varying you final parameters some and see if you converge to a different set of parameters that might provide an even better fit.  Do not settle for the first set of parameters you find. 

 

 

d) Complete the table providing the final parameters which provide a “good fit”, the sum of squares error (ss) and the sum of squares per data point (ssdp).

 

e) Produce a plot showing the raw data and the fitted curve.  You should produce a legend which places the data from the table onto the plot in a place that obscures the data and the plot as little as possible.

 

 

Back To Dr. Donovan's Courses Page

 

Back To Dr. Donovan's Homepage

 

Physics Dept. Homepage

 

NMU Homepage

 

Please send any comments or questions about this page to ddonovan@nmu.edu

This page last updated on October 16, 2015