# Updating Maple Worksheets

The original Maple Release 5 Classic Maple .mws worksheets accompanying the book Discovering Mathematics with Maple by by R.J. Stroeker and J.F. Kaashoek by have been updated here to Standard Maple 12 .mw worksheets and the linalg package has been updated to the LinearAlgebra package. This web page records the remaining updated commands.

### Initial updating to Maple 9 Classic

Quite a few changes have taken place in MAPLE commands since Release 5. The R5 files on the textbook CD require further updating of certain Maple commands (September 2004):

• log(x) (intended as the common logarithm, base 10 in pre-MapleV6) is now defined to be ln(x) so if you want the base 10 log function you need log(x) or log10(x).
• the ditto operator for the last maple output was %, now is #
• the concatenation operator was "." and now is "||" to join strings into a single string after they have been evaluated, for defining a sequence of symbols v1, v2,... by seq(v||j,j=1..3)
• allvalues must be composed with evalf now to achieve the same result as in previous versions 4 and 5: allvalues(stuff) -> evalf(allvalues(stuff))
• in chapter 6, the convert(seq(...,i=1..100),`+`) construction to add a sequence of numbers seems to derail for the 100 term sequence, so one can replace it using the "add" construction:
• singularvals now does give the singular values ordered by decreasing value as desired for simple small matrices, but apparently not in cases where allvalues is still needed, so in chapter 6 using instead the diagonal values of the appropriate matrix is apparently still necessary
• in chapter 6 the small roundoff errors in the singular value decomposition can be "trimmed" with the useful command "fnormal" if desired

Those on-line here have been updated. By adding the "s" to the .mw file extension of the Standard worksheet URL links on-line here, one obtains these Classic linalg .mws worksheets.

### 2008 Update to Standard Maple 12 with the LinearAlgebra package

In August 2008 these files were updated to Standard Maple .mw worksheets in Maple 12, with the linalg package replaced by the LinearAlgebra package. A few new additional changes were necessary.

As a first step, all the files were opened in WordPad and the string ".mws" was replaced by ".mw" so that all the hyperlinks would refer to the new file extension.

Next to convert the Classic .mws worksheets to Standard .mw worksheets, the Classic files were opened in Standard Maple and saved to Standard files.

Then through the Format Menu, "styles" selection, select "C 2d input", and hit the "modify" button, then the "Restore to Default" button to get the default 2D input for such worksheets for new input regions, then each group of inputs must be selected and right click, "convert to", "2d math input". Save this.

[Before converting multi-prompt lines of input, the additional prompts have to be deleted first by putting the cursor at the beginning of each additional line of input with a prompt and hitting the BkSp key. Otherwise the conversion process is tripped up. This is true of many multiline procedure definitions in the book.]

Then go through executing the commands line by line seeing the complaints from Maple. A little imagination is required to convert from linalg to LinearAlgebra since a few things do not have corresponding actions in the new package. I tried to make the minimum changes necessary to the text (some things had to be removed because updated Maple commands made them irrelevant) and mark some updated references to the 2d math interface with

[Maple Update: (or initially Update Note) <I will have to make these uniform later>
...]

• the "if ... fi" construction changed to "if ... end if"
• the "od ... do" construction changed to "do ... end do"
• readlib is no longer necessary
• _seed has been changed to randomize to set the seed integer for the rand command
• the discussion of the old procedure rand() is now disconnected from the new procedure rand()
• the cumbersome DotProduct(x,y,conjugate = false) command from LinearAlgebra is needed for symbolic vectors since otherwise the complex conjugate of the left factor is introduced
• for some reason the Maple 12 2d math interpreter will not accept an if construction for the arrow function definition needed occasionally in Matrix and Vector; this needs to be fixed by Maplesoft, see matw3a.mw and vects6.mw.
This was indeed a bug, instead use the long form
> f:= proc(i,j) if i<j then 1 elif 0 end if end proc

• for some reason the 2d math input interpreter will not interpret some of the Matrix products with matrix symbols adjacent separated by a space, so the cumbersome command MatrixMatrixMultiply(A,B) or the simpler A.B (period separator implies matrix multiplication) has to be used in those cases, this needs to be fixed by Maplesoft, see vects6.mw

• in worksheet deriva5a.mw, the function definition in combination with an if construction fails, as noted above.

• in worksheet deriva5b.mw, assignment 3, the antiderivative function defined by an inert integral plots differently from the expression obtained with "value": chapter5/valueInterror.mw

• Chapter 6.
in the singular value decomposition, the SingularValues command handles the matrices differently from singularvals(M,U,V) , namely SingularValues(M,output = ['U','Vt']) with an additional transpose thrown in.
The "diagonalized form" is then Transpose(U) M Transpose(Vt).