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 - sheet name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

dominik.mierzwa

Poland
116 Posts

Posted - 03/04/2021 :  09:07:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Origin 2021
Operating System: W10 Pro

Hi,
Is it possible to automatically name the NLFit sheets (reports and curves) with the function name?

Is it possible to collect particular sheets' names and put them into for example col A as a string?

Kind regards,
Dominik

一击爆裂陈子豪

Taiwan
41 Posts

Posted - 03/04/2021 :  09:37:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Mm.... for now, no & no. You'll need a customized script to do those.
What kind of info you want to collect in 2), btw?
Go to Top of Page

dominik.mierzwa

Poland
116 Posts

Posted - 03/04/2021 :  11:28:51 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by 一击爆裂陈子豪
What kind of info you want to collect in 2), btw?



I would like to get a list of sheets from the current workbook. It is a kind of report sheet. I usually use several functions with NLFit and finally I need to collect all data (eg. model parameters wit SE, adj. R-sqr., red. chi-sqr. fit status etc.) in one sheet. Currently, I manually write down the function name used in Col(A) and paste requested data as a link from NLFit report sheets. I also use the lookup function to get some data from NLFit sheets, thus I need the sheet name in col(A). I thought that it could be convenient to automatically rename the sheet with the function name and collect info about used functions in one column.


Kind regards,
Dominik

Edited by - dominik.mierzwa on 03/04/2021 11:31:30 AM
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 03/04/2021 :  12:47:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If you don't rename these result sheets, their names are NLFit1, NLFit2 etc, and all the details of the fitting can be obtained using X-Function getresults.

I put together the following LT code as a starting point

StringArray aa;
//loop all sheets in project
doc -e LB {
	if(exist(%H,2)==0) //not a workbook, must be a matrix
		continue;
	string str=wks.Name$;
	//"FitNL1", "FitNL2" etc
	if(str.GetLength() == 6) {
		string strN=str.Left(5)$;
		if(strN.compareNoCase("FitNL")==0) {
			//type "[%H]%(str$)";
			getresults tr:=Tr1 iw:=[%H]%(str$)!;
			string strFunc$=Tr1.Notes.Model$;
			//strFunc$=;
			aa.Add(strFunc$);
		}
	}
}
newbook;
aa.CopyTo(Col(A));



CP
Go to Top of Page

dominik.mierzwa

Poland
116 Posts

Posted - 03/05/2021 :  02:39:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by cpyang

If you don't rename these result sheets, their names are NLFit1, NLFit2 etc, and all the details of the fitting can be obtained using X-Function getresults.
...



Before I check the code, I'd like to ask it is possible to improve it with a part that will change the generic name "NLFitX" with a function name after pass?

Kind regards,
Dominik
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 03/05/2021 :  04:36:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The code showed a generalized solution for your version of Origin, but you would rather that we make a change for future version to customize the report sheet name, correct?

If that is what you would suggest, then sure, we can look into it how, since other users may want that sheet name to be customized on like some parameter from the data. It is certainly a good idea to have some general way to customize the name of an output, and like everything else, the question is how. Maybe we can use origin.ini?

CP
Go to Top of Page

dominik.mierzwa

Poland
116 Posts

Posted - 03/05/2021 :  07:40:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
In my opinion, it could be useful to have a possibility to control the name of NLFit report sheet. It Could be also useful to generate a summary from multiple NLFit reports: parameters, SE, red. chi-sqr., adj. r-sqr, fit status. I usually use multiple functions during approximation and Have to collect all data in one table (for publishing purpose).
BTW if I use the Rank model app it changes the sheet name to a model name...

Kind regards,
Dominik

Edited by - dominik.mierzwa on 03/05/2021 07:47:56 AM
Go to Top of Page

easwar

USA
1964 Posts

Posted - 03/05/2021 :  09:07:18 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Dominik,

So you are fitting one dataset with multiple functions and want to summarize, correct?
The built-in Rank Models App lets you start from scratch and select functions and create a summary table.

But we also have another App we published recently:
https://www.originlab.com/fileExchange/details.aspx?fid=584
This App starts with fit sheets that already exists and then summarizes and ranks the results.

Seems to me, one of these Apps should work for you? And if either App needs improvements, we can consider that of course. Can you provide details on what should be improved?

Easwar
OriginLab
Go to Top of Page

dominik.mierzwa

Poland
116 Posts

Posted - 03/05/2021 :  09:18:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by easwar
So you are fitting one dataset with multiple functions and want to summarize, correct?



Correct.

quote:
Originally posted by easwar
The built-in Rank Models App lets you start from scratch and select functions and create a summary table.



Yes. And this is a good tool for fast fitting. Unfortunately, it fails when the fit fails. Usually, I prefer to fit data on my own and control the fitting options (weighting, tolerance etc.).

quote:
Originally posted by easwar
But we also have another App we published recently:
https://www.originlab.com/fileExchange/details.aspx?fid=584
This App starts with fit sheets that already exists and then summarizes and ranks the results.



I did not know about this app.

quote:
Originally posted by easwar
Can you provide details on what should be improved?

Easwar
OriginLab



Yes, I will try this app and report possible improvements.

Kind regards,
Dominik
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