abs - Maple Help

Online Help

All Products    Maple    MapleSim


abs

The absolute value function

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

abs(x)

x

abs(n, x)

 

Parameters

x

-

expression or rtable

n

-

positive integer

Description

• 

The abs function returns the absolute value of the expression x.

• 

You can enter the command abs using either the 1-D or 2-D calling sequence. For example, abs(-11) is equivalent to −11.

• 

If x is an rtable (Array, Matrix, or Vector), the abs function applies the abs function to each entry in the table, and returns the resulting rtable.

• 

If x includes a function f, then abs will attempt to execute the procedure abs/f to determine the absolute value of the corresponding part of x.  The user can thus easily extend the functionality of abs.

• 

The derivative of abs is denoted by abs(1, x). This is signum(x) for all non-0 real numbers, and is undefined otherwise. Neither first order nor higher order derivatives of abs can be determined if x is an rtable.

• 

Higher order derivatives of abs are denoted by abs(n, x), where n is a positive integer.  When n is known, the expression is automatically simplified to the appropriate expression in a derivative of either signum or abs.

Examples

abs11

11

(1)

abscos3

cos3

(2)

evalf

0.9899924966

(3)

abs210

20

(4)

aabs2x3

a2x3

(5)

x1

x1

(6)

a

1

(7)

The absolute value of a complex number is the modulus.

abs34I

5

(8)

exprabssqrt2Iu2v

expr2u2v

(9)

expandexpr

2u2v

(10)

combineexpr,abs

2u2v

(11)

assumeu,positive:simplifyexpr

2u~2v

(12)

expr2absb4c2d3

expr2b4c2d3

(13)

assume0<b&comma;0<c&colon;simplifyexpr2

b~4c~2d3

(14)

intabsy&comma;y

y22y0y220<y

(15)

diffabsy&comma;y

abs1&comma;y

(16)

diffabsy&comma;y&comma;y

signum1&comma;y

(17)

abs2&comma;y

signum1&comma;y

(18)

To find the absolute value of a Matrix, use the absolute value function as written in 1-D Math, to avoid confusion between the function abs and the determinant of the Matrix.

absArray1..2&comma;1..2&comma;2

2222

(19)

abs1&comma;2&comma;3|4&comma;5&comma;6

142536

(20)

absMatrix3&comma;fill=1

111111111

(21)

The derivative of the absolute value of an rtable cannot be determined, so an error results.

abs1&comma;rtable1..2&comma;1

Error, invalid input: `simpl/abs` expects its 2nd argument, a2, to be of type algebraic, but received Array(1..2, [-1,-1])

See Also

convert/abs

convert/piecewise

evalc

initialfunctions

piecewise

rtable

signum