Fortran Complex Argument

  • Fortran
  • Thread starter miccol999
  • Start date
  • #1
7
0

Main Question or Discussion Point

Hi
I need help with programming the following:

(T/(T-2*d))^(i*Nu)=exp(-i*Nu*ln|T/(T-2*d)| +Nu*arg(T/(T-2*d))

I don't know how to do the arg bit in Fortran90...this is what I've tried so far

A=T/(T-2*DELTA)
B=EXP(-CI*NU*LOG(ABS(A))+NU*ARG(A))

but obviously it threw back an error message at the 'ARG(A)' bit...I've tried searching the web and help directories but still unsure as to what to do, HELP!!
 

Answers and Replies

  • #2
7
0
I've also tried the following....

A=T/(T-2*DELTA)
ARGA=ATAN(REAL(AIMAG(A))/REAL(REAL(A)))
B=EXP(-CI*NU*LOG(ABS(A))+NU*ARGA)

....since arg(x+iy)=tan^(-1)(y/x). I think I'm not using the right function to find the real and imaginary parts of A, can anyone help at all?
 
  • #3
Dr Transport
Science Advisor
Gold Member
2,390
518
atan2(real(A),imag(A)), if that isn't right, reverse the arguments.
 
  • #4
7
0
that didn't work...how do you get arg(z) in fortran?
 
  • #5
2
0
Ten en cuenta que usas ATAN2 si es simple presicion y DATAN2 si es doble presicion

ATAN2(parte imaginaria, parte real)

Parte imaginaria: IMAG (o AIMAG) y DIMAG (Simple y doble presicion)
Parte real: REAL o DREAL

Examples

ATAN2 (2.679676, 1.0) has the value 1.213623.
 

Related Threads on Fortran Complex Argument

Replies
2
Views
2K
Replies
7
Views
11K
Replies
4
Views
3K
Replies
2
Views
2K
  • Last Post
Replies
5
Views
6K
Replies
1
Views
2K
  • Last Post
Replies
8
Views
1K
Replies
4
Views
12K
Replies
3
Views
5K
Top