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 fitting with complex number
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jayantkolte

India
Posts

Posted - 08/22/2014 :  04:51:12 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Originpro 9.1 Service Release: sr3 b275
Operating System:Windows 7
Hello everybody,
I have a complex fitting function called as Cole Cole equation. Since it has complex number i, I am not able to compile it using origin C. Below is my function.

y = Ei+(Es-Ei)/ 1+((i*2pi*x*t)^(1-a))

and my C code is
void _nlsfColecole(
// Fit Parameter(s):
double a, double t, double Es, double Ei,
// Independent Variable(s):
double x,
// Dependent Variable(s):
double& y)
{
// Beginning of editable part
complex yo;
yo =1+((1i*6.28*x*t)^(1-a));
y= (Ei+(Es-Ei))/yo;
// End of editable part
}

It gives me error as Incompatible variable types in expression on line where y is written. I search in forum, help and tutorials for help but but not able to resolve this error.

Kindly help me in this regard.

Thanking you in advance,
Jayant



jasonzhao

China
262 Posts

Posted - 08/22/2014 :  07:25:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

For fitting complex function, we use Origin C to build a user defined function in Fitting Function Builder, please refer to this link for details: http://www.originlab.com/doc/Tutorials/Fitting-ComplexFunc

You can also refer to the graph below which gives a example for cole-cole fitting:

If you still have diffculties for complex fitting, send your data to tech@originlab.com is recommended.

Best regards,
Jason Zhao
OriginLab Tech Service

Edited by - jasonzhao on 08/22/2014 09:23:36 AM
Go to Top of Page

jayantkolte

India
Posts

Posted - 08/22/2014 :  09:46:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Jason
Thank you very much for your reply. I do exactly as suggested by you and got the result as required.

Regards,
Jayant
Go to Top of Page

wzm39

USA
6 Posts

Posted - 03/01/2021 :  1:30:08 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jason, thanks very much for your reply!!!
I tried different ways to fit complex functions, for some reasons only your answer worked!! Thanks a lot for such a detailed answer!

Hope this answer can also be added in origin Tutorials. I noticed that many people ask about fitting complex functions!

Thanks again!!!


quote:
Originally posted by jasonzhao

Hello,

For fitting complex function, we use Origin C to build a user defined function in Fitting Function Builder, please refer to this link for details: http://www.originlab.com/doc/Tutorials/Fitting-ComplexFunc

You can also refer to the graph below which gives a example for cole-cole fitting:

If you still have diffculties for complex fitting, send your data to tech@originlab.com is recommended.

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