OriginPro
 
Loading...
Searching...
No Matches
originpro.analysis.NLFit Class Reference

Public Member Functions

def __init__ (self, func, method='auto')
 
def __del__ (self)
 
def set_data (self, wks, x, y, yerr='', xerr='', z='')
 
def set_mdata (self, ms, z)
 
def set_range (self, rg)
 
def fix_param (self, p, val)
 
def set_param (self, p, val)
 
def param_box (self)
 
def fit (self, iter='')
 
def result (self)
 
def report (self, autoupdate=False)
 

Public Attributes

 func
 

Detailed Description

class for performing Non-Linear Curve Fitting with Origin's internal fitting engine
The name of the fitting function already defined inside Origin must be provided to use this class

Member Function Documentation

◆ fit()

def originpro.analysis.NLFit.fit (   self,
  iter = '' 
)
iterate the fitting engine

Parameters:
    iter (str or int): empty will iterate until converge, otherwise to specify the number of iterations

◆ fix_param()

def originpro.analysis.NLFit.fix_param (   self,
  p,
  val 
)
fix a parameter to a value or to turn off the fixing

Parameters:
    p(str): name of a parameter
    val(bool or float or int): use False to turn of parameter fixing, or specify a value to fix it to
Examples:
    model.fix_param('y0', 0)
    model.fix_param('xc', False)

◆ param_box()

def originpro.analysis.NLFit.param_box (   self)
open a modal dialog box to control fitting parameters and iterations.
You can click the minimize button on the parameters dialog to manipulate the graph like zooming in, or use
screen reader etc. Must still call fit() after.
Examples:
    model = op.NLFit('Gauss')
    model.set_data(wks, 0, 1)
    model.param_box()
    model.fit()
    rr=model.result()

◆ report()

def originpro.analysis.NLFit.report (   self,
  autoupdate = False 
)
you need to end the fitting by either calling result or report
Parameters:
    autoupdate(bool): setup recalculation on the report or not

Returns:
    (tuple): range strings of the report sheet and the fitted curves

Example:
    model.fit()
    r, c = model.report()
    Report=op.find_sheet('w', r)
    Curves=op.find_sheet('w', c)
    print(Report)
    print(Curves.shape)

◆ result()

def originpro.analysis.NLFit.result (   self)
you need to end the fitting by either calling result or report. If you need both, you need to call report first.

Return:
    (dict) fitting parameters and statistics from the fit

◆ set_data()

def originpro.analysis.NLFit.set_data (   self,
  wks,
  x,
  y,
  yerr = '',
  xerr = '',
  z = '' 
)
set the XY data with optional error bar column, or XYZ data

◆ set_mdata()

def originpro.analysis.NLFit.set_mdata (   self,
  ms,
  z 
)
set the Matrix data

◆ set_param()

def originpro.analysis.NLFit.set_param (   self,
  p,
  val 
)
set a parameter value before fitting

Examples:
    model.set_param('xc', 0.5)

◆ set_range()

def originpro.analysis.NLFit.set_range (   self,
  rg 
)
set data as range string

The documentation for this class was generated from the following file: