feature request: imagpart (bessel_y)
- Subject: feature request: imagpart (bessel_y)
- From: Edwin Woollett
- Date: Fri, 11 Nov 2011 11:02:05 -0800
On Nov. 10, 2011, Dieter Kaiser wrote:
>>(%i10) nint(bessel_y(1,x)*bessel_y(2,sqrt(2)*x),x,1,1000,strong_osc);
>> quad_qag
>>(%o10) 0.44737052335548
>>
>>(%i11) time(%);
>>(%o11) [19.78]
>>
>>(%i12) goutL;
>>(%o12) [[[qag,0.44737052335548,3.0438548004320586E-9,7905,0],
>> [qag,0.0,0.0,31,0]]]
>>
>>(%i13) gargL;
>>(%o13) [[[qag,
>> 'realpart(bessel_y(1,x))*'realpart(bessel_y(2,sqrt(2)*x))
>> -'imagpart(bessel_y(1,x))*'imagpart(bessel_y(2,sqrt(2)*x)),x,1,
>> 1000,3,epsrel = 1.0E-8,limit = 700],
>> [qag,
>> 'imagpart(bessel_y(1,x))*'realpart(bessel_y(2,sqrt(2)*x))
>> +'realpart(bessel_y(1,x))*'imagpart(bessel_y(2,sqrt(2)*x)),x,1,
>The imaginary part of bessel_y(n,x) is zero only for a positive argument
>x. Maxima already has this knowledge:
>
>(%i1) imagpart(bessel_y(1, x));
>(%o1) imagpart(bessel_y(1, x))
>(%i2) assume(x>0);
>(%o2) [x > 0]
>(%i3) imagpart(bessel_y(1, x));
>(%o3) 0
>
>
Thanks for the guidance.
Have incorporated an assume inside the nint code,
and get better results:
(%i1) load(nint);
(%o1) "c:/work2/nint.mac"
(%i2) nint(bessel_y(1,x)*bessel_y(2,sqrt(2)*x),x,1,1000,strong_osc);
quad_qag
(%o2) 0.44737052335548
(%i3) time(%);
(%o3) [10.92]
(%i4) goutL;
(%o4) [[qag,0.44737052335548,3.0438548004320586E-9,7905,0]]
(%i5) gargL;
(%o5) [[qag,bessel_y(1,x)*bessel_y(2,sqrt(2)*x),x,1,1000,3,epsrel = 1.0E-8,
limit = 700]]
Ted