MathGroup Archive 2005

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

Search the Archive

Re: Re: Double integral of a piecewise-constant function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61536] Re: [mg61515] Re: Double integral of a piecewise-constant function
  • From: Chris Chiasson <chris.chiasson at gmail.com>
  • Date: Sat, 22 Oct 2005 00:35:20 -0400 (EDT)
  • References: <200510180644.CAA11181@smc.vnet.net> <dj4q2v$ipv$1@smc.vnet.net> <200510210438.AAA13407@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

I don't know, but here is a workaround:

Assuming[t[1]\[Element]Reals,
 Integrate[Integrate[testfunc,{t[2],0,t[1]}],{t[1],0,3}]]

Good luck

On 10/21/05, Chris Rodgers <rodgers at physchem.nospamox.aremovec.uk> wrote:
> OK. Here is a simpler example where I try to integrate a
> piecewise-constant function in two dimensions.
>
> I define a very simple function ("testfunc") with constant values in 1x1
> squares over the domain t[1] = 0 to 3 and t[2] = 0 to 3 with value zero
> elsewhere.
>
> I then proceed to integrate a triangular region of this surface, whose
> integral should be 1+2+3=6. I tried three different approaches:
>
> 1) Integrate[Integrate[testfunc, {t[2], 0, t[1]}], {t[1], 0, 3}]
>
> 2) Integrate[testfunc, {t[1], 0, 3}, {t[2], 0, t[1]}]
>
> 3) Integrate[
>    Integrate[testfunc, {t[2], 0, t[1]},
>      Assumptions -> t[1] \[Element] Reals], {t[1], 0, 3}]
>
> In (2) and (3), Mathematica succeeds, but in case (1) it doesn't.
>
> Why does Mathematica not understand that the dummy variable t[1] is Real
> in case (1)?
>
> Although this example is trivial, in the work that I am trying to do, it
> will be much more difficult to collect all the integrals together into a
> single term. Is there any way to make the inner Integrate(s) realise
> that t[1] is Real automatically? Can this be scaled up to the case where
>   I have more than two Integrate's within one-another?
>
> Yours,
>
> Chris Rodgers.
>
> P.S. A workbook containing these formulae and a plot of "testfunc" is
> available at
>
> http://physchem.ox.ac.uk/~rodgers/MMA/Problem1.nb
>
> and a PDF showing the output is available at
>
> http://physchem.ox.ac.uk/~rodgers/MMA/Problem1.pdf
>
>


--
Chris Chiasson
http://chrischiasson.com/contact/chris_chiasson


  • Prev by Date: Re: Circle equation problem
  • Next by Date: Re: Re: Display sound but suppress graphics
  • Previous by thread: Re: Double integral of a piecewise-constant function
  • Next by thread: Re: Double integral of a piecewise-constant function