convert/piecewise
convert to a piecewise function
Calling Sequence
Parameters
Description
Examples
convert( expr, piecewise )
convert( expr, piecewise, var)
expr
-
expression
piecewise
literal name
var
name representing the main variable
Converts an expression containing Heaviside, abs, signum, or `if` to a piecewise function. If the expression has the form `if`..., the if must be replaced by If to avoid evaluation. If the expression contains more than one name, the argument var specifies the variable with respect to which the function is piecewise.
convert/piecewise can be used to compute the normal form of an expression involving piecewise, Heaviside, abs, signum, min, or max with respect to the variable var.
When converting Heaviside to piecewise you can perform the conversion taking Heaviside(0) = 1. For that purpose set the Environment Variable _EnvUseHeavisideAsUnitStep to true; see the last example.
convert⁡x⁢Heaviside⁡x,piecewise,x
0x<0undefinedx=0x0<x
convert⁡Heaviside⁡x+x⁢Heaviside⁡x−1,piecewise,x
0x<0undefinedx=01x<1undefinedx=11+x1<x
convert⁡abs⁡1−abs⁡x,piecewise
−1−xx≤−11+xx<01−xx<1x−11≤x
convert⁡signum⁡x,piecewise
−1x<00x=010<x
Converting signum taking its value at zero from its _Environment variable
_Envsignum0≔12
−1x<012x=010<x
convert⁡If⁡x<1,x⁢x,x<2,2⁢x+2,x<3,3+x,piecewise
x2x<12⁢x+2x<23+xx<303≤x
Converting Heaviside(x) taking Heaviside(0) = 1
_EnvUseHeavisideAsUnitStep≔true
convert⁡Heaviside⁡x,piecewise
0x<010≤x
See Also
_Env
abs
convert/Heaviside
Heaviside
signum
Download Help Document