simplify/constant - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Algebra : Expression Manipulation : Simplifying : simplify/constant

simplify/constant

simplify constant expressions typically containing radicals and functions with exact numeric arguments

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

simplify(expr, constant)

Parameters

expr

-

expression

constant

-

literal name; constant

Description

• 

The simplify(expr, constant) calling sequence is used to simplify expressions that are of type,constant and typically contain radicals or mathematical functions having exact numeric arguments.

  

The approach used consists of applying a set of simplification procedures (SP) in two steps:

  

1) The constant objects, in the form of sums, products, or function calls, are simplified using SP, starting with the inner most one and composing simplifications at each step. The routines can handle with reasonable efficiency products of fractional powers, exponentials, and various functions calls together with their multiplicative inverses.

  

2) When the resulting expression still contains radicals, the simplification procedure applied to each object in the previous step is applied once more, this time to the whole expression.

• 

The simplification procedures SP used in the itemization above consist of analyzing the Real and Imaginary parts of the expression in order to conclude about possible cancellations or simpler representations. In addition, if the expression or subexpression can be evaluated numerically fast, using hardware floats, this information is used as a starting point to determine an exact rational value for the object, if that value exists.

  

The simplify/constant routines do take assumptions into account up to the point Re, Im, and abs take them.

  

The simplification of constant subexpressions entering input for simplify is performed automatically. However, to invoke this set of simplification routines, call simplify with the extra argument constant.

Examples

e11+2cos2π72cos3π72cos1π7

e1:=1+2cos27π2cos37π2cos17π

(1)

simplifye1,constant

0

(2)

How it works.

e1

0

(3)

The following example has a more complex step.

e2167117+147+127137+1157

e2:=16/711/7+14/7+12/713/7+115/7

(4)

e2

16/711/7+14/7+12/713/7+115/7

(5)

Manipulate the real and imaginary parts.

simplifye2,constant

0

(6)

This example shows that these simple manipulations of the real and imaginary parts are not enough, but the expression is (in this case by construction) equal to a rational number.

e3e21753

e3:=16/711/7+14/7+12/713/7+365315/7

(7)

simplifye3,constant

1753

(8)

The following example has nonelementary functions.

e41Ψ1,18πcsc1π864Γ78+1Ψ182πcsc1π864Γ781πΨ1,1864sin1π8Γ781πΨ18264sin1π8Γ78+1

e4:=164Ψ1,18πcsc18πΓ78+164Ψ182πcsc18πΓ78164πΨ1,18sin18πΓ78164πΨ182sin18πΓ78+1

(9)

simplifye4,constant

1

(10)

The following example has powers of trigonometric functions.

e51200cos3π72cos1π77+128cos3π7674cos3π7120cos3π7cos1π7192cos3π7571200cos2π72cos3π77+128cos2π767+4cos2π7120cos3π7cos2π7+192cos2π757+1200cos2π7cos1π727+128cos1π7674cos1π7120cos1π7cos2π7192cos1π757

e5:=12007cos37π2cos17π+1287cos37π647cos37π120cos37πcos17π192cos37π512007cos27π2cos37π+1287cos27π6+47cos27π120cos37πcos27π+192cos27π5+12007cos27πcos17π2+1287cos17π647cos17π120cos17πcos27π192cos17π5

(11)

simplifye5,constant

166

(12)

In cases as the following one (extracted from some integration problems):

e61IⅇIEi1,I21Ei1,Isin12+1IEi1,Icos121Ei1,Isin121IEi1,Icos12+1IⅇIEi1,I2

e6:=12IⅇIEi1,I12Ei1,Isin1+12IEi1,Icos112Ei1,Isin112IEi1,Icos1+12IⅇIEi1,I

(13)

The whole expression cannot be simplified by means of Re, Im, or abs.

e6

12IⅇIEi1,I12Ei1,Isin1+12IEi1,Icos112Ei1,Isin112IEi1,Icos1+12IⅇIEi1,I

(14)

It cannot be evaluated using hardware floats.

evalhfe6

Error, unsupported type `('complex')('float')` in evalhf

Some subexpressions of it can be simplified by properly manipulating these procedures and that suffices to collapse the original problem into something within the scope of these simpler manipulations, here leading to the following.

simplifye6,constant

0

(15)

The simplification routines for constant expressions is also used by simplify to simplify certain type of constant subexpressions found inside non-constant expressions

e7121241+21212+22212212π+2212212π212+2π122212212+π122122212212+2x2212212+x21222122122221221221211+2122

e7:=12241+2+2222π+222π2+2π222+π2222+2x222+x2222222211+22

(16)

typee7,constant

false

(17)

simplifye7

π+π+x2

(18)

See Also

abs

evalhf

Im

Re

simplify

 


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