MathGroup Archive 2008

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

Search the Archive

Re: How to convert a HeavisideTheta to a PieceWise function


Hi,

((x + (-2 + x) HeavisideTheta[-2 + x] -
       2 (-1 + x) HeavisideTheta[-1 + x]) HeavisideTheta[x] /.
    HeavisideTheta -> UnitStep) // PiecewiseExpand

if you don't matter about HeavisideTheta[0] and UnitStep[0]

Regards
   Jens

wxziwyz at 126.com wrote:
> For example:
> we have f(x) = (x + (-2 + x) HeavisideTheta[-2 + x] -  2 (-1 + x)
> HeavisideTheta[-1 + x]) HeavisideTheta[x]
> 
> apparently, this is a piecewise function.
> 
> My problem is, How to transfer it into a Piecewise expression, i.e.
> 
> f(x) = Piecewise[{{0, x < 0}, {x, 0 < x <= 1}, {2- x, 1 < x <= 2}, {0,
> x > 2}}]
> 
> Is there any function in Mathematica can do this?
> 


  • Prev by Date: No more memory available problem with LinearSolve
  • Next by Date: Re: Flow around sections and subsections!
  • Previous by thread: How to convert a HeavisideTheta to a PieceWise function
  • Next by thread: Re: How to convert a HeavisideTheta to a PieceWise function