evaluate inert functions - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Evaluation : value

value - evaluate inert functions

Calling Sequence

value(f)

Parameters

f

-

any mathematical expression

Description

• 

When Maple has two functions of the same name where one begins with a capital letter and one with lower case, the capitalized function is frequently an inert representation of the lower case function. More generally, any function whose name starts with the % character, as in %F, is an inert representation for the function F. This feature provides inert representations for any Maple or user-defined function.

• 

During computations, inert functions remain unevaluated (the operations they represent remain unperformed). The value command maps these inert functions, such as Int or %exp, into the corresponding active functions int and exp. Note that, irrespective of the value command, while computing with inert functions, the differentiation, expansion, and printing properties of the active functions they represent (when defined using extension mechanisms, such as routines like `diff/F`) are automatically taken into account by the system.

• 

The value function can also be extended to evaluate any function call, say F, even if there is no active version of it, by defining a procedure named `value/F` which takes the same arguments as F (for example, F(x)) and returns the desired evaluation.

Examples

The active form of int returns the evaluated integral.

intx,x

12x2

(1)

The inert form (Int) returns the unevaluated integral.

F:=Intx,x

F:=∫xⅆx

(2)

Use value to evaluate the integral when desired.

valueF

12x2

(3)

Some frequently used inert representations:

G:=Limitsinxx,x=0

G:=limx→0sinxx

(4)

valueG

1

(5)

valueSumi,i=1..n+5

12n+1212n+92

(6)

In this example an evaluation rule is defined for B even when there exists no corresponding active function

`value/B`:=a,b→binomiala,b

value/B:=a,b→binomiala,b

(7)

valueB10,5

252

(8)

The value command understands any function whose name starts with the % character as being an inert function

F:=x→x2+1

F:=x→x2+1

(9)

%Fa

%Fa

(10)

value

a2+1

(11)

The same inert representation mechanism works with any Maple function or procedure

%GAMMA12

%GAMMA12

(12)

value

π

(13)

intg:=%intatⅇx+1,x=Hx

intg:=∫Hxⅇx+1ⅆx

(14)

valueintg

ⅇHx+Hx

(15)

Any differentiation, expansion or printing rule defined using the extension mechanism (e.g routines `diff/F`) are automatically taken into account by the system

ⅆⅆx%GAMMAx

ΨxΓx

(16)

%diffΓx,x

%diffΓx,x

(17)

value

ΨxΓx

(18)

%eval%diff%expx,x,x=0

%eval%diff%expx,x,x=0

(19)

value

1

(20)

With package commands, the mapping from inert to active is performed taking into account the last package loaded at the time of performing the operation. For instance, a Transpose command exists in different packages with different meanings; in this example LinearAlgebra is the last package loaded, so that LinearAlgebra:-Transpose is the active form of the inert %Transpose

withLinearAlgebra,Transpose:

A:=Matrixa,b,c,d

A:=abcd

(21)

%TransposeA

%Transposeabcd

(22)

value

acbd

(23)

The inert representation also works with indexed functions, for instance as those used in the Physics package

withPhysics,KroneckerDelta

KroneckerDelta

(24)

%KroneckerDeltaa,a

%KroneckerDeltaa,a

(25)

value

1

(26)

See Also

Active and Inert Functions, DESol, Diff, eval, Eval, exp, GAMMA, hypergeom, Hypergeom, int, Int, Intat, limit or Limit, LinearAlgebra, normal, Normal, Physics, product or Product, RESol, sum, Sum


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