convert/piecewise - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Data Types : Conversion : convert/piecewise

convert/piecewise

convert to a piecewise function

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

convert( expr, piecewise )

convert( expr, piecewise, var)

Parameters

expr

-

expression

piecewise

-

literal name

var

-

name representing the main variable

Description

• 

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.

Examples

convertxHeavisidex,piecewise,x

0x<0undefinedx=0x0<x

(1)

convertxHeavisidex&comma;piecewise&comma;x

0x<0undefinedx=0x0<x

(2)

convertHeavisidex&plus;xHeavisidex1&comma;piecewise&comma;x

0x<0undefinedx=01x<1undefinedx=11+x1<x

(3)

convert1x&comma;piecewise

1xx−11+xx<01xx<1x11x

(4)

convertsignumx&comma;piecewise

−1x<00x=010<x

(5)

Converting signum taking its value at zero from its _Environment variable

_Envsignum012

_Envsignum012

(6)

convertsignumx&comma;piecewise

−1x<012x=010<x

(7)

convertIfx<1&comma;xx&comma;x<2&comma;2x&plus;2&comma;x<3&comma;3&plus;x&comma;piecewise

x2x<12x+2x<23+xx<303x

(8)

Converting Heaviside(x) taking Heaviside(0) = 1

_EnvUseHeavisideAsUnitSteptrue

_EnvUseHeavisideAsUnitSteptrue

(9)

convertHeavisidex&comma;piecewise

0x<010x

(10)

See Also

_Env

abs

convert/Heaviside

Heaviside

piecewise

signum