Re: How to convert a HeavisideTheta to a PieceWise function
- To: mathgroup at smc.vnet.net
- Subject: [mg93823] Re: How to convert a HeavisideTheta to a PieceWise function
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 26 Nov 2008 05:17:04 -0500 (EST)
- Organization: Uni Leipzig
- References: <gggqf5$317$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
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? >