## 8131 Reputation

15 years, 64 days

## Syntax of the Maple Worksheet (mws) Form...

Maple
A member recently asked for a description of the mw or mws worksheet format. Click on the following link to download a pdf that I created a couple years ago that describes the syntax of the older mws format. It isn't complete, but covers most of the constructs that one is likely to need. To get a good practical understanding of the mws format, I wrote mws-mode.el, an emacs-mode that displays mws files in a structured manner. Download 84_mws-syntax.pdf

## Preview Messages...

Private messages allow the use of markup tags. However, the only action is "submit"; I cannot preview the message to ensure that my inserted markup is correct.

## Collecting Symbolic Powers of a Polynomi...

Maple
In response to a question about collecting symbolic powers of polynomials, I suggested a few lines of code that solved the particular problem. Following is a procedure that enhances the technique to mimic, to some degree, the abilities of Maple's collect procedure, which handles integral powers. This enhanced version can take a list of indeterminates. It also permits use of an optional third argument, func, that is applied to the collected coefficients of a power.

## ListBuffer, a procedure for efficiently ...

dcasimir asks for an efficient way to create a list of the first n primes, without invoking nextprime, etc. An easy way to do this is to use a do loop to build up a sequence term by term. However, as Alec points out, this is not an efficient technique in Maple. It runs as O(n^2), where n is the number of items in the sequence. A way to avoid the inefficiency is to forego building a sequence and instead insert the items into a table. Then, after exiting the loop, convert the table to a list.

## Extracting the constant term of a multiv...

Consider the task of extracting the constant-term from a multivariate polynomial. This seems a common operation; I expected that there would be a predefined command for doing it. Alas, I could not find one. The usual suspects, coeff and tcoeff, do not directly do the job: coeff does not work with multivariate polynomials and tcoeff returns the coefficent of the lowest-order term, which may not be the zero-order term. Here are two simple procedures that implement different ways of solving this problem:
 First 10 11 12 13 14 15 16 Page 12 of 16
﻿