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
 How to fix initial parameters for all cirumstance
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

imoada

31 Posts

Posted - 04/03/2016 :  08:07:05 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin 2016 64it b9.3.226 Demo
Operating System: win7 sp1 ultimate 64bit

Hello everyone

Is there a way to make fitting automatically start with fixed specified initial parameters, even if the fitting is a continued fitting (several iterations have been performed). I know, according to origin help files, if the fitting is not a new fitting and the data is modified in worksheet, "recalculate" button on tools bar can only make the fitting go on with parameters obtained from the former fitting process (called in-process parameters), instead of the specified initial parameters set for the new fitting. That is my purpose, how to make the continued fitting automatically start with specified initial parameters instead of in-process parameters?

Thanks

Hua

snowli

USA
1379 Posts

Posted - 04/04/2016 :  10:08:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Of course you can set some of your parameters to be fixed. If you have already done the fit, there should be green lock in result sheet.
You can left click on it and choose Change Parameters. Go to Parameters tab to check some parameters to be fixed. And set the fix value.

Click OK to close the dialog. Now if you have new input data, the fitting will update but those parameters you set as fixed will not change.

When starting from scratch, you can also set some parameters to be fixed the same way.

When define your own fitting functions, you can also set some parameters to be fixed or define some constants.

Thanks, Snow
Go to Top of Page

imoada

31 Posts

Posted - 04/07/2016 :  11:54:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, Snow.

Sorry for my puzzling question. Let me give an example: Fitting formula is user-defined. "Recalculate mode" is set to "Auto". Use data1 to make a fitting with initial parameter P0 (which set in fitting dialog box). Fitting results will give a result of parameter P1 (which showed in fitting dialog box). Then modify the data1 and Origin will use the modified data1 to make a second fitting automatically. At this time, We know P1 instead of P0 will be automatically set as the initial parameter for the second fitting by Origin. That's my question, how to make Origin use P0 instead of P1 as initial parameter to run the second fitting automatically. If I modify data1 again, the Origin can still use P0 as initial parameter for the third fitting, and so on. May we use script in Fitting Function Organizer to realize it?

Thanks

Hua
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 04/07/2016 :  3:05:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hua,

When you run NLFit first time, before finishing the tool, you can press the triangle button for the Dialog
Theme at the top of the tool, you can choose "Theme Setting" flyout, and turn ON the "Parameter Values",
and again press the triangle button, and save the dialog theme.

Now, at the second run, you can first load the theme so that the first session's parameter set would be applied.

Hope this helps.

--Hideo Fujii
OriginLab
Go to Top of Page

snowli

USA
1379 Posts

Posted - 04/07/2016 :  3:25:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hua,

Please see if this works for you.

Choose Tools: Fitting Function Builder to edit your user-defined fitting function.
On Parameter Initialization Code page of the wizard, enter parameter values, e.g. suppose you have parameters A and B
A=2;
B=5;
Check the "Always run Initialization Code before Fiting".
Check Use LabTalk or Origin C based on if you have other script or OC to run.

Save your function.

After fit done, when you copy new data, it should always run such parameter initialization code first. then fit the new data.

BTW, could you explain in what situation you need to do it since if you will use the same set of P0, the new data shouldn't be dramatically different and it shouldn't matter that much if you change parameters to P0 or not and recalculate.

Thanks, Snow


quote:
Originally posted by imoada

Thanks, Snow.

Sorry for my puzzling question. Let me give an example: Fitting formula is user-defined. "Recalculate mode" is set to "Auto". Use data1 to make a fitting with initial parameter P0 (which set in fitting dialog box). Fitting results will give a result of parameter P1 (which showed in fitting dialog box). Then modify the data1 and Origin will use the modified data1 to make a second fitting automatically. At this time, We know P1 instead of P0 will be automatically set as the initial parameter for the second fitting by Origin. That's my question, how to make Origin use P0 instead of P1 as initial parameter to run the second fitting automatically. If I modify data1 again, the Origin can still use P0 as initial parameter for the third fitting, and so on. May we use script in Fitting Function Organizer to realize it?

Thanks

Hua

Go to Top of Page

imoada

31 Posts

Posted - 04/08/2016 :  12:10:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thank Hideo and Snow.

Snow's way perfectly answer me. Also Hideo's way can effect, but it is not "automatically". After all, thank both of you.

To Snow's question, that is one part of my work. Sometimes I need to manually modify data set to find out how much difference of P1 exist between two fittings which have similar data sets. Initial parameter could make effect on the difference comparison. So, I need to fix the initial parameter P0 so as to remove the aforesaid effect. Immobilization of initial parameter is just for convenience.

Thanks, Hua
Go to Top of Page

snowli

USA
1379 Posts

Posted - 04/08/2016 :  2:24:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Great Hua. Thanks for letting us know.

We will work on a blog and FAQ for this so other users will know how to do this as well.

Thanks, Snow
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