       Re: Boolean Integral

• To: mathgroup at smc.vnet.net
• Subject: [mg62447] Re: Boolean Integral
• From: Peter Pein <petsie at dordos.net>
• Date: Thu, 24 Nov 2005 06:33:47 -0500 (EST)
• References: <dlupfj\$nb2\$1@smc.vnet.net> <dm1ah8\$hvk\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

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