Nonlinear Least Squares Curve Fitting
Unlike for linear regression, there are no analytical expressions to obtain the set of regression coefficients for a fitting function that is nonlinear in its coefficients. To perform nonlinear regression, we must essentially use trialanderror to find the set of coefficients that minimize the sum of squares of differences between _ycaic and _yobsd. For data such as in Figure 141, we could proceed in the following manner: using reasonable guesses for k\ and k2, calculate [B] at each time data point, then calculate the sum of squares of residuals, SSresiiuais = S([B]ca]c  [B]expt)2. Our goal is to minimize this errorsquare sum.
We could do this in a true "trialanderror" fashion, attempting to guess at a better set of k\ and k2 values, then repeating the calculation process to get a new (and hopefully smaller) value for the Residuals Or we could attempt to be more systematic. Starting with our initial guesses for k\ and k2, we could create a twodimensional array of starting values that bracket our guesses, as in Figure 142. (The initial guesses for k\ and k2 were 0.30 and 0.80, respectively and the array of starting values are 70%, 80%, 90%, 100%, 110%, 120% and 130% of the respective initial estimates.) Then, for each set of k\ and k2 values, we calculate the "SiSresiduais The k\ and k\ values with the smallest errorsquare sum {k\ = 0.27,
Time
Figure 141. A typical plot of the concentration of species B for a system of two consecutive firstorder reactions (the reaction scheme A>B>C)
Time
Figure 141. A typical plot of the concentration of species B for a system of two consecutive firstorder reactions (the reaction scheme A>B>C)
k\ = 0.64 in Figure 142) become the new initial estimates and the process is repeated, using smaller bracketing values. Years ago this procedure, called "pitmapping," was performed on early digital computers.
In essence we are mapping out the error surface, in a sort of topographic way, searching for the minimum. A typical error surface is shown in Figure 143 (the logarithm of the Residuals has been plotted to make the minimum in the surface more obvious in the chart).
0.2t 
Trial values of k, 0.24 0,27 0.30 0,33 
0.36 0.39  
0.56 > 0.88 ¡E 096 
1.5E11 2.0E11 
6.SE12 S.SE12 6.7E12 7.2E13 
1.1E11 1 .OE12 
2.1E11 6.4E12 
3.5E11 1.6E11 
5.3E11 2.9E11  
3.4E11 
1 7E11 
7.8E12 
4.6E12 
6.3E12 
1,2E11 
2.1E11  
5.2E11 
3.3E11 
2.1E11 
1.6E11 
1.5E11 
1.8E11 2.4E11  
7.2E11 
5.2E11 
3.9E11 
3.1E11 2.8E11 
2.9E11 3 3E11  
9.3E11 
7.2E11 
5.7E11 
4.8E11 4.4E11 
4.3E11 4.5E11  
1.04 
1.1E10 
9.2E11 
7.7E11 
6.7E11 6.1E11 
5.9E11 6.0E11 
Figure 142. The errorsquare sums for an array of initial estimates. The minimum Residuals value is in bold.
Figure 142. The errorsquare sums for an array of initial estimates. The minimum Residuals value is in bold.
A more efficient process, the method of steepest descent, starts with a single set of initial estimate values (a point on the error surface), determines the direction of downward curvature of the surface, and progresses down the surface in that direction until the minimum is reached (a modern implementation of this method is called the MarquardtLevenberg algorithm). Fortunately, Excel provides a tool, the Solver, that can be used to perform this kind of minimization and thus makes nonlinear leastsquares curve fitting a simple task.
Responses

pandora7 years ago
 Reply

Layton Murphy7 years ago
 Reply

carlos armstrong7 years ago
 Reply

ethan6 years ago
 Reply

vanna1 year ago
 Reply