OriginLab Corporation - Data Analysis and Graphing Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis                           
 

3.12 FAQ-236 How to use the parameter values in the Script After Fitting

Last Update: 2/3/2015

Use the getnlr x-function.

You need to use getnlr to get both the Parameters and Statistics results into a tree. For example, after performing a gaussian fit, and with the FitNL1 worksheet active, you can run the following (from either the Script Window or the Command Window):

getnlr tFitResults;
tFitResults.=;

You'll see the following output:

Data1
 +---Name = Amplitude
 +---x1 = [Gaussian]Gaussian!Channel
 +---y1 = [Gaussian]Gaussian!Amplitude
 \---wmethod1 = No Weighting
y0 = 5.3419788692313
e_y0 = 0.58340545321781
n_y0 = y0
xc = 24.906897224202
e_xc = 0.08666139607299
n_xc = xc
w = 10.169692020721
e_w = 0.2045243560476
n_w = w
A = 984.90203637016
e_A = 21.450750179376
n_A = A
sigma = 5.0848460103603
ndp_sigma = sigma
FWHM = 11.973897311092
ndp_FWHM = FWHM
Height = 77.272559200605
ndp_Height = Height
chisqr = 7.8157217446868
dof = 46.
pts = 50.
ssr = 359.52320025559
adjr = 0.98898685090753
fitstatus = 100
func = Gauss
nfuncparams = 4.
nderivparams = 3.
nsets = 1.

To access any of these values in Script After Fitting code, saved with the fitting function and set to run after the fit is performed, you need to first create a tree object which will have the values loaded and then you can access them.

For example:

getnlr tr:=tFitResults iw:=__Report$ showall:=0 pnotation:=0;
type -a;  //output to the Script Window
type chisqr $(tFitResults.chisqr);
type status $(tFitResults.fitstatus);
type y0    $(tFitResults.y0);
type FWHM  $(tFitResults.FWHM);

where __Report$ is an Origin string variable that holds the name of the last Analysis Report sheet created.

To see a list of all string variables that contain names of sheets created by analysis, go to script window and type

list vs;

Keywords:final, nonlinear, non-linear, fit, NLFit, LabTalk

 

© OriginLab Corporation. All rights reserved.