abs - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Group Theory : Numbers : Integer Functions : abs

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

11

11

(1)

cos3

cos3

(2)

evalf

0.9899924966

(3)

210

20

(4)

a2x3

a:=2x3

(5)

x1

x:=1

(6)

a

1

(7)

The absolute value of a complex number is the modulus.

34I

5

(8)

expr2Iu2v

expr:=2u2v

(9)

expandexpr

2u2v

(10)

combineexpr,abs

2u2v

(11)

assumeu,positive:simplifyexpr

2u~2v

(12)

expr2b4c2d3

expr2:=b4c2d3

(13)

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

b~4c~2d3

(14)

&int;y&DifferentialD;y

&lcub;12y2y012y20<y

(15)

&DifferentialD;&DifferentialD;yy

abs1&comma;y

(16)

&DifferentialD;2&DifferentialD;y2y

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.

Array1..2&comma;1..2&comma;2

2222

(19)

1&comma;2&comma;3&verbar;4&comma;5&comma;6

142536

(20)

Matrix3&comma;fill&equals;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

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam