 type/dimension - Maple Programming Help

Home : Support : Online Help : Programming : Data Types : Type Checking : Types : type/dimension

type/dimension

check for a Units package dimension

 Calling Sequence type(expr, dimension) type(expr, dimension(typ, p))

Parameters

 expr - expression typ - either base or derived p - (optional) name

Description

 • A Maple dimension is a product of rational powers of symbols or functions of symbols whose arguments are symbols, where the symbols are base dimensions in the Units package.
 • The type(expr, dimension) and type(expr, dimension(base)) calling sequences return true if expr has the form of valid output from the function convert/dimensions with the base=true option, that is, a function of base dimensions.
 • The type(expr, dimension(derived) calling sequence returns true if expr is a derived dimension with a special name or type(expr, dimension) would return true.
 • If a second option p is given and type/dimension returns true, the function of base dimensions corresponding to expr is assigned to p.

Examples

 > $\mathrm{type}\left(\mathrm{power},\mathrm{dimension}\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{type}\left(\mathrm{power},\mathrm{dimension}\left(\mathrm{derived}\right)\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(\mathrm{convert}\left(\mathrm{watts},\mathrm{dimensions},\mathrm{base}=\mathrm{true}\right),\mathrm{dimension}\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(\mathrm{speed},\mathrm{dimension}\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{type}\left(\mathrm{speed},\mathrm{dimension}\left(\mathrm{derived},p\right)\right)$
 ${\mathrm{true}}$ (5)
 > $p$
 $\frac{{\mathrm{length}}}{{\mathrm{time}}}$ (6)