Hi !
Do you know how to integrate complex functions? I used the QDAG
routine of the IMSL library (in Compaq Visual Fortran), but it seems not
to support complex functions.
In the program I make the integration of a complex function; if I
declare it as real the program make the integration of the real part
of the function; if I declare it as complex it gives an error in the
debug (forrtl: severe (157): Program Exception- access
violation...incrementally linked image--PC correlation disabled)
Thank you,
celevic
FUNCTION f(x)
real, intent(in):: x
real :: f <---------- error in declaring it complex
complex :: c=(0,1) ! z=x+i*y ; x=0,y=1
real :: a=2.
f=a*x+c*x ! f(x)=2*x + i*x
END FUNCTION
PROGRAM proof
real :: lower=1.,upper=2.
real :: res <--of course also the result will be complex
real :: errest
real :: errAbs, errRel
external QDAG,UMACH,f
errAbs=1E-3
errRel=1E-3
call QDAG(f,lower,upper,errAbs,errRel,2,res,errest)
write(*,*) res
END PROGRAM
|