Re: Integrate UnitStep, Bug?
- To: mathgroup at smc.vnet.net
- Subject: [mg50341] Re: Integrate UnitStep, Bug?
- From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
- Date: Sat, 28 Aug 2004 04:37:53 -0400 (EDT)
- References: <200408261050.GAA16330@smc.vnet.net> <cgmmiu$sj$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
DrBob <drbob at bigfoot.com> wrote:
> I think both results are wrong, and the correct answer is Abs[b-a].
I have no idea why you think that's the correct answer, especially since
the plots which you mention below are correct (at least on my machine) and
clearly show that Abs[b-a] is incorrect.
A correct answer was already given by jens: Min[a,b].
> Unless these Plots are wrong?
>
> fr[e_] := UnitStep[-e];
> fl[e_] := UnitStep[-(e - b)];
>
> b = 2; a = 3;
> Plot[fl[e](fr[e - a] - fr[e]), {e, -5, 5}, PlotStyle ->
> {Thickness[0.01]}]
>
> b = 5; a = 3;
> Plot[fl[e](fr[e - a] - fr[e]), {e, -5, 5}, PlotStyle ->
> {Thickness[0.01]}]
>
> Bobby
>
> On Thu, 26 Aug 2004 06:50:47 -0400 (EDT), <jens at fika.de> wrote:
>
> > The following code returns the incorrect result (-a+b) UnitStep[a-b].
> > It should be Min[a,b].
> >
> > fr[e_]=UnitStep[-e];
> > fl[e_]=UnitStep[-(e-b)];
> > Integrate[fl[e](fr[e-a]-fr[e]),{e,-Infinity,Infinity},
> > Assumptions->{b>0,a>0}]
> >
> > Is this a known bug? Should I avoid using step functions with
> > Integrate?
This is clearly a bug. Whether it's previously known or not, I have no
idea. It needs to be fixed! It would be hard to "avoid using step functions
with Integrate" in many cases.
David Cantrell
- References:
- Integrate UnitStep, Bug?
- From: jens@fika.de
- Integrate UnitStep, Bug?