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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Global fitting from script

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
kfauth Posted - 12/02/2015 : 02:53:38 AM
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)

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000