The nonlinear curve fitting (NLFit) tool includes more than 200 built-in fitting functions, selected from a wide range of categories and disciplines. If the function you are seeking for is not included, you can always define your own function using Origin's flexible Fitting Function Builder.

Origin permits you to pre-select input data from a worksheet or directly from a graph before opening NLFit dialog. Once you opened the NLFit dialog, you can also change, add, remove or reset the data from the Input Data Branch in Data Selection page under Settings tab.
You can select data from one or more worksheet columns, parts of worksheet columns or even non-contiguous portions of worksheet columns. Hold Ctrl key when you want to make non-contiguous selection.
When a graph window is active, the active curve in the active layer will be pre-selected as input for fitting.
Following options are available for other data pre-selection cases:
Origin built-in fitting functions includes automatic parameter initialization code that adjusts initial parameter values to your dataset(s), prior to fitting.
With just a few clicks, you can perform curve fitting and obtain "best-fit" parameter values. You can opt to have the best fit curve pasted to your original data plot:

|
In order to facilitate users to do some typical nonlinear fitting tasks with NLFit tool, Origin provides many quick menu entrances under the main menu Analysis: Fitting:
Select Analysis: Fitting: Nonlinear Implicit Curve Fit menu to open the NLFit tool with the function category Implicit selected. You can check this example to see how to do a quick implicit fit.
Select Analysis: Fitting: Nonlinear Surface Fit menu to open the NLFit tool with the function category Surface selected. You cam check this tutorial to learn how to do a surface fit quickly.
Select Analysis: Fitting: Exponential Fit menu to open the NLFit tool with the function category Exponential selected. You can check this example to see how to do a quick exponential fit.
Select Analysis: Fitting: Single Peak Fit menu to open the NLFit tool with the function category Peak Functions selected. You can check this example to see how to do a quick peak fit with one peak function.
Select Analysis: Fitting: Sigmoidal Fit menu to open the NLFit tool with the function category selected. You can check this example to see how to do a quick sigmoidal fit.
Can't find a suitable fitting function in our built-in function library? No problem. Our Tools: Fitting Function Builder can guide you step-by-step to define custom fitting functions easily.
Do you have multiple datasets that you would like to fit simultaneously? With Origin, you can fit each dataset separately and output results in separate reports or in a consolidated report. Alternately, you can perform global fitting with shared parameters; or perform a concatenated fit which combines replicate data into a single dataset prior to fitting.

Parameters in the fitting function can optionally be shared amongst all datasets.

To learn more about global fit, see Global Fitting with Parameter Sharing page |
For replicate data, you can choose to concatenate all data points into one curve and fit them as a whole dataset.

To learn more about concatenate fit, see Fitting Replicate Data page |
You can choose to fit multiple curves independently. The independent fitting of multiple curves can be performed one by one to create Separate Report for each curve or simultaneously to generate a Consolidated Report.

Need to fine-tune your curve-fitting analysis? With Origin, you have full control over the curve-fitting process.



Go to this table to learn how to write linear constraints. |
In addition to the basic fitting options, you also have access to extended options for more advanced fitting.
Step 1. Choose Orthogonal Distance Regression iteration algorithm.

Step 2. Choose appropriate weighting methods.




To learn more about finding Y from X or finding X from Y, see Finding Y/X from X/Y Standard Curves page |

Read this tutorial to know how to define an implicit fitting function.
Want to know what kind of integration function can be fitted and how to define your own fitting function?

Here
is the integral independent variable while
indicates the fitting independent variable. The model parameters
,
,
, and
are fitted parameters we want to obtain from the sample data.
Read this tutorial for details.

where a and b are parameters in the fitting function.
Initial parameters are: a=1e-4, b=1e-4. Note that the integral function contains a peak whose center is about a and width is 2b. And the peak's width (2e-4) is very narrow compared with the integral interval [0,1]. To make sure it is integrated correctly at the neighborhood of the peak center, the integral interval [0,1] is divided into three segments: [0,a-5*b], [a-5*b,a+5*b], [a+5*b,1]. It is integrated in each segment, and then the three integrals are summed up.
Read this tutorial for details.

There are four parameters in the fitting function, and we need to pass three of them into the integrand, and use the independent variable as upper limit, to do integration. So you should define the integrand first, and then use the built-in integral() function to perform integration inside your fitting function body.
Read this tutorial for details.
Origin inherently provides two commonly used convolution functions in Convolution category:
If you need to create a new convolution function, it would be necessary to read through the tutorial below.


where
,
.And
,
,
, s,
,
and
are fitting parameters.
,
,
,
and
are constants in the fitting function.
Read this tutorial for more details.

This experiment assumes that the output signal was the convolution of an exponential decay function with a Gaussian response as shown below:

Now that we already have the output signal and response data, we can get the exponential decay function by fitting the signal with the below model:

Read this tutorial for details.
If you need to deconvolute a peak, please refer to this Quick Help.
Origin inherently provides two commonly used piecewise functions in Piecewise category:
If you need to create a new piecewise function, it would be necessary to read through the tutorials below:
From the above graph, the curve consists of two segments of lines. It can be fitted with a piecewise linear function. The function can be expressed as:

where x1 and x2 are x values of the curve's endpoints and they are fixed during fitting, x3 is the x value at the intersection of two segments, and y1, y2, y3 are y values at
respectively.
Read this tutorial to learn more details.
From the above graph, the curve consists of exponential curve segment and straight line segment as defined by equation below:

Read this tutorial to learn more details.
Origin inherently provides three commonly used multiple variables functions in Multiple Variables category:
If you need to create a new multiple variables function, it would be necessary to read through the tutorials below:
Fitting function for above graph is a combination of the Gaussian and Lorentz functions, sharing y0 and xc:


Read this tutorial to learn more details.

where x1, x2 are independent variables and ki, km, vm are fitting parameters.
Read this tutorial to learn more details.
To fit a complex function in Origin, you need to separate the real and imaginary part of complex data into two different columns as two dependent variables.
Below is an example to show how to define your complex function:
complex cc = A/(1+1i*omega*tau); y1 = cc.m_re; y2 = cc.m_im;
where 1i is used as imaginary unit "i", omega is independent variable, A, tau are fitting parameters, y1 and y2 are the real and imaginary part of cc.
Origin allows you to define a first order or higher ordinary differential equation (ODE) by calling NAG functions.
Below is an example to show how to fit a first order ordinary differential equation:


where a is a parameter in the ordinary differential equation and y0 is the initial value for the ODE. NAG functions d02pvc and d02pcc are called using the Runge–Kutta method to solve the ODE problem.
Read this tutorial to learn more details.
Origin C functions can make calls to functions in external DLLs created by C, C++, or Fortran compilers. To do this, your source file must contain an include directive for the header file which declares the functions in your external DLL.
Below is an example to show how to use GSL function from GNU Scientific Library to fit the following model:

Read this tutorial to learn more details.
If you want to know more about calling third party DLL functions, please refer to this page.
Origin allows you to quote built-in function in defining a new fitting function.
Below is an example to show how to fit a skewed Gaussian peak, which can be considered as composed of two Gaussian functions. These two Gaussian curves share the same baseline and peak center (xc), but differ in peak width (w) and amplitude (A).
The function body is defined as:
y = x<xc? nlf_Gauss(x, y0, xc, w1, A1) : nlf_Gauss(x, y0, xc, w2, A2);
where nlf_Gauss() is the built-in Gauss function.
Read this tutorial to learn more details.