Error, (in PiecewiseTools:-Is) Wrong kind of parameters in piecewise - Maple Help

Home : Support : Online Help : Error, (in PiecewiseTools:-Is) Wrong kind of parameters in piecewise

Error, (in PiecewiseTools:-Is) Wrong kind of parameters in piecewise

 Description You can express piecewise-continuous functions using the function. The function takes as its parameters a condition (or conditions) and an associated expression (or expressions), should the condition evaluate to true.  For more information on the function, see the piecewise help page.   The conditions must be an equality or inequality, or a Boolean combination of inequalities.  The wrong kind of parameters in piecewise error occurs when any of the conditional arguments are not Boolean-valued (they do not evaluate to true or false).   You can also encounter this error when using the 2-D math notation for a piecewise expression.  Again, it indicates that the conditions are not Boolean-valued.  See the second example.

Examples

Example 1:

In this case, the unassigned $x$ is not an equality, inequality, or some Boolean combination of inequalities.

 > $\mathrm{piecewise}\left(x,y\right);$

Solution:

Replace the first argument with a valid condition.  One possible solution is to express the function as

 > $\mathrm{piecewise}\left(x>0,y\right);$
 ${{}\begin{array}{cc}{y}& {0}{<}{x}\\ {0}& {\mathrm{otherwise}}\end{array}$ (2.1)

Example 2:

In the following example, the second condition isn't properly formed.

 > $\mathrm{b}≔\left\{\begin{array}{cc}-x& x<2\\ x& 2\\ x+1& x>2\end{array}\right\$

Solution:

$x=2$.

 > $\mathrm{b}≔\left\{\begin{array}{cc}-x& x<2\\ x& x=2\\ x+1& x>2\end{array}\right\$
 ${b}{:=}{{}\begin{array}{cc}{-}{x}& {x}{<}{2}\\ {x}& {x}{=}{2}\\ {x}{+}{1}& {2}{<}{x}\end{array}$ (2.2)