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
 Trouble of using complex numbers for fitting eqs
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jbc1055

USA
5 Posts

Posted - 03/28/2015 :  06:41:15 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.5.1 and Service Release (Select Help-->About Origin):
Operating System: Windows 8.1

Hi,

I tried to build a equation in origin C for data fitting, but I am having trouble while performing quick check. I noticed that a variable is a complex number (f in the function body), so I used Re() in the final equation to fix that but it seems not working.

The data values of x vary from 0 toward negative values, and the corresponding y values should be positive. I tried using some random x values such as -0.01 for quick check, but the calculated y always shows y = --. I was wondering if anyone could teach me how to fix this issue.

Thanks in advance!

------
Independent variables: x
Dependent variables: y
Parameters: A

Function body:

double d;
complex f;


d = exp(-75.287*x);
f = 0.5*pi*(1/(1-d^2))^0.5 - atan(d/(1-d^2)^0.5)/(1-d^2)^0.5;

y = 3.1652e-10*A*Re(f);



Echo_Chu

China
Posts

Posted - 03/30/2015 :  04:19:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

The atan() in your function can only works for real value.

I am afraid that Origin does not support arctan for complex values yet. You function can not be defined in Origin yet.

Echo
OriginLab



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