File Exchange > DataAnalysis >    Piecewise Fit

Author:
OriginLab Technical Support
Date Added:
9/7/2016
Downloads (90 Days):
314
Last Update:
6/8/2017
Total Ratings:
0
File Size:
75 KB
Average Rating:
File Name:
Piecewise Fit.opx
File Version:
1.2
Minimum Versions:
2017
License:
Free
Summary:

Fit two or three segments of a data plot with same or different fitting function.

Screen Shot and Video:
Description:

  • Purpose
    This app can be used to perform piecewise fit on data plotted in the graph.
    Features include:
    1. Two or three segments of the data
    2. Use different fitting functions, or same function, for each segment
    3. Option to fix or vary the X value of the segment intersection points
    4. Use built-in or user-defined fitting functions
    5. Output fit parameters and statistics for each segment
       
  • Installation
    Download the file Piecewise Fit.opx, and then drag-and-drop onto the Origin workspace. An icon will appear in the Apps Gallery window.
     
  • Operation
    1. Select graph with a 2D scatter or line plot.
    2. Click the icon in the Apps Gallery window.
    3. In the pop up dialog, specify number of segments.
    4. Change or fix the X value of intersection points as needed.
    5. Choose a function for each segment, or assign same function to all segments.
    6. Change the max number of iterations and tolerance as needed.
    7. Select the desired output parameters and statistics.
    8. Click the Parameters button to provide initial parameters for user-defined functions.
    9. Click then 1 Iter. button to execute 1 iteration.
    10. Click the Fit button to perform interactions until the tolerance is reached, or the maximum number of iterations is reached.
       
  • Dialog Settings
    • Number of Segments: Specify 2 or 3 segments to split the plot data.
    • X Value at Intersection of Two Segments: Specify the X value at the intersection of two segments. You can optionally fix these values.
    • Use Same Function for All Segments: If checked, the same fitting function will be used for all segments. If unchecked, you can assign different fitting functions to each segment. 
    • Function for # Segments: Specify the function for the corresponding segment.
      • Use Exiting Function: If checked, you can select a built-in fitting function or a previously created user-defined function. If unchecked, you can type in a new equation.
      • Category: Fitting function's category.
      • Function: Fitting function name.
      • Equation: The fitting function's equation.
      • Offset Parameter: If existing function is used, this is a dropbox for selecting a particular parameter as the offset parameter. If you type in a new fitting function, this control will be a text box, and you should specify a particular parameter as the offset parameter.
      • y(x) - offset: If you are defining a new function, enter the function expression here. Note that, the offset is specified in Offset Parameter text box, so the offset should not be included in your expression. If your function has no offset, just provide one parameter, and then you can assign 0 as initial value and fix the value. For example, the if function you want to define is y(x)=A+B*x, then A is Offset Parameter, and B*x is the part to be assigned to the y(x) - offset control.
    • Max Number of Iterations: Specify the maximum number of iterations to be performed.
    • Tolerance: Specify the tolerance for the fitting.
    • Quantities: Please refer to Quantities to Compute.
    • Parameters Button: This button will open a dialog for setting parameter initial values.
    • 1 Iter. Button: This button will perform 1 iteration of fitting.
    • Fit Button: This button will carry out the iteration until the tolerance is reached, or the number of iterations has reached.

Updates:

v1.1: Improved speed, and prompt dialog for fitting failed when clicking 1 Iter. button
v1.2: Fixed bugs for error checking

Reviews and Comments:

Be the first to review this File Exchange submission.