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
 Forum for Origin C
 sweeping parameters in NLSF?

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
boogerhead Posted - 03/31/2006 : 7:30:00 PM
Origin Version (Select Help-->About Origin): 7.5SR6
Operating System: XP

Greetings. We're doing some rather complex nls fitting. Right now we're doing it all interactively, using a monster custom function written in Origin C. There are 43 fitting paramters (lots of datasets here). What I'd like to be able to do is automatically "sweep" the intial guesses for some of the paramters - e.g., vary the init guess for parameter 1 from x to y with some reasonable step size, run the fit for each guess, then record the guess with lowest chi2.

Since we're at ~40 seconds/iteration on a P4-3.2, I'd like to automate this as much as possible.

My programming experience with Origin is limited -- but from what I can tell, this *could* be done (easily?) with labtalk, but not Origin C? For silly reasons I would prefer to work with Origin C, but I'll do what I have to...

Thanks,

-Brian
2   L A T E S T    R E P L I E S    (Newest First)
boogerhead Posted - 04/01/2006 : 8:37:44 PM
Thanks much for the info and quick reply. Looks like it should be straight-forward.

-Brian
easwar Posted - 03/31/2006 : 9:56:07 PM
Hi Brian,

The curve fitter can be programmatically accessed and controlled using the LabTalk NLSF object. This object has many methods and properties such as setting fitting function, fit dataset, assinging parameter values, performing iterations etc.

So the nlsf object can be programmatically accessed in a loop where you vary say one parameter from a start to an end value, and inside the loop perform the fit and record the chi-sq.

Please see this post that shows an example of such a loop using script:
http://www.originlab.com/forum/topic.asp?TOPIC_ID=4708

Then see this page and the programming example Curve Fitting with Error Bars, under Data analysis, to see how to access the NLSF object from Origin C. Essentially you point to the LabTalk NLSF object and simply use its methods and properties:
http://www.originlab.com/index.aspx?s=9&lm=71&pid=268

You can find details on all methods and properties of the NLSF object under the LabTalk Language Reference section of the Programming help file (menu: Help->Programming, then look under LabTalk Lang. Ref and then under Command Reference and Alphabetic Listing and look for NLSF).

Hope this helps.

Easwar
OriginLab



Edited by - easwar on 03/31/2006 9:58:44 PM

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