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

grey_fit

USA
3 Posts

Posted - 02/18/2019 :  2:59:18 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I'm trying to fit solved differential equations to kinetics data and origin will crash with very long equations. The equations are solved in maple and imported into origin as a user defined nonlinear function. The issue with the differential equations is the solution length increases greatly with every paired term.

Is there a way around the equation limit in origin? Can I represent the solution in a different form origin can handle? Is there a better way to do the fitting? Thanks in advance.

Example maple input:
diff(a(x), x) = -k1*a(x), diff(b(x), x) = k1*a(x)-k1*b(x), diff(c(x), x) = k1*b(x)-k1*c(x),
diff(d(x), x) = k1*c(x)-k2*d(x),
diff(e(x), x) = k2*d(x)-k3*e(x), diff(f(x), x) = k3*e(x)-k3*f(x), diff(g(x), x) = k3*f(x)-k3*g(x), diff(h(x), x) = k3*g(x)-k3*h(x), diff(i(x), x) = k3*h(x)-k3*i(x), diff(j(x), x) = k3*i(x)-k3*j(x), diff(k(x), x) = k3*j(x)-k3*k(x),
a(0) = 1, b(0) = 0, c(0) = 0, d(0) = 0, e(0) = 0, f(0) = 0, g(0) = 0, h(0) = 0, i(0) = 0, j(0) = 0, k(0) = 0;

Example output:
https://pastebin.com/raw/DYZwzpW4

Origin Ver. and Service Release (Select Help-->About Origin): 2018 64bit SR1
Operating System: Windows 10

Edited by - grey_fit on 02/18/2019 3:44:12 PM

Castiel

343 Posts

Posted - 02/19/2019 :  02:38:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by grey_fit

The equations are solved in maple and imported into origin as a user defined nonlinear function.



How you defined the fitting function seems to cause the problem. Hardly can one solve the problem without the FDF file and the data. You may provide them as well.


                                          &&&&&&&&&
                                        &&&
                                       &&
                                      &  _____ ___________
                                     II__|[] | |   I I   |
                                    |        |_|_  I I  _|
                                   < OO----OOO   OO---OO
**********************************************************
Go to Top of Page

grey_fit

USA
3 Posts

Posted - 02/19/2019 :  12:51:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I should clarify origin crashes when you save the fit, not when fitting to data.
Go to Top of Page

Castiel

343 Posts

Posted - 02/19/2019 :  5:35:14 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by grey_fit

I should clarify origin crashes when you save the fit, not when fitting to data.



How was the user defined nonlinear function 'imported'?
IIRC there is no way to 'import' as Origin FDF. In most cases, you should define the fitting function manually.


                                          &&&&&&&&&
                                        &&&
                                       &&
                                      &  _____ ___________
                                     II__|[] | |   I I   |
                                    |        |_|_  I I  _|
                                   < OO----OOO   OO---OO
**********************************************************
Go to Top of Page

grey_fit

USA
3 Posts

Posted - 02/21/2019 :  4:08:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Right, the fitting function was defined manually. However, the fitting function is quite large (>5,000 characters long). Is there a limit on the size of the user defined fitting function?
Go to Top of Page

Castiel

343 Posts

Posted - 02/21/2019 :  10:15:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by grey_fit

Right, the fitting function was defined manually. However, the fitting function is quite large (>5,000 characters long). Is there a limit on the size of the user defined fitting function?



You can define a fitting function in multiple way. You should not simply copy the results from maple and paste it in Origin.

You should try to define the fitting function in Origin C.


                                          &&&&&&&&&
                                        &&&
                                       &&
                                      &  _____ ___________
                                     II__|[] | |   I I   |
                                    |        |_|_  I I  _|
                                   < OO----OOO   OO---OO
**********************************************************
Go to Top of Page

Echo_Chu

China
Posts

Posted - 02/22/2019 :  12:46:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

The fitting function body has a limitation of characters around 6000, and the limitation of parameter number is 277.

However, Origin should not crash even your function exceed character limitation. there should be error message to notify user the limitation. We will see whether we can improve this.

Echo
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