Joe Riel

9660 Reputation

23 Badges

20 years, 10 days

MaplePrimes Activity


These are replies submitted by Joe Riel

The help page type/numeric defines a numeric type:
  - The type(x, numeric) function returns true if x is an integer, fraction, or
    finite floating-point number (float).
Pi is none of those, hence not of type numeric. However, it is of type realcons, so you could change the type specification in your Max procedure to realcons and avoid the type matching error. However, that doesn't solve your problem:
  if Pi < 3 then yes else no end if;
Error, cannot determine if this expression is true or false: Pi < 3
You could use evalf in the conditional to evaluate the relation, however, doing so can introduce floating-point round-off issues. The builtin function max handles that by using evalr, which uses range arithmetic.
You are correct, I hadn't realized that. Carl Love (aka DeVore) informed me of the option, it has existed since at least Maple 9. Essentially it prevents the algorithm from recursing into a structure, so only the top-level matches to atype (second parameter) are operated on.
You are correct, I hadn't realized that. Carl Love (aka DeVore) informed me of the option, it has existed since at least Maple 9. Essentially it prevents the algorithm from recursing into a structure, so only the top-level matches to atype (second parameter) are operated on.
Emacs maplev-mode highlights "od" and "fi" the same as it does "end do" and "end if". It would be easy to tweak it to highlight them differently; I'll consider making that a user selectable option. Thanks for the suggestion.
My second suggestion, using the evalindets, has a flaw that can be removed by using the 'flat' option (see the help page for evalindets). This approach is useful if the expression isn't just a list of lists. For example,
test := [[1,2],[3,4,5+a,[a,b]],3]:
evalindets[flat](test, algebraic, `/`);
                   [[1, 1/2], [1/3, 1/4, 1/(5+a), [1/a, 1/b]], 1/3]
Omitting the 'flat' option gives a different result (note the effect on 5+a):
evalindets(test, algebraic, `/`);
                   [[1, 1/2], [1/3, 1/4, 1/(1/5+1/a), [1/a, 1/b]], 1/3]
My second suggestion, using the evalindets, has a flaw that can be removed by using the 'flat' option (see the help page for evalindets). This approach is useful if the expression isn't just a list of lists. For example,
test := [[1,2],[3,4,5+a,[a,b]],3]:
evalindets[flat](test, algebraic, `/`);
                   [[1, 1/2], [1/3, 1/4, 1/(5+a), [1/a, 1/b]], 1/3]
Omitting the 'flat' option gives a different result (note the effect on 5+a):
evalindets(test, algebraic, `/`);
                   [[1, 1/2], [1/3, 1/4, 1/(1/5+1/a), [1/a, 1/b]], 1/3]
I see no evidence here that this is a bug. Rather, the mw format is different from your expectation.
The help page for verify,symbol is explicit about what it does:
  The verify(expr1, expr2, symbol) calling sequence returns true if the two
  symbols "appear the same". The result can be different from that produced by
  the evalb routine if either symbol has assumptions or is an escaped local. 
I don't understand your issue with `:=`. It is not assigned anything in Maple 11, so I don't see how your description could occur unless there is a conversion issue when you "piped the output to tty maple". I cannot reproduce that. Could you post your input file? I tried the following:
$ echo '`:=`(a,2);a;' | maple11 -q 
                                            :=(a, 2)

                                              a
which is what I expected.
Congratulations, Jacques, on your 1000th post to MaplePrimes. Alas, your leaf hasn't changed...
Missing, alas, is an identity function. I've suggested assigning `()` for this, since it is equivalent to a sequence constructor. That is, `()`(a,b,c) would return the sequence a,b,c.
Missing, alas, is an identity function. I've suggested assigning `()` for this, since it is equivalent to a sequence constructor. That is, `()`(a,b,c) would return the sequence a,b,c.
It isn't clear which part suprised the original poster: the backquotes around the not or the use of the ampersand. The latter is standard technique for function composition; it isn't the most efficient way to do this, so you won't see it much if you look at Maple library code, but it is a convenience when calculating with Maple. The backquoted not is a different animal altogether. As mentioned earlier in this thread, the backquotes are necessary because not is a Maple keyword (see ?keyword). However, that only explains why `not` doesn't generate a syntax error. It works because the name `not` is assigned a builtin procedure that negates a boolean. Most (if not all) Maple keywords that correspond to inline operators have equivalent functional forms:
a and b       = `and`(a,b)
a implies b   = `implies`(a,b)
a in b        = `in`(a,b)
a intersect b = `intersect(a,b)
a minus b     = `minus`(a,b)
a mod b       = `mod`(a,b)  # almost.  `mod` is actually assigned modp or mods...
not a         = `not`(a)
a or b        = `or`(a,b)
a subset b    = `subset`(a,b)
a union b     = `union`(a,b)   # can take multiple arguments
a xor b       = `xor`(a,b) 
Note that the equivalent keywords done, stop, and quit also have corresponding functions. These can be used with command-line maple to return an error code and, unlike the keywords, can be called from inside procedures.
It isn't clear which part suprised the original poster: the backquotes around the not or the use of the ampersand. The latter is standard technique for function composition; it isn't the most efficient way to do this, so you won't see it much if you look at Maple library code, but it is a convenience when calculating with Maple. The backquoted not is a different animal altogether. As mentioned earlier in this thread, the backquotes are necessary because not is a Maple keyword (see ?keyword). However, that only explains why `not` doesn't generate a syntax error. It works because the name `not` is assigned a builtin procedure that negates a boolean. Most (if not all) Maple keywords that correspond to inline operators have equivalent functional forms:
a and b       = `and`(a,b)
a implies b   = `implies`(a,b)
a in b        = `in`(a,b)
a intersect b = `intersect(a,b)
a minus b     = `minus`(a,b)
a mod b       = `mod`(a,b)  # almost.  `mod` is actually assigned modp or mods...
not a         = `not`(a)
a or b        = `or`(a,b)
a subset b    = `subset`(a,b)
a union b     = `union`(a,b)   # can take multiple arguments
a xor b       = `xor`(a,b) 
Note that the equivalent keywords done, stop, and quit also have corresponding functions. These can be used with command-line maple to return an error code and, unlike the keywords, can be called from inside procedures.
Did you change the assignment statement
griidir := "/usr/local/share/maple/apps/grii";
to something appropriate for your setup? It needs to point to the location of grii.
That can be avoided by selecting the symbol (subscript and all), right-clicking, and selecting 2D Math -> Convert To -> Atomic Identifier. You could also select the 'subliteral' symbol in the Layout palette or the `a[n]` symbol in the Expression palette.
First 160 161 162 163 164 165 166 Last Page 162 of 195