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
 Nonlinear curve fitting-please help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

whatys521

USA
2 Posts

Posted - 07/10/2014 :  5:47:50 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi, I have a problem fitting my data into the script.Please help.

constants:
Ki=2.9E5
It=0.000008
Ht=0.000006
Im=3E5
Io=1.7E5

paprameters: Kg, H

The y-script I put in is:

A=Ki*Kg;
B=Ki+Kg+Ki*Kg*It+Ki*Kg*x-Ki*Kg*Ht;
C=1+Ki*It+Kg*x-(Ki+Kg)*Ht;
D=-Ht;

for (H= Ht, step=1;abs(step)>1E-15;H=H-step){
step=(a*H*H*H+b*H*H+c*H+d)/(3*a*H*H+2*b*H+c);};

y=It*(Io*Ki*H+Im)/(1+Ki*H);

the data:
x y
0 306845
5E-7 292093
1E-6 286623
2E-6 268303
4E-6 269794
6E-6 233164
8E-6 211536
1E-5 206473
1.2E-5 200672
1.4E-5 193292
1.6E-5 197140
1.8E-5 175681
2E-5 180442


the data could not fit into the equation at all. way off. However, the y-script is published and should be right.


Please help me, I am so not familiar with Origin.

Thank you


jasonzhao

China
262 Posts

Posted - 07/11/2014 :  01:09:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

When performing Nonlinear fitting in Origin, we can use Origin C code to build a function. However, in this fitting function you provided, H varies with the For loop, so it cannot be considered to be a parameter;
In addition, a proper initial value for parameter Kg is needed.

Best regards,
Jason Zhao
OriginLab Tech Service
Go to Top of Page

whatys521

USA
2 Posts

Posted - 07/11/2014 :  1:17:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Jason,

Thank you for your answer.

I am not familiar with Origin at all. if I remove the H from the parameter list. and the only parameter is Kg, which I want to get the value for.

Also, what is the difference between the origin C and the script. The paper i am referring has this script only.

Thank you

Wei
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 07/14/2014 :  07:22:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Wei,

We can construct a function by clicking main menu: Tools> Fitting Function Builder, and select Function type in Function Type group. The user defined function can be built by using Origin C, LabTalk script, expression, and so on. Y-script is similar to LabTalk script when building a fitting function. Besides, in the script you provided, the initial value for parameter Kg is very important. Would you like to provide a proper range for Kg based on its meaning? This will be helpful for us to calculate the fitting results.

Best regards,
Jason Zhao
OriginLab Tech 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