Python:Fitting
Jump to navigation
Jump to search
This document contains examples of polynomial fitting, general linear regression, and nonlinear regression. In each section, there will be example code that may come in useful for later courses. The example code is based on the existence of a file in the same directory called Cantilever.dat
that contains two columns of data - the first is an amount of mass (in kg) placed at the end of a beam and the second is a displacement, measured in inches, at the end of the beam. For EGR 103, this file is:
0.000000 0.005211
0.113510002 0.158707
0.227279999 0.31399
0.340790009 0.474619
0.455809998 0.636769
0.569320007 0.77989
0.683630005 0.936634
0.797140015 0.999986