The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Lorentzian FIT with bounds
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

touch41

16 Posts

Posted - 04/05/2012 :  07:24:27 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi everyone!

I want to fit several Lorentzian peaks using script, and I'd like to set some boundaries on such fits in order to have the procedure more reliable.
In particular it would be important to set the area>0.

Some peaks are single so I fit them using these commands:

nlbegin iy:= range func:=Lorentz nltree:=myt;
nlfit 200;

Others are double so I prefer to fit them using:

fitpeaks iy:=range2 type:=lorentz npeaks:=2;


I've found this commands on the internet for fixing bounds:
nltree.ubn --> Upper Bounds Value
nltree.lbn --> Lower Bounds Value

but no examples on how to use these commands...any clue?

What about fixing boundaries with the fitpeaks command?

Thank you very much!:-)

Touch




Origin Ver.8.5 and Service Release 1
Operating System: Win 7 64bit

Kathy_Wang

China
159 Posts

Posted - 04/09/2012 :  05:48:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,
The nltree.ubn and nltree.lbn commands could be used after you start a non-linear fit with nlbegin/nlbeginr command. An example of how to use it is as following:

nlbegin iy:=<active> func:=Lorentz nltree:=myt;
//Set the boundary of area (Area>0)
myt.lb4 = 0;
nlfit;


And the fitpeaks command doesn't support to set boundary values. But to set boundary values for multiple peak fitting, you may also use "nlbegin" command, and set the replica value as peak numbers minus one. Here is an example with multiple peak fit (suppose there are 3 peaks):

nlbegin iy:=<active> func:=Lorentz nltree:=myt replica := 2;
//You may check the sequence of parameters by opening the NLFit parameter dialog
nlpara;
//After setting parameters, you could start the fitting.
nlfit;


Hope this will be helpful!


Kathy
Originlab
Go to Top of Page

Kathy_Wang

China
159 Posts

Posted - 04/09/2012 :  9:17:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sorry, the example script I provided was not quite right. In fact, when you are setting boundary conditions in non-linear fit with script, you also need to turn the boundaries on (as their default settings are disabled). Here is a better example,

nlbegin iy:=<active> func:=Lorentz nltree:=myt;
myt.lb4 = 0; 
myt.lbon4 = 1;//here the newly set myt.lb4 value is enabled
nlfit;



Kathy
Originlab
Go to Top of Page

touch41

16 Posts

Posted - 04/25/2012 :  09:18:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I will try!
Thank you for your answer!:-)

Matteo
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000