allvalues
compute all possible values of expressions involving RootOfs
Calling Sequence
Parameters
Description
Examples
allvalues(expr)
allvalues(expr, opt1, opt2, ...)
expr
-
algebraic expression, Matrix, Vector, list, or set of expressions
opt1, opt2, ...
(optional) sequence of options
Typically, a RootOf represents more than one value. Thus, expressions involving RootOfs generally evaluate to more than one value or expression. The allvalues command returns, in an expression sequence, all such values (or expressions) generated by the combinations of different values of the RootOfs.
The allvalues command attempts to find symbolic representations of the roots using solve. If in calling solve it returns only a partial set of roots and sets _SolutionsMayBeLost to true, then allvalues sets the global variable _ValuesMayBeLost to true and continues to work with set of partial solutions.
- For roots of polynomials, allvalues attempts to return representations in terms of radicals, unless option 'implicit' is specified (see below). If no such expression is found, then indexed RootOfs are used.
- For roots of expressions that are not polynomials, symbolic representations may or may not be available:
When symbolic solutions are found, note that some solutions may be missing. In some cases, the solution set is parametrized by names with the following prefix: _Z is for integer values, _NN for non-negative integer values, _B for boolean values (0 or 1). See also solve.
If solve cannot find symbolic representations of the roots, then fsolve is used to search for numerical approximations. If numerical approximations are found, RootOfs with a numerical selector are returned. If it cannot be determined that fsolve has found all the roots, then the global variable _ValuesMayBeLost will be set to true.
If no symbolic representation nor numerical approximations are found, the RootOf is not expanded. However, if Maple can prove that there is no complex solutions to the equation corresponding to the RootOf, NULL is returned.
The following options are supported:
- The name 'independent' or 'dependent': If the option 'dependent' is given, then a particular RootOf⁡p represents the same root at each occurrence within expr. This is the default. In contrast, if the option is 'independent', then each occurrence of RootOf⁡p is to be treated independently. This option has no effect on RootOfs containing a selector that makes them single-valued.
- The name 'explicit' or 'implicit': If the option 'explicit' is given, then allvalues tries to find radical expressions for roots of polynomials. This is the default unless _EnvExplicit has a numerical value. In the latter case only the input of length smaller than that value will be made explicit. If the option 'implicit' is given, then indexed RootOfs are used.
- A RootOf or a set of RootOfs: The RootOfs specified is not expanded by allvalues and remains inert.
The allvalues command takes selectors of RootOf into account:
- If the selector is a numerical approximation, then the RootOf is considered as a single-valued object, namely the closest root to the selector.
- If the selector is a range, then the roots are sought in this range.
- If the selector is an index of the form index=expr1, then the RootOf is considered as a single-valued object, except when expr1 is a set or a range.
- If the selector is a label of the form label=expr2, then the RootOf is viewed as a multi-valued object.
Nested RootOfs are supported by allvalues.
e1≔RootOf⁡_Z2−1+1RootOf⁡_Z4−12
allvalues⁡e1
2,0,0,−2,2,0,0,−2
e2≔RootOf⁡_Z3−1
allvalues⁡e2
1,−12+I⁢32,−12−I⁢32
allvalues⁡e2,implicit
1,RootOf⁡_Z2+_Z+1,index=1,RootOf⁡_Z2+_Z+1,index=2
f1≔RootOf⁡x−1⁢cos⁡x−x
f1≔RootOf⁡_Z−1⁢−cos⁡_Z+_Z
allvalues⁡f1
1,RootOf⁡−cos⁡_Z+_Z,0.7390851332,RootOf⁡−cos⁡_Z+_Z,−2.486885699+1.809361341⁢I,RootOf⁡−cos⁡_Z+_Z,−2.486885699−1.809361341⁢I
f2≔RootOf⁡x+1⁢cos⁡x−x,1
f2≔RootOf⁡_Z+1⁢cos⁡_Z−_Z,1
allvalues⁡f2
RootOf⁡−cos⁡_Z+_Z,1
allvalues⁡sin⁡RootOf⁡_Z2−a2⁢RootOf⁡_Z2−1
sin⁡a2,−sin⁡a2,−sin⁡a2,sin⁡a2
e3≔RootOf⁡_Z2−1+RootOf⁡_Z2−2
allvalues⁡e3,RootOf⁡_Z2−2
1−RootOf⁡_Z2−2,−1−RootOf⁡_Z2−2
allvalues⁡e3,RootOf⁡_Z2−2,implicit
RootOf⁡_Z2−1+RootOf⁡_Z2−2,index=1,RootOf⁡_Z2−1+RootOf⁡_Z2−2,index=2
allvalues⁡e3,e3
RootOf⁡_Z2+2−1,RootOf⁡_Z2−2−1
allvalues⁡e3,e3,RootOf⁡_Z2−2
RootOf⁡_Z2−1+RootOf⁡_Z2−2
e4≔RootOf⁡_Z2−1−1RootOf⁡_Z2−1
allvalues⁡e4
0,0
allvalues⁡e4,independent
0,−2,2,0
e5≔allvalues⁡RootOf⁡_Z5−_Z+1
e5≔RootOf⁡_Z5−_Z+1,index=1,RootOf⁡_Z5−_Z+1,index=2,RootOf⁡_Z5−_Z+1,index=3,RootOf⁡_Z5−_Z+1,index=4,RootOf⁡_Z5−_Z+1,index=5
evalf⁡e5
−1.167303978,−0.1812324445−1.083954101⁢I,−0.1812324445+1.083954101⁢I,0.7648844336−0.3524715460⁢I,0.7648844336+0.3524715460⁢I
e6≔RootOf⁡x2−2+RootOf⁡x2−2,index=1
e6≔RootOf⁡_Z2−2+RootOf⁡_Z2−2,index=1
allvalues⁡e6
2⁢2,0
allvalues⁡e6,implicit
2⁢RootOf⁡_Z2−2,index=1,RootOf⁡_Z2−2,index=2+RootOf⁡_Z2−2,index=1
e7≔RootOf⁡_Z2−2,label=1+RootOf⁡_Z2−2,label=2
allvalues⁡e7
2⁢2,0,0,−2⁢2
e8≔RootOf⁡sin⁡_Z
allvalues⁡e8
π⁢_Z3~
e9≔RootOf⁡exp⁡_Z
e9≔RootOf⁡ⅇ_Z
allvalues⁡e9
e10≔solve⁡x2+y2−3,y+12−x−1
e10≔x=−RootOf⁡_Z2+3⁢_Z+3−3,y=RootOf⁡_Z2+3⁢_Z+3,x=RootOf⁡_Z2+_Z−1+1,y=RootOf⁡_Z2+_Z−1
map⁡evalf@allvalues,e10
x=−1.500000000−0.8660254040⁢I,y=−1.500000000+0.8660254040⁢I,x=−1.500000000+0.8660254040⁢I,y=−1.500000000−0.8660254040⁢I,x=1.618033988,y=0.6180339880,x=−0.6180339880,y=−1.618033988
See Also
convert/radical
evala
fsolve
RootOf
solve
Download Help Document