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
 Forum for Origin C
 sweeping parameters in NLSF?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

boogerhead

Reunion
2 Posts

Posted - 03/31/2006 :  7:30:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

easwar

USA
1965 Posts

Posted - 03/31/2006 :  9:56:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

boogerhead

Reunion
2 Posts

Posted - 04/01/2006 :  8:37:44 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks much for the info and quick reply. Looks like it should be straight-forward.

-Brian
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