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
 Origin Forum
 NLFit: Showing extra info in "Messages"
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cybernike

USA
6 Posts

Posted - 08/14/2012 :  12:25:47 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have two questions

1)Is there a way to show extra information in "Messages" tab in the NLFit dialog box? I'd like to output the derived parameters at each simplex iteration that I do.

2) Is there a way to output a number that is a function of a derived parameter(s), i.e., a derived parameter based on a derived parameter(s)?

Thanks.

cybernike

USA
6 Posts

Posted - 08/15/2012 :  12:50:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The answers to my questions may be limited by the limitations in the NLFit dialog box..but do you think what I am trying to ask is possible through Labtalk scripting?

Another question about Labtalk: I have tried to look through the Labtalk documentation, but I couldn't find how one uses it to impose constraints in a fit.

Any pointer is much appreciated.
Go to Top of Page

Echo_Chu

China
Posts

Posted - 08/15/2012 :  04:57:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Steve,

I am afraid that we can not update the nlfit dialog to show derived parameter there.

However, we can get it via Labtalk, please look at the sample code as below


nlbegin iy:=(1,2) func:=gauss nltree:=nlt; //Fit data stored in the first two column of active worksheet with function Gauss
for (ii=1; ii<=400; ii++)
{
	nlfit 1;
	nlt.FWHM =; //FWHM is the derived parameter in the Gauss function
	if (nlt.fitstatus==100) //Exit if fit is converged
		break;
}
nlend;


Go to Top of Page

Echo_Chu

China
Posts

Posted - 08/15/2012 :  05:30:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can use labtalk script as below to enable the constrains during fit


nlbegin iy:=(1,2) func:=gauss nltree:=nlt;
nlt.constraints = 1;
nlt.constr$ = "A<900";
nlfit;
nlend 1 1;


For more info to run Non-linear fitting in LabTalk, you can find the general introduction in this page. And there are more examples in the nlbegin page
Go to Top of Page

cybernike

USA
6 Posts

Posted - 08/15/2012 :  09:40:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Echo, that helps!

I don't think there are any examples for imposing constraints on the wiki, right? (I couldn't search the keyword "constr$".)

How would one impose more than one constraint?

If I do
nlt.constr$ = "A<900"; nlt.constr$ = "B<80";
will both constraints be imposed? or the second one will override the first one?

Would a "generalized" linear constraint work? For instance, "A<B";

Thanks!

Edited by - cybernike on 08/15/2012 09:49:26 AM
Go to Top of Page

Echo_Chu

China
Posts

Posted - 08/15/2012 :  10:22:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If there is more than one constraint, you can define them in a line. It is the same as the Constraint in our NLFit dialog. Such as the code below


nlbegin iy:=(1,2) func:=gauss nltree:=nlt;
nlt.constraints = 1;
nlt.constr$ = "A<900 ; w<10 ";
nlfit;
nlend 1 1;


General linear constraint such as "xc<y0" is allowed. Nonlinear constraints such as "w^2>A" are not allowed. You can also learn the details from the hints in our NLfit dialog
Go to Top of Page

cybernike

USA
6 Posts

Posted - 08/15/2012 :  11:30:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I'm almost there...so this might be the last question..

I use "nlbegin" to start with XY data.

I use "nlbeginz" to start with XYZ data.

but how to start with an XYZW data set? I have three X, Y, Z independent variables and one dependent variable W.

Thanks!
Go to Top of Page

cybernike

USA
6 Posts

Posted - 08/16/2012 :  01:53:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I think I found it:
It is something like:
nlbeginr (1,2,3,4) func:=fctname nltree:=tr;

Thanks..

I will now have to look for how to do the following:
1) Do only one iteration of the fitting procedure
2) Calculate the functional values, with the current parameters at this step, at the data points.

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