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
 Global fitting from script
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kfauth

Germany
33 Posts

Posted - 12/02/2015 :  02:53:38 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

we have been using nlsf fitting from script frequently with success, but this time I am stuck... When doing this manually, it works fine but from script, I can't get it to do what it should.

I use a simple user-defined function with 7 parameters as follows
y=p0+p1*(x-x0)+p2*(x-x0)*(x-x0)+A*fitsheet_lc(f*(x-sh));

So, essentially I am fitting a dataset by another one, allowing for some background (parameters p0,p1,p2), displacement (sh) and ordinate stretch (f).

Within a loop, the model dataset fitsheet_lc is modified in a specified way (linear combination of other datasets), and after each modification, I want to look for the height of a specific peak in comparison to a reference, which is the dataset I am doing the fit on. To do this, I need to specify two ranges, say rows [60:100] ("baseline range") and [159:164] ("peak range"), on which the fit is to be done simultaneously, i.e. with shared parameters.

I therefore intialize the fit with the following code (%M AND %O being well-defined):

nlbegin iy:=[FitForUps]1!1"Iso"[60:100,159:164] func:=%M nltree:=nlt theme:=%O mode:=global pn:=both option:=init_all;

and specify all parameters to be shared:

nlt.s1=1; ... nlt.s7=1; [this btw. is different than what the docs say...or what I understand them to say]

Nevertheless, separate fits on the two specified ranges are being carried out (in each of them, all parameters are marked with an asterix, indicating the "shared" setting), as is easily seen from the fit protocol. I am not getting a "global fit".

I think I need some help. Thanks.


Origin Ver. and Service Release (Select Help-->About Origin): Pro 2015G (64 bit)
Operating System: Win7 (64bit)
  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