Double integration.



Dear List,

Any assistance with using the Maxima function quad_qags() in the
following application would be appreciated:

(1) I am trying to compute the area of regions in the (X,Y)-plane
bounded by lines/curves and am using two nested calls to quad_qags()
with the integrand being an indicator-type function ind()
defined below. It is not clear where the error is ?

(2) I dont know whether it is possible to define an indicator-type
function where the constraints
specifying the region in the (X,Y)-plane are included in a boolean
expression passed to the function, for example, ind2( is(x2>= abs(x1))
and is(x2 <= 3) and ....).

Thanks very much.
Constantine.


(%i136) I:quad_qags(quad_qags(ind(x1,x2),x1,-1,1)[1],x2,-1,1);

COERCE-FLOAT-FUN: no such Lisp or Maxima function: s
 -- an error. To debug this try: debugmode(true);
(%i137)

ind(x,y) := block(
[s],
if is(x*x + y*y <= 1) then
(s : 1)
else
(s : 0),
return(s)
);