15.3.4.4.3 The Name and Type Page

The Name and Type page allows you to set the category, function name, function model and function type. The left panel of this page offers hints and examples for each of the function types.

Dialog Box Controls

Select a Category Select an existing category in which to put the newly created function. This control is unavailable when you choose Edit a User-defined function on the Goal page. To make user-defined peak functions and baseline functions available in Peak Analyzer, you must select PFW category for peak function or Baseline category for baseline fitting function. Or later use Tools: Fitting Function Organizer to move or share your function under PFW or Baseline categories.
New Click this button Ffb new category.png to bring up a dialog with which you can create a new category. This control is unavailable when you choose Edit a User-defined function on the Goal page.
Function Name Input a name for the function. This control is unavailable when you choose Edit a User-defined function on the Goal page.
File Name(.FDF) For each newly created function, Origin will create an associated .FDF in the \FitFunc folder of your Origin User Files Folder. This read-only edit box just shows the name of the fitting function file.
Description Add descriptions for the function.
Function Model Specify the function model. Options include:
  • Explicit
    The function formula can be defined explicitly as y=f(x).
  • Implicit
    The function formula cannot be defined explicitly, which is expressed as f(x,y)=estimate, where estimate is 0 and expressed as f in Origin.
Function Type Specify how to use the function in the Function Body page. Options include:
  • Expression
    Select this option for simple fitting functions that have only one dependent variable. The function body is limited to one expression, and you need to provide only the right hand side of the equation. This option provides faster performance than Origin C. The following example demonstrates this kind of function body.
    a + b * exp( -x^c / d )
  • Equations
    Select this option if you need multiple lines or you have more than one dependent variable. This option does not support control structures such as loops or if-else statements. You can however use the ternary operator. This option provides faster performance than Origin C. The following example demonstrates this kind of function body.
    temp = 10;
    y1 = A + exp( (x1 - xc) / temp^2 );
    y2 = A + temp / (x2 - xc)^2;
  • Origin C
    This option is slower than Equations. Select this option if your fitting function requires loops or control structures that cannot be replaced by the ternary operator. Note that you need to follow strict C syntax: parameters are case sensitive, and division by an integer is different than division by a double. The following example demonstrates this kind of function body.
    if ( x < -PI )
    y = y0 + exp( -x-a*PI );
    else if ( x > PI )
    y = y0 + exp( x-a*PI );
    else
    y = cos(x);
  • LabTalk Script
    This option is much slower than Equations or Origin C. Select this option if you need control structures or you are not familiar with C language. The following example demonstrates this kind of function body.
    range rr = %C;
    int b = %(rr[P1]$);
    y = b + a*x;
  • External DLL-based Function
    Select this option to define a fitting function using an external DLL. Using an external DLL can improve fitting time significantly. For more details about this type, please refer to Using External DLLs.


Include Integration During Fitting

Select this option to define an integrand and include it in the fitting function. This is only available when Function Type is Expression, Equations or LabTalk Script. The function model can be Explicit or Implicit.