Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Nonlinear Least Squares Curve Fitting http://www.colby.edu/chemistry/PChem/scripts/ls...

N onlinear L east S quares C urve F itting


Help
Input data pairs:
0 13.2
258 10.1
561 7.5
1144 5.1
1830 2
2360 1.1
3540 -1

Fit function: a exp(-bx) + c

Parameter guesses:
a = 55

b = .001

c = -4.9    Fixed

Convergence Mode: Fast     Damped     Strongly Damped

Fit Fit & Plot Reset

Results:
Fitting Function: a exp(-bx) + c
initial a= 55
initial b= 0.001
initial c= -4.9
with Convergence Damping
________ Input Data (Fit values from inital guesses)________
x y y(fit) residual
0.0 13.2 50.1 -36.9
258.0 10.1 37.59274 -27.49274
561.0 7.5 26.4851 -18.9851
1144.0 5.1 12.61983 -7.51983
1830.0 2.0 3.92275 -1.92275
2360.0 1.1 0.29311 0.80689
3540.0 -1.0 -3.30427 2.30427
5340.0 -1.6 -4.63623 3.03623
14.7
====================== Results =========================
a= 14.813 +- 0.454

12.5

10.0

1 of 2 1/1/70, 5:08 AM
Nonlinear Least Squares Curve Fitting http://www.colby.edu/chemistry/PChem/scripts/ls...

The x-y pairs should be input one pair per line with the x value (the independent
variable) first. The x and y values can be separated by spaces, a tab, or a
comma. You can copy and paste from Excel.
Examples of the uses of the fit functions.
You need to input rough guesses for the fit parameters. Sometimes just guessing
"1" for each parameter will work.
For fitting functions with a "c" parameter, you can choose to fix the value. This
option allows you to use "c" as a parameter without varying the value during
least squares adjustment.
If the calculation doesn't converge,
1. Try using convergence damping.
2. In cases of slow convergence, enter the results from the previous non-
converged run as guesses for the next run.
3. Use the "Fit values from initial guesses" output to refine your guesses. In
other words, vary your input guesses to decrease the initial residuals.
Leave the guess for any unused parameter blank.
To print the plot, pull down the File menu and select Page Setup... Set the Print
Background Colors and Images checkbox.
For fitting a user input function see John Pezzullo's Nonlinear Least Squares
Curve Fitter.

Colby College Chemistry, T. W. Shattuck, 8/28/2015

2 of 2 1/1/70, 5:08 AM

You might also like