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
 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

nbulcourt

USA
5 Posts

Posted - 08/06/2002 :  08:13:47 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
How can I deal with the complex numbers with origin?
Because when I write sqrt(-1) in the script window, origin answers
sqrt(-1)= --.

Thanks a lot for your help.

cpyang

USA
1406 Posts

Posted - 08/06/2002 :  08:53:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Only Origin C supports complex numbers, like in the following



void test_complex()
{
complex a = 1+2i;
complex b = 2+3i;

complex c = a*b;

out_complex("c=", c);

vector<complex> aa(2), bb(2), cc(2);

aa = a;
bb = b;

cc = aa*bb;

complex d;
d = aa[1] * bb[1];
out_complex("d=", d);
return;
}



Go to Top of Page

phm9gfb

UK
1 Posts

Posted - 02/24/2003 :  05:43:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
How to use complex numbers in the nlsf e.g.

a=exp(-i*b*x);
y=abs(a+b);

?
Go to Top of Page

easwar

USA
1964 Posts

Posted - 02/24/2003 :  10:04:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:

How to use complex numbers in the nlsf e.g.

a=exp(-i*b*x);
y=abs(a+b);

?



Hi,

If you have Origin 7, you can define your fitting functions under NLSF using Origin C, and use complex math. Note that the parameters and datasets used in the function all have to be real. You can however define and use temporary complex variables within your code and perform complex math with them.

Easwar
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