Subject: behavior of with_stdout with quad_qagi message
From: Edwin Woollett
Date: Thu, 3 Nov 2011 15:43:10 -0700
I seem to be missing some part of how
with_stdout works.
This example:
integrate ((sin(x+sqrt(x))+x*bessel_j(0,x^2))/(1+x),x,0,inf)
is being done numerically using nint, which has the definition:
nint([uv]) :=
(with_stdout ("null2.txt", apply ('nint0, uv)))$
and the function nint0 eventually (because integrate
returns a noun form) sends the real and imaginary
parts to quad_qagi, which then prints a precision
message to the screen (which I want to surpress).
------------------------------------
(%i129) nint((sin(x+sqrt(x))+x*bessel_j(0,x^2))/(1+x),x,0,inf);
* NO PRECISION BECAUSE X IS BIG
(%o129) false
(%i130) with_stdout("null2.txt",
apply
('nint0,[(sin(x+sqrt(x))+x*bessel_j(0,x^2))/(1+x),x,0,inf]));
* NO PRECISION BECAUSE X IS BIG
(%o130) false
----------------------------------
yet if I use quad_qagi in an interactive mode,with
the real and imaginary parts of the integrand,
no precision message is returned.
---------------------
/* no message */
(%i124) apply ('quad_qagi,
[realpart((sin(x+sqrt(x))+x*bessel_j(0,x^2))/(1+x)),x,0,inf]);
(%o124) [2.947785631372242,9.571670899311954,5985,1]
/* no message */
(%i125) apply ('quad_qagi,
[imagpart((sin(x+sqrt(x))+x*bessel_j(0,x^2))/(1+x)),x,0,inf]);
(%o125) [0.0,0.0,15,0]
----------------------------------
I should add that I have the calls to quad_qagi inside the code
also wrapped in with_stdout(some other dump file, ).
I will experiment with those, but I'm probably missing
something more fundamental here.
Ted Woollett