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
 All Forums
 Origin Forum
 Origin Forum
 Trouble of using complex numbers for fitting eqs

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
jbc1055 Posted - 03/28/2015 : 06:41:15 AM
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);



1   L A T E S T    R E P L I E S    (Newest First)
Echo_Chu Posted - 03/30/2015 : 04:19:58 AM
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




The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000