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
 Subrange not work in nlfit
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tantiger

Singapore
41 Posts

Posted - 04/25/2022 :  11:08:40 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2021b (64-bit) SR2 9.8.5.212 (Academic)
Operating System: Windows 11 Home

Hi,

I am trying to use LabTalk to do a non-linear fitting (3 peaks with Lorentz fitting). If I don't specify range, the script can give results as expected:

nlbegin iy:=(1,2) func:=lorentz replica:=2 nltree:=ParamTree;
ParamTree.xc = 351;
ParamTree.xc__2 = 356;
ParamTree.xc__3 = 417.5;
nlfit;
...

However, if I add the range, then the script just does not work as the cod value of fitting is 0.

nlbegin iy:=(1,2)[99:161] func:=lorentz replica:=2 nltree:=ParamTree;
ParamTree.xc = 351;
ParamTree.xc__2 = 356;
ParamTree.xc__3 = 417.5;
nlfit;
...

Need some help here. Thanks :D


Edited by - tantiger on 04/25/2022 11:18:36 PM

tantiger

Singapore
41 Posts

Posted - 04/26/2022 :  10:06:48 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
OK, I tried other ranges and found some work some cannot.

For example, I set the range to [99:171] then I can get fitting results.

Also tried on other datasets I have, some work with [99:161].
Go to Top of Page

YimingChen

1665 Posts

Posted - 04/27/2022 :  3:25:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Have you tried running the fit on the same range in the NLFit dialog? can it succeed? Thanks.

James
Go to Top of Page

tantiger

Singapore
41 Posts

Posted - 04/28/2022 :  10:03:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes, and that's why I would like to use labtalk to ease the work. But strangely, the same range won't work in labtalk.
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