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 for Programming
 Forum for Origin C
 Fitting with imaginary part
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cellbiophysics

S. Korea
Posts

Posted - 01/11/2008 :  03:40:47 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5 SR4
Operating System: Window XP

Dear all,
I have a problem in fitting with imaginary part. My fitting equation is as follows;

y=i*sqrt(a*x)*(erf(i*sqrt(b*x))-erf(i*sqrt(c*x))),

where a, b, and c are fitting parameters.
When I compiled this, some errors happened. I am almost new in Origin C. I don't know how to solve them and how to define or set the function with imaginary part. Please let me know.

Thanks,

Kang-Bin.

Deanna

China
Posts

Posted - 01/14/2008 :  04:03:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Kang-Bin,

Currently in Origin, we only support curve fitting with both X and Y as real numbers. Therefore, we need to know whether the X and Y (the independent variable and dependent variable) which you are trying to fit are real numbers.

If both X and Y are real numbers, it is possible to fit them with the equation you have posted here. We can tell you more details on how to do it.

If either X or Y has numbers with non-zero imaginary parts, the curve fitting cannot be done with our current product. However, we will consider adding this feature to our future version. If you have a good example of fitting complex numbers, it will be very helpful for us to develop this new feature. If you don't mind, you can send us the data which you are trying to fit with the formula posted here. We would greatly appreciate it! You can email the data to tech@originlab.com . Thank you in advance!

Deanna
OriginLab Technical Services
Go to Top of Page

cellbiophysics

S. Korea
Posts

Posted - 01/14/2008 :  04:12:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Deanna,

Thanks, Deanna.
Yes, X and Y are real numbers, because erf gives also imaginary numbers in my fitting function. This means the fitted data are real numbers. But, I looked for "erf" in Help. "erf" function is "double". I'm afraid "erf" cannot give imaginary numbers. Do you have any good idea?

Thanks,

Kang-Bin.

Edited by - cellbiophysics on 01/14/2008 04:14:12 AM
Go to Top of Page

larry_lan

China
Posts

Posted - 01/14/2008 :  10:05:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Kang-Bin:

The error function we provide is double, so first of all, you should define a new error function pass and return complex number.



Since in your function, the integrate limit is complex, you'd better transform this formula. I am not good at math, maybe the new equation form is:



Then you can calculate the integrate value while trapezia algorithm.

After these done, you should also guarantee that the right part of your fitting function is Real, because the dependent variable, y, is double. Maybe you can calculate the modulus of the expression before assigning to y?

I admit it's difficult, good luck!

Thanks
Larry
OriginLab Technical Services

Edited by - larry_lan on 01/15/2008 09:02:47 AM
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