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 for Programming
 Forum for Origin C
 erfc(complex number)?

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
aekalavya Posted - 12/03/2009 : 7:49:42 PM
Origin Ver. and Service Release (Select Help-->About Origin): 8.0 SR6
Operating System: Xp sp3

Friends,
I have an issue to use Erfc with complex numbers.
My code goes like,

#include <origin.h>
#include <oc_nag8.h>
#include <complex.h>
void _nlsfcomp_err_func1(
// Fit Parameter(s):
double x1, double D1, double g1, double c1,
// Independent Variable(s):
double x,
// Dependent Variable(s):
double& y)
{
// Beginning of editable part
// Beginning of editable part
complex z1,y1,e1;
z1=-(x1-1i*D1-x)/g1;
e1= erfc(z1);
y1=c1*1i*sqrt(Pi)/g1*exp(-z1^2)*e1;
y=y1.m_im;


// End of editable part
}

If I give a double value to erfc() argument, it compiles fine.
Since z1 is complex, it is showing error such as :Error, cannot convert argument in function call
Can we work with erfc() using complex arguments by adding some additional header files?
I also tried nag_erfc(), the problem is still there,

-Shiva
2   L A T E S T    R E P L I E S    (Newest First)
aekalavya Posted - 12/07/2009 : 3:45:56 PM
Thank you Iris.
I was not aware of that function before.
It works great.
Next step is to include one more variable. I am working on it. And let you know the result.
thank you very much for the hint.

-Shiva
Iris_Bai Posted - 12/03/2009 : 9:05:45 PM
Hi,

Please try nag_complex_erfc.


#include <oc_nag8.h>
void test_complex()
{
	complex cc;
	cc = 1+2i;
	
	NagError fail;
	complex cc2 = nag_complex_erfc(cc, &fail);
	out_complex("", cc2);
}


Iris

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