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
 NLF of coupled functions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

sming

Germany
2 Posts

Posted - 07/11/2017 :  10:04:20 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 9.1.0
Operating System: Win7

Hi there,

I´m struggling with a nonlinear fit of coupled functions. Initial, I got measurement data TPR(x) in dependency of depth x for different field sizes s.



These TPR curves follows the fitting function with the parameters D, b, a, m and n:

TPR(x) = (D+(1-D)*(1-b^x))*a*exp(-m*(1-n*x)*x)

The (global) fitting procedure is quite easy with a user defined function in the nonlinear fitting tool.




But the obtained parameters should themselves linked to a functional expression according to s with three parameters. For instance:

b(s) = a1*(1-b1^s)+c1*s
a(s) = a2 + b2*exp(-s/c2)


(for m(a3,b3,c3) and n(a4,b4,c4) the same equation as for a can be used)

After NLFit:



For the a parameter the fit is acceptable,but for the b parameter there is potential for improvement. To get a better balance between the fits is it possible to make a parallel NLFit (optimization) of all equations and not sequential like in my post? Maybe implicit function can be used?

Any help is welcome. Many thanks in advance.

AmandaLu

439 Posts

Posted - 07/12/2017 :  05:47:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can define a user-defined function including all equations and use Global Fit to fit all Y dataset in one time. That is,

1. Define your function. On Name and Type page of the Fitting Function Builder dialog (Tools: Fitting Function Builder), select “Equations” for “Function Type”.
On Variables and Parameters page, define “Parameters”: D,s,a1,b1,c1,a2,b2,c2,a3,b3,c3,a4,b4,c4.
On Multiple Equations page, define function as:
b = a1*(1-b1^s)+c1*s;
a = a2 + b2*exp(-s/c2);
m = … ;
n = … ;
y = (D+(1-D)*(1-b^x))*a*exp(-m*(1-n*x)*x);

2. Perform Global Fit by Nonlinear Curve Fit dialog. Highlight column B to H and open NLFIT dialog. Select the function you defined in step1.
Go to Data Selection page, set Multi-Data Fit Mode = Global Fit.
Go to Parameters tab. Select “Share” checkbox for a1,b1,c1,a2,b2,c2,a3,b3,c3,a4,b4,c4. Select “Fixed” checkbox for s, and set s = 1, s_2 = 3, s_3 = 8, s_4 = 16.


Thanks,
Amanda
OriginLab Technical Service

Edited by - AmandaLu on 07/12/2017 05:49:09 AM
Go to Top of Page

sming

Germany
2 Posts

Posted - 07/14/2017 :  06:12:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Amanda,

thank you for your answer. Based on your explanation I could set up the function and successfully perform the NLFit. Now I'm almost happy. Is it possible to control the balance of fits or put some weights on several functions, e.g main focus on function (TPR)?

Thanks in advance.

Go to Top of Page

AmandaLu

439 Posts

Posted - 07/17/2017 :  01:51:15 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I’m not sure what you mean by “control the balance of fits or put some weights on several functions”. There is only one function in your fitting, even though you put it in several lines. Do you want to set different weight for every set of data? If so, you can set weight in the Data Selection page.

Thanks,
Amanda
OriginLab Technical Service
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