MathGroup Archive 2004

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

Search the Archive

Re: Vector Piecewise in 5.1

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53014] Re: [mg52996] Vector Piecewise in 5.1
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Mon, 20 Dec 2004 06:34:28 -0500 (EST)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200412191114.GAA17987@smc.vnet.net>
  • Reply-to: murray at math.umass.edu
  • Sender: owner-wri-mathgroup at wolfram.com

And it seems that pw cannot directly be plotted, not even by using, e.g.,

   Plot[cf, {x, -1, 1}];

after your definition of cf.


Mark Fisher wrote:
> To my surprise (and delight) it turns out that Piecewise in 5.1 can
> handle vectors (to some extent):
> 
> pw1 = Piecewise[{{x, x > 0}}]
> pw2 = Piecewise[{{x2, x > 0}}]
> 
> pw = PiecewiseExpand[{pw1, pw2}]
> 
> This can even be compiled successfully:
> 
> cf = Compile[{x}, Evaluate[pw]]
> 
> And differentiated:
> 
> D[pw, x]
> 
> But not, however, integrated:
> 
> Integrate[pw, x]
> 
> (Worse, Integrate[pw, {x, 0, 3}] returns a scalar.)
> Is this a bug or just the absence of an undocumented feature?
> 
> --Mark
> 
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: All Factors of a number
  • Next by Date: UnitStep bugs remain in ver. 5.01
  • Previous by thread: Vector Piecewise in 5.1
  • Next by thread: Re: Vector Piecewise in 5.1