Example 1.  Fit the curve  [Graphics:Images/NonLinearCurveFitMod_gr_18.gif]  to the data points  [Graphics:Images/NonLinearCurveFitMod_gr_19.gif].  

Solution 1.

Enter the point into a two dimensional array xys which stores points in the xy-plane.  

[Graphics:../Images/NonLinearCurveFitMod_gr_20.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_21.gif]

Look at the transpose of this "list of lists."

[Graphics:../Images/NonLinearCurveFitMod_gr_22.gif]
[Graphics:../Images/NonLinearCurveFitMod_gr_23.gif]

The two portions of this data structure are separated by  breaking off the first and second parts of the "list of lists"  [Graphics:../Images/NonLinearCurveFitMod_gr_24.gif]  and  [Graphics:../Images/NonLinearCurveFitMod_gr_25.gif].  

[Graphics:../Images/NonLinearCurveFitMod_gr_26.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_27.gif]
[Graphics:../Images/NonLinearCurveFitMod_gr_28.gif]

We want to use the same abscissas, and take the logarithm of the ordinates.  Notice that Mathematica uses  Log[x]  for the natural logarithm  ln(x)  this is because Mathematica has programmed the notation used in "Complex Variables" i.e. the terminology  Log[x]  is used in advanced mathematics and works both with real and complex numbers.
Caution.  None of the abscissas should be 0 because Log[0] is not defined, and all the abscissas "should" be positive, unless you are willing to "cope" with computations that might involve complex numbers.

[Graphics:../Images/NonLinearCurveFitMod_gr_29.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_30.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_31.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_32.gif]
[Graphics:../Images/NonLinearCurveFitMod_gr_33.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_34.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_35.gif]

Now "glue together" the transformed parts to form the pairs  [Graphics:../Images/NonLinearCurveFitMod_gr_36.gif]  and store them in the two dimensional array XYs which stores points in the XY-plane.  

[Graphics:../Images/NonLinearCurveFitMod_gr_37.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_38.gif]

Now use the Mathematica procedure  Fit  to get the least squares line in the XY-plane.  

[Graphics:../Images/NonLinearCurveFitMod_gr_39.gif]


[Graphics:../Images/NonLinearCurveFitMod_gr_40.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_41.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_42.gif]

Now plot the "least squares line"  [Graphics:../Images/NonLinearCurveFitMod_gr_43.gif]  in the XY-plane.

[Graphics:../Images/NonLinearCurveFitMod_gr_44.gif]


[Graphics:../Images/NonLinearCurveFitMod_gr_45.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_46.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_47.gif]

To get back to the xy-plane 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:

[Graphics:../Images/NonLinearCurveFitMod_gr_48.gif]
[Graphics:../Images/NonLinearCurveFitMod_gr_49.gif]

So the coefficients  A  is located at [Graphics:../Images/NonLinearCurveFitMod_gr_50.gif] and  B  is located at [Graphics:../Images/NonLinearCurveFitMod_gr_51.gif].  

[Graphics:../Images/NonLinearCurveFitMod_gr_52.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_53.gif]
[Graphics:../Images/NonLinearCurveFitMod_gr_54.gif]

Now we are in business, we use  [Graphics:../Images/NonLinearCurveFitMod_gr_55.gif]  and  [Graphics:../Images/NonLinearCurveFitMod_gr_56.gif]  to get the coefficients of  [Graphics:../Images/NonLinearCurveFitMod_gr_57.gif]  back in the original  xy-plane.

[Graphics:../Images/NonLinearCurveFitMod_gr_58.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_59.gif]
[Graphics:../Images/NonLinearCurveFitMod_gr_60.gif]
[Graphics:../Images/NonLinearCurveFitMod_gr_61.gif]
[Graphics:../Images/NonLinearCurveFitMod_gr_62.gif]
[Graphics:../Images/NonLinearCurveFitMod_gr_63.gif]
[Graphics:../Images/NonLinearCurveFitMod_gr_64.gif]

Now graph the function  [Graphics:../Images/NonLinearCurveFitMod_gr_65.gif]  in the xy-plane.

[Graphics:../Images/NonLinearCurveFitMod_gr_66.gif]


[Graphics:../Images/NonLinearCurveFitMod_gr_67.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_68.gif]

[Graphics:../Images/NonLinearCurveFitMod_gr_69.gif]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004