Joe Riel

9660 Reputation

23 Badges

20 years, 2 days

MaplePrimes Activity


These are replies submitted by Joe Riel

I believe that in older versions of the Maple, the following would throw an error:
 

kernelopts('assertlevel'=2):
proc() local i :: string; seq(i, i=1..3); end proc();

However, I may be confusing that with the following

protect(i): seq(i, i=1..3);
Error, attempting to assign to `i` which is protected.  Try declaring `local i`; see ?protect for details.

That used to cause a problem if the call to seq where in a procedure where i was not declared; seq would use the global variable which was protected and would thus throw an error. Fortunately that no longer occurs (not sure why).

@Rouben Rostamian  In maple 2020 I get

      Pi*(piecewise(j+k = 0,1,0)+piecewise(j-k = 0,1,0))

@Anthrazit Plenty of engineers prefer the way that Maple's rounding works.  My old HP 15C has three modes: fixed, scientific, and engineering.  Fixed is the style you want, retaining a fixed precision after the decimal.  Scientific and Engineering both keep the total number of digits constant; engineering keeps the exponent a multiple of 3. As an electrical engineer I exclusively used the engineering mode.  Fixed precision is more useful when addition is the primary operation, which is certainly the case for accounting and possibly structural engineering. Once multiplication is involved it makes less sense.

@Carl Love I'll be investigating this.  Thanks for the report.

@Lisa6 I believe the default install directory is /opt/maple2020.  Can you launch maple with /opt/maple2020/bin/xmaple?  Because I normally launch maple from the command line, I put links in a bin file in $PATH to the desired executables.

@mmcdara I don't quite understand how finding all types that describe an expression will help you.  However, I can make the package available and you can play with it.  I'll upload it to Maple Cloud, after first writing a few help pages and maybe extending it to handle any new relevant types.

Could you give an example?  Am trying to understand the point of calling DEBUG() at the top-level.

@emendes Agreed it is not what you want.  How about giving a simple example that shows what you want. Eliminate all cruft so it is clear.  For example, given

L := [c1*x + c2*x^2 + c3*x*y + z, c4*z^2]:

What do you want as the output?

It's somewhat unusual to map a function that returns an expression-sequence over a list; the resulting list may have a different number of elements than the original.  Using coeffs is probably not what you want.  Maybe you want something like

L := [x+2*y+3*z, z]:
map2(map2,coeff,L,[x,y,z]);
                          [[1, 2, 3], [0, 0, 1]]

@Carl Love What's the purpose of checking whether ind is NULL? Seems unnecessary in that the search will have stopped.  Maybe I'm missing something.

@Carl Love It might be useful to have a procedure that would convert such strings to use unicode, and vice-versa.

@Carl Love That works in Standard, but is a different string than the one that is supposed to appear in the help page.  StringTools:-Length returns 15 for it.

@lplex The negative values come from the one byte integers being interpreted as negative values (because they are greater than 127). Note that 3038 = 19510 and 195 + 61 = 256, as expected.

@lplex You can just paste that string in there.  I don't know whether there is a convenient way to enter it from the keyboard. You can do it programatically.

s := String(Array([100,-61,-87,99,101,109,98,101,114],'datatype'=integer[1]));
# convert back to an Array
Array(s);

The problem with the Length example is that the help page is incorrect.  A unicode character that is in the source used to generate the help page appears as pseudo-octal notation in the given string, which is parsed by Maple as just the string with the backquotes omitted. Here's what it should look like

StringTools:-Length("décember");
                                        9
First 14 15 16 17 18 19 20 Last Page 16 of 195