352 Reputation

9 Badges

19 years, 120 days

Stefan Vorkoetter is a Senior Architect at Maplesoft, a position that is a combination of design consultant and developer-at-large.

He has been with Maplesoft since May of 1989 after completing a graduate program at the University of Waterloo under Maplesoft co-founder Gaston Gonnet. During his undergraduate career, he worked part time at UW's Symbolic Computation Group, where the Maple system was born.

Stefan's areas of expertise are in algorithms, data structures, and programming language design and implementation. He has worked extensively on various aspects of the Maple kernel, and more recently, the Modelica compiler component of MapleSim. Despite holding a Master of Mathematics degree, he considers himself a computer scientist first.

Stefan was born in Germany, but immigrated to Canada at the age of three. Like many at Maplesoft, he moved to Waterloo to attend the University of Waterloo, met his wife there, and never left. When not working, Stefan is an active participant in the Norwegian Fjordhorse farm he and Lori call home. He also dabbles in electronics, model and full-scale aviation, music, and collecting slide rules and old calculators, and maintains a web site documenting his hobbies.

MaplePrimes Activity

These are replies submitted by stefanv

As I mentioned previously, colorchar was accidentally omitted from Maple. It will be released in the next Maple 2022 release.

This problem (that the colorchar was omitted) will be included in the 2022 release.

Ensure that interface(plotdevice) returns colorchar. If it does not, issue the command interface(plotdevice=colorchar).

"I'd like an ARM port of the kernel and command-line interface."

@acer : Stay tuned! :-)

@Carl Love I've clarified this in the help pages for the next major release.


An assignment with the same uninitialized variable on both sides is an infinite recursion. Note that the assginment to i outside of the procedure has no effect on the issue. That assigns to the global i, which is not the same variable as the local i.

This is not a problem inside the procedure, because evaluation there is only ever done one level deep. Thus, i is assigned the value i+2, and all is well.

Once you evaluate the expression outside of any procedure, evaluation is done to the full depth of the expression. Thus i is evaluated to i+2, then the i and 2 in that result are evaluated. So, i is evaluated to i+2 again, and then the i and 2 are evaluated again, ad infinitum. Eventually, Maple runs out of stack space and gives the error you are seeing.

This may not help in deciding what terminology to use for the bound variable of seq (or add or mul), but it may help in understanding what is going on ...

The bound variable is actually the instance of the variable currently in scope when seq is invoked. For a call at the top level, the global variable is used. For a call within a procedure, the procedure's local variable is used (it is quietly implicitly declared local if one wasn't declared). The "magic" is that the value of the variable is saved before the seq is carried out, and restored afterwards. The following sessions illustrates this:

> a := 42;
                                    a := 42

> f := proc() global a; print(a); a end:

> seq(f(), a=1..3);



                                    1, 2, 3

> a;

Here we can see that a local is implicitly declared:

> g := proc(n) seq(i,i=1..n) end;
                 g := proc(n) local i; seq(i, i = 1 .. n) end

The quiet implicit declaration of the local was introduced in the last few years. In older versions of Maple, the global variable would be used if no local with the same name was present.

Regardless of whether you use time or CodeTools:-Usage, the reported CPU time will vary.

  • One factor is the granularity of the clock itself, so results can easily vary +/- 1 minimum measurable time interval depending on the points within a time interval that a computation started and finished.
  • System load affect not only real time, but also CPU time due to factors such as effects on the CPU's cache.
  • Maple can ake different execution paths in different orders when the same calculation is run in different sessions and/or structures can be arranged differently in memory, resulting in differences in computation time even though the same result is produced (again, some of this is due to effects on CPU caching).
  • Running the same commands multiple times within the same session will almost always result in different CPU times. Sometimes this can be significantly less due to Maple reusing cached results for part of a computation. Other times, additional memory will be used to rerun the calculation, resulting in more time spent in the garbage collector.

In short, CPU time is deterministic. Running the same large computation repeatedly (in a fresh session each time) should give reasonably consistent CPU times, but they will not be identical.

@Carl Love

Your Wirth syntax diagram for the second form (the in form) is incorrect: The for clause is actually optional.
Indeed, you are correct. Thanks for pointing it out. I have updated the post accordingly.

If you want a column vector, you can use acer's method above, substituting "column" for "row", or you can use the shorter:

< seq(0..20,0.5) >

The nops function returns the number of operands in an expression (e.g. number of terms in a sum, elements in a list, etc.)  It expects exactly one argument.

You should probably be using strings, not names, to represent your letters and words. The single-letter names D and I both have values in Maple. D is a procedure for computing derivatives, and I is the imaginary unit. You can probably get away with D due to last name evaluation, but I evaluates to Complex(1), so that is what gets passed to the 9th call of CountCharacterOccurences instead of the symbol.

> print(D);
proc(f::{array, list, set, algebraic, equation, procedure, appliable_module})

> print(I);

> dismantle(I);

   INTPOS(2): 1

... to store your 9(92) results, as Carl pointed out. I'm afraid I can't answer your question about how to install on Amazon, but as you can see, doing so for this problem would be pointless.

The most compact way to store a 9×9 matrix with 9 possible elements is as the base-2 representation of an 81-digit base-9 number. That would take 257 bits per matrix since ceil(log[2](9^(9^2))) = 257. So your problem is roughly equivalent to storing all possible 257-bit numbers, of which there are 2257.

A 64-bit architecture with physical memory at every address has 264×8 = 267 bits of memory. So assuming bit-level packing, a single fully equipped 64-bit machine could store 267/257, or about 5.7×1017 of your matrices (ignoring space required for the OS, your program, etc.)

That means you would require 2257/(5.7×1017), or approximately 4×1059, Amazon servers, which is a bit more than 100.

Perhaps there is a better way to solve the underlying problem you are trying to solve?

Indeed, interface(ansi=true) is not meant to be used with the worksheet interface(s). Generally it has no effect, but for a few commands like showstat, it does. In the next release, interface(ansi) will be true by default in Windows, but only in cmaple.

Yes, Windows 2000 and up do not support interpretation of ANSI escape sequences (which is what cmaple used to highlight output). As a result, these escape sequences were visible if interface(ansi=true) was set in cmaple for Windows prior to Maple 2018.1. Starting with cmaple 2018.1 for Windows, we use direct calls to the Windows API for this instead.

1 2 Page 1 of 2