PDA

View Full Version : complex numerical integration



nic
05-30-2010, 12:25 AM
Hi,
I have a problem in numerical integrating of a complex function. Of course the variable of integration is real, but there are some coeficients in the integrand which are complex, and therefore, the result of the integration would be comlex.
I used the function "DQDAGI", but it seems that this function is for numerical integration of real functions, and it did not work.
I wonder whether there is any special functions for such integration. :confused:

Tnx, Nic. :)

Richard Hanson
06-02-2010, 09:21 AM
This is a special case of integrating a vector function. VNI does not have a direct solution to this, at least using the numerical quadrature routines.
If the integrand functions are inexpensive to evaluate then it seems that doing the quadrature twice over is not that big a deal.

If they are expensive to evaluate then you can use a ODE integrator with the real and imaginary parts as components. This is a direct quadrature so using the ODE integrator is taking a big hammer to a small nut. But it will work for modest accuracies.

nic
06-07-2010, 01:52 AM
Tnx, I am trying this solution, and by seperating the imaginary an real parts of the integrand, the result would combine to form the answer for the initial integration.

I think the function for integrating a complex integrand is very necessary for a programming language.:rolleyes:

Very Thanks.

Richard Hanson
06-07-2010, 06:45 AM
I would state it thus: The software for a numerical quadrature code ought to allow for integrating vector functions. This complicates error control logic just a bit but it is not a big deal. So a library code ought to include this in a quadrature code, not the programming language. But you are absolutely correct about complex line integrals because they are inherent in physics and engineering.

The only excuse I can imagine for not including vector integrands in the software design is that it involved choosing the error control function. There are choices to be made with this that may not agree with every application. So a user-driven choice should be in the design.

There is also the matter of multiple integrals and vector integrands. This features should also be in the software. But it is only with Fortran 2003 that these features can be included and not appear to be awkward afterthoughts.

Cheers,

nic
07-05-2010, 09:51 PM
I separate the real and imaginary part of the system and this way I solve the problem. There was only a doubt about the verification of the results, therefore I used a code in Matlab, and verified the results.

regards,
nic