MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Boolean Integral


dh schrieb:
> Hi Roberto,
> If your function does not behave too exotic, an increase of the number 
> of sample points may help: GaussPoints->n, where n is big enough (see 
> the manual).
> 
> If your function is slightly pathologic, you may help NIntegrate by 
> splitting the integral region into pieces, where the function behaves well.
> 
> Plot has an adaptive algorithm to determine the plot points. As a last 
> resort, you could get the
> 
> Daniel
> 

LOL: "get the Daniel" :-))

I'm pretty sure you had something like

In[1]:= f[x_] = Boole[12 < -100*BesselJ[1, x] < 16];
In[2]:= Block[{$DisplayFunction = #1 & },
   p = Plot[f[x], {x, 0, 20}, PlotPoints -> 1234]];
In[3]:= Length[p[[1,1,1,1]]]
Out[3]= 42732
In[4]:=reduceLine[l_Line] :=
   Module[{ll = l[[1]]},
    Scan[Function[{firlas},
       ll = Flatten[(Union[{First[#1], Last[#1]}] & ) /@
          Split[ll, Equal @@ firlas /@ {##1} & ], 1]],
      {First, Last}];
    Line[ll]]
In[5]:= Show[p2 =
   ReplacePart[p, rlin = reduceLine[p[[1,1,1]]], {1, 1, 1}]]
Out[5]= Graphics[]
In[6]:= Length @@ rlin
Out[6]= 26
In[7]:= -Plus @@ Subtract @@@
    Partition[Cases[rlin[[1]], {x_, 1.} :> x], 2]
Out[7]= 1.3377339165593574

in mind !?

Peter


  • Prev by Date: Re: Time needed for calculation
  • Next by Date: Re: Solving an integral in the limit.
  • Previous by thread: Re: Boolean Integral
  • Next by thread: Error code -43