Using quad_qags



>>>>> "Ben" == Ben Blomberg <bblomberg at mail.bradley.edu> writes:

    Ben> Hello All,



    Ben> I am trying to use the quad_qags function to evaluate the following with respect to x:

    Ben> P0:(quad_qags(v[1,1]*exp((-%i)*(10)*phi/(0.00197))*x,x,-0.63,0.63));

    Ben> phi is a variable i have in there for plotting purposes later on in the code.

    Ben> And v is calculated from the following sum:

    Ben> for n:1 thru 11 do for j:1 thru 21 do
    Ben> v[n,j]:1/sqrt(0.63)*(sum(vectors[n,j][m+11]*exp(%i*2*%pi*m*x/.63),m,-10,10));

    Ben> vectors is a list with values between 1*10^-6 and 1*10^-7.

    Ben> When I try this ?I do not get the result with the list of the
    Ben> four elements. Instead I get a list of values that still
    Ben> contain x followed by ? the?parameters esprel, epsabs and
    Ben> limit. I do not?receive?an error message but no value
    Ben> either. I tried this with quad_qag as well and had the same
    Ben> problem.

Note that quad_qags only works for real-valued integrands.  I can't
tell immediately if your integrand is real, but it looks like it's
probably complex.  So you might want to try to run
quad_qags(realpart(<integrand>)) and quad_qags(imagpart<integrand>).

Ray