OpenMaple/Python/Expression/eval - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Home : Support : Online Help : OpenMaple/Python/Expression/eval

eval

evaluate an Expression

 Calling Sequence e.eval() e.eval(n) e.eval(x==a) e.eval(eqns)

Parameters

 e - Expression object n - positive integer x - Name object eqns - list or set of Expressions corresponding to equations

Description

 • eval evaluates the Expression e using the Maple eval function and returns a numeric value or a new Expression object.
 • The calling sequence e.eval() corresponds to the one-argument calling sequence for eval, while all other calling sequences correspond to two-argument invocations of eval.
 • The common use of evaluating an expression at a point may be used with e.eval(x==a).
 •

Examples

The following interactive session illustrates the use of these operators:

 >>> import maple >>> import maple.namespace >>> expr = maple.execute( 'x^2 + 2;' ); >>> # Evaluate the expression at the point x = 2 >>> expr.eval( maple.namespace.x == 2 ) 6 >>> # Replace the symbol x with y >>> expr.eval( maple.namespace.x == maple.namespace.y ) y^2+2