Example 2. Fit the
curve
to
the data points
.
Solution 2.
Enter the point into a two dimensional array xys which stores points in the xy-plane.
Look at the transpose of this "list of lists."
The two portions of this data structure are separated
by breaking off the first and second parts of the "list of
lists"
and
.
We want to use the logarithm of the abscissas and the logarithm of the ordinates.
Now "glue together" the transformed parts to form the
pairs
and
store them in the two dimensional array XYs which stores
points in the XY-plane.
Now use the Mathematica procedure Fit to get the least squares line in the XY-plane. Then we shall graph this line in the transformed XY-plane.
Now plot the "least squares line"
in
the XY-plane.
![[Graphics:../Images/NonLinearCurveFitMod_gr_114.gif]](../Images/NonLinearCurveFitMod_gr_114.gif)
To get back to xy space we could copy the coefficients from g or we could go looking inside Mathematica to see where they are kept. The data structure of g looks like:
So the coefficients A is located at
and B is located at
.
Now we are in business, we use
and
a = A to get the coefficients of back
in the original xy-plane.![]()
Now graph the function
in
the xy-plane.
![[Graphics:../Images/NonLinearCurveFitMod_gr_135.gif]](../Images/NonLinearCurveFitMod_gr_135.gif)
(c) John H. Mathews 2004