1) Will it be possible to create an initialization script to initialize the parameters and the constraints?It is possible to create an initialization script to initialize your parameters. (This script is not necessary for your constraints as you will see later in this response.) The complexity of the script depends on your initial values. If they are to remain the same for every Lorentzian fit you perform now and in the future, all you really have to do is the following:
- Select Scripts:Initialization in the fitter.
- Select the Enabled check box.
- Enter the initial fitting values for each replica in the Initialization Scripts text box. For instance, if I have defined 1 replica (i.e. a 2 peak fit), the initializations might look like this (with comments so it is easy to understand):
**** Begin Initialization Scripts ****
y0=1; // initialize the baseline to 1
// Peak 1 //
xc1=7; // initialize the 1st peak center to 7
w1=2; // initialize the 1st width at half max to 2
a1=100; // initialize the area under peak 1 to 100
// Peak 2 //
xc2=17; // initialize the 2nd peak center to 17
w2=2; // initialize the 2nd width at half max to 2
a2=200; // initialize the area under peak 1 to 200
***** End Initialization Scripts *****
Furthermore, it is possible to impose constraints on this type of fit by utilizing the Upper and Lower bounds text boxes or the General Linear Constraints text box in the Parameter Constraints dialog box. To get to this dialog box, select Options and then Constraints from the fitter menus. To learn how to impose constraints, take a look at the help file by pressing F1 while the Parameter Constraints dialog box is open. Please keep in mind that you should define the number of replicas first before entering this dialog box.
One final note with regard to question 1:
I have entered a suggestion in our database which requests the ability to initialize replica parameters in the Initializations dialog box (without requiring the use of an initializations script). I have included your name in the suggestion in order to increase its priority.
2)Could it possible to save the modified lorentz fitting procedure under a different name without losing the standard lorentz mulipeak fitting?
This is not possible since the Lorentz function is a built-in function. However, you could create a user-defined function which is identical to your modified Lorentzian function. If you do decide to do this, keep in mind that user-defined functions are unable to handle replicas. Therefore you would have to manually define the modified Lorentzian to handle each individual peak. For instance, if your dataset had two peaks, the fitting function might look like the following:
y = y0 + (2*AA1/pi)*(ww1/(4*(x-xcc1)^2+ww1^2) + (2*AA2/pi)*(ww2/(4*(x-xcc2)^2+ww2^2)
where I have altered the parameter names a bit since it is best to avoid using parameter names which are already used by Origin.
I should warn you that a 12 peak fit will produce a very long fitting function. Since I am not sure which version of Origin you have, I recommend that you define the actual function in an Origin Script file (*.OGS) and call the *.OGS file from the fitting function. If you are not sure how to do this, I suggest you utilize our Knowledge Base to learn more. The Knowledge Base can be accessed by selecting the Tech Support link on the homepage. Once you have located the Knowledge Base search page, enter the word "ogs" as your Keyword (minus the quotes). Leave all other search fields as they are and press the Enter key on your keyboard. The search should yield three or four hits. Of particular interest to you are the links that say:
- Fitting datasets with long functions, and
- Working with long user-defined fitting functions
I hope that this information proves helpful.
Sincerely,
Ryan Toomey
[This message has been edited by rtoomey (edited 04-14-2000).]