T O P I C R E V I E W |
Smriti Prakash Suman |
Posted - 01/03/2019 : 08:46:57 AM I am trying to fit my data with multiple 'Voigt Fits'.
To override the 'Auto Parameter Initialization' for (only) one of the parameters xc_1, I proceed as follows:
1. Define a function Epr() that returns the desired value for initializing xc_1.
2. Call the function and assign the value to xc_1, in Peak Fit Parameters -> Fit Control -> (Enable Constraints) Constraints box, as follows:
xc_1=Epr();
3. Run the fit.
---------------------------------------------------------------- //The function Epr() double Epr() { Worksheet x("[Book1]Parameters"); set_active_layer(x); double dd= x.Cell(0, 2); //printf("dd=", dd); out_double("dd=", dd); return dd; }
-----------------------------------------------------
[I have attached the relevant screenshots along.]
However, this results in an error: "(1) (2) Error in constraints - Please check syntax such as parameter names and operators."
This could be due to the fact that only linear constraints are allowed (though not explicitly mentioned in the "Peak Analyzer" dialog box, unlike in the "NLFit" dialogue box).
I am not very sure how to tweak the "Auto Parameter Initialization" code itself without affecting the other parameters (which I do want to be auto-initialized as in the original code).
I am new to programming in Origin. Any inputs would be helpful.
https://my.originlab.com/ftp/forum_and_kbase/Images/SPS_Voigt.pdf
Smriti Prakash Suman |
1 L A T E S T R E P L I E S (Newest First) |
yuki_wu |
Posted - 01/04/2019 : 03:36:07 AM Hi,
Yes, the Constraints box is used to specified linear contraints for the fit parameters. The syntax for the specifying constraints should follow: https://www.originlab.com/doc/Origin-Help/FitPara-General-Linear-Constraint
If you want to use the parameter initialization code, I think you could press F9 to open Fitting Function Organizer: 1. Click to select Voigt function of PFW category in the left panel 2. Click the button next to Parameter Initialization box to open Code Builder 3. Edit the code 4. Return to Fitting Function Organizer and save the edited function by clicking Save button in the right panel
We have a similar example and you could have a look: https://www.originlab.com/doc/Tutorials/Fitting-with-Background#Auto_Parameter_Initialization
Regards, Yuki
OriginLab
|
|
|