Application Center - Maplesoft

App Preview:

Classroom Tips and Techniques: Custom and Task Palettes

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application




 

Classroom Tips and Techniques: Custom and Task Palettes

NULL

Robert J. Lopez

Emeritus Professor of Mathematics and Maple Fellow

MaplesoftNULL

 

Introduction

NULL

Custom palettes and the Task palette are new in Maple 16. Although the same underlying technology drives both, they perform different functions and have different mechanisms for their use.

 

A Custom palette is a user-installed and user-populated palette that can be added to either column of the built-in palettes. They are populated with any Task Template that appears in the Task Browser Table of Contents. Since it is possible for a user to add Task Templates to the Task Browser, it is therefore possible to add a palette containing pointers to any Task Template a user might create. Remember, Task Templates that are added to the Task Browser must be created one to a worksheet, although multiple tasks can be stored in a single hdb file. (For a discussion of how to build and store Task Templates, click here.)

 

The Task palette is a permanent built-in palette, new in Maple 16, that is populated with Task Templates built "on the fly" by selecting content in a document or worksheet, and from its Context Menu, selecting the Create Task option. Tasks so created reside in a special tasks.hdb file stored in a location other than the one that stores tasks appearing the Task Browser. Note, too, that multiple selections from a single worksheet can become multiple tasks that are sent to the Task palette.

 

Details

Custom Palettes

NULL

To create a Custom palette, use the AddPalette command from the DocumentTools package. For example, use

 

DocumentTools:-AddPalette("PaletteName", location = "left", position = "top", store = true)

 

The quotes are necessary, as the quoted items must be seen as strings. The location option places the new palette either in the left or right columns of palettes. The position option places the new palette at the top of the stack of existing palettes. The store option is necessary if Maple is to remember this new palette. If this option is not included, the palette will exist only for the session in which the AddPalette command was executed.

 

The palette file, Tasks_PaletteName.mpalette, has an operating-system dependent default location, detailed below.

 

Of course, to remove a Custom palette, use the RemovePalette command from the DocumentTools package. For example, use

 

DocumentTools:-RemovePalette("PaletteName")

 

The Custom palette is populated with task templates that are already part of the help system, and therefore appear in the Task Browser Table of Contents. These task templates can be the built-in ones that come with Maple, or can be user-generated. To add a task template to a Custom palette, use the AddPaletteEntry command in the DocumentTools package. For example, use

 

DocumentTools:-AddPaletteEntry("TaskName", palette = "PaletteName")

 

The "task name" is the name given to the task when it is first stored in an hdb (help data base) file. This is a relatively short name, with no spaces. When a task that has been saved in Maple is inserted into a worksheet from the Task Browser Table of Contents by clicking on one of the Insert buttons, its hdb name will appear in the short "recall" list under the word "Browse..." in the Tools/Tasks menu. This is the name that is to be used for "TaskName" in the AddPaletteEntry command. (Details can be found here.)

 

To remove a task template from the Custom palette, use the RemovePaletteEntry command from the DocumentTools package. For example, use

 

DocumentTools:-RemovePaletteEntry("TaskName", palette = "PaletteName")

 

For additional help on these four commands:

 

• 

See AddPalette  for details on the AddPalette command.

• 

See RemovePalette  for details on the RemovePalette command.

• 

See AddPaletteEntry  for details on the AddPaletteEntry command.

• 

See RemovePaletteEntry  for details on the RemovePaletteEntry command.

• 

Tasks can be represented by palette icons. See AddIcon .

 

Other relevant help pages tell about , and sharing a Custom palette . However, as these pages are read, keep in mind that they refer to the Custom palette as a "snippets" palette.

 

The Task Palette

NULL

A built-in palette, called the Task palette, is designed to contain task templates generated from the Create Task option in the Context Menu of any selection in a worksheet or document. Make a selection in a worksheet, bring up the Context Menu, and at the bottom find the option "Create Task". Selecting this option launches a dialog that points out that the container file (tasks.hdb) doesn't exist, and should it be created. Once this file exists, the dialog no longer appears.

 

The careful observer will note that in Windows7 the dialog displays the path for Windows XP, namely, HOME\Application Data\Maple\16, but the tasks.hdb file actually goes to the proper location, namely, HOME\AppData\Roaming\Maple\16. (The HOME directory is detailed in Table 1, below. It can also be found by issuing the Maple command kernelopts(homedir).)

 

To remove a task template from the Tasks palette, use the RemoveTask command from the DocumentTools package. For example, use

 

DocumentTools:-RemoveTask("TaskName") 

NULL

File Placement

 

Table 1 gives the default locations of the Tasks_PaletteName.mpalette and tasks.hdb files. The HOME directory varies for the different operating systems, but can be found by executing the Maple command kernelopts(homedir).

 

Operating System

Default File Location

Windows® XP 

HOME\Application Data\Maple\16\

Windows® 7 and Windows Vista®

HOME\AppData\Roaming\Maple\16\

Mac®

HOME/Library/Preferences/Maple/16/

Linux® and UNIX®

~/.maple/16/

Table 1   Default Windows locations for the Tasks_PaletteName.mpalette and tasks.hdb files

 

These are not the ideal locations for Tasks-userid.hdb, a file of task templates that are to appear in the Task Browser Table of Contents, and/or a Custom palette. In these default locations, any hdb file with the word "tasks" in it will have their tasks appear in the Tasks palette as well as in a Custom palette. It is really wise to move any such hdb to another location. Table 2 gives the optimal locations for all three types of files, namely, Tasks_PaletteName.mpalette, Tasks-userid.hdb, tasks.hdb.

``

System

Tasks_PaletteName.mpalette

Tasks-userid.hdb

tasks.hdb

Windows XP

HOME\maple\toolbox\tasks\lib

HOME\Application Data\Maple\16

Windows 7/Vista

HOME\maple\toolbox\tasks\lib

HOME\AppData\Roaming\Maple\16

Mac

HOME/maple/toolbox/tasks/lib

HOME/Library/Preferences/Maple/16

Linux/Unix

~/maple/toolbox/tasks/lib

~/.maple/16

Table 2   Optimal locations for all files associated with tasks, and palettes

``

Table 2 is appealing not only for its symmetry, but because both the mpalette file and its associated task hdb are in the same location. Note, though, that the file locations for the Windows platforms also correct a quirk that crept into the implementation. Absent the placements of Table 2, the Custom palette under Windows will be empty the first time Maple is launched after a restart of the computer. It can also happen that the Custom palette will be empty when launching Maple at other times, but this appears to be sporadic. This does not seem to be a problem on other platforms.

``

Example

````

Typically, a multivariable calculus course starts with a section on vectors, lines, and planes. A standard exercise in this section would be finding the equation of a plane given three points through which it must pass.

NULL

Obtain an equation for the plane containing the points A:2, 3, -1, B:5, -7, 2, C:3, 6, 1.

 

Below, there are solutions based on three different approaches, the last being the use of Maple's geom3d package. This package is "command-driven" and does not lend itself to syntax-free computing. For this reason, the parts of this package relevant to the multivariate calculus course were captured in Task Templates that were then entered into a Geometry3D Custom palette.

 

This article is contained in a zip archive in which the files Tasks_Geometry3D.mpalette and Tasks-Lopez.hdb also appeared. If these two files are placed according to the comments under Table 1, then a Geometry3D Custom palette will appear in Maple 16, and it will be populated with some 22 task templates pertinent to the lines-and-planes examples in the typical multivariate calculus course.

 

The vector-based solution is probably the one that would be suggested in the calculus course. The solution given below begins with the graph that illuminates the vector procedure. A student who understands this graph will understand the vector solution.

 

A command-based geom3d solution is provided so that the reader can see the difference between working with commands and working in the syntax-free environment provided by tasks and the new Custom palette.

 

Vector Solution

``

``

``  

 

The three blue vectors emanate from the origin, and are the position vectors to the points A, B, C. The "middle" vector points to A. The red and green vectors in the plane are the vectors B-A and C-A, whose cross-product gives the gold vector N, the normal to the required plane. (Italic font indicates a triple is interpreted as a point; bold roman font, a position vector.)

 

The Student Linear Algebra package is loaded so that eventually, when the plane is defined through a dot product, the variables x, y, z will not be interpreted as complex quantities, and be conjugated. Had this precaution not been taken, the resulting equation of the plane would have to be simplified under the assumption that all quantities were real.

 

Initialize:

• 

Tools_Load Package: Student Linear Algebra

Loading Student:-LinearAlgebra

• 

Write A = `<,>`(2, 3, -1) 

• 

Context Menu: Assign Name

A = `<,>`(2, 3, -1)(->)

• 

Write B = `<,>`(5, -7, 2) 

• 

Context Menu: Assign Name

B = `<,>`(5, -7, 2)(->)

• 

Write C = `<,>`(3, 6, 1) 

• 

Context Menu: Assign Name

C = `<,>`(3, 6, 1)(->)

• 

Write R = `<,>`(x, y, z)

• 

Context Menu: Assign Name

R = `<,>`(x, y, z)(->)

NULL

Obtain vectors from A to B and A to C:

• 

Write AB = B-A

• 

Context Menu: Assign Name

AB = B-A(->)

• 

Write AC = C-A

• 

Context Menu: Assign Name

AC = C-A(->)

``

Obtain a normal for the plane:

Write the normal N = `&x`(AB, AC) 

Context Menu: Assign Name

N = `&x`(AB, AC)(->)

 

Obtain the equation of the plane:

• 

Write (R-A).N = 0 

• 

Press the Enter key.

(R-A).N = 0

-29*x+86-3*y+19*z = 0

``

Algebraic Solution

``

Define f, a scalar function of a vector argument:

• 

Write f(v) = a*v[1]+b*v[2]+c*v[3]+d 

• 

Context Menu: Assign Function

f(v) = a*v[1]+b*v[2]+c*v[3]+d(->)f

``

Formulate and solve three equations in the unknowns a, b, c, d:

• 

Write f(A) = 0, f(B) = 0, f(C) = 0

• 

Press the Enter key.

 

• 

Context Menu:
Solve_Solve for Variables_{a, b, c} 

 

 f(A) = 0, f(B) = 0, f(C) = 0

2*a+3*b-c+d = 0, 5*a-7*b+2*c+d = 0, 3*a+6*b+c+d = 0

(1)

(->)

{a = -(29/86)*d, b = -(3/86)*d, c = (19/86)*d}

(2)
• 

Expression palette: Evaluation template
Evaluate f(R) = 0 at the solution
Press the  Enter key.

• 

Context Menu: Factor


• 

Select and Control-drag.

eval(f(R), {a = -(29/86)*d, b = -(3/86)*d, c = (19/86)*d})

-(29/86)*d*x-(3/86)*d*y+(19/86)*d*z+d

(3)

(=)

-(1/86)*d*(29*x+3*y-19*z-86)

(4)

29*x+3*y-19*z-86 = 0

29*x+3*y-19*z-86 = 0

(5)

``

Solution with geom3d

``

• 

Initialize

restart; with(geom3d)

• 

Define points A, B, C.

point(A, 2, 3, -1); point(B, 5, -7, 2); point(C, 3, 6, 1)

• 

Obtain plane P.

plane(P, [A, B, C], [x, y, z])

• 

Exhibit the equation of plane P.

Equation(P)

86-29*x-3*y+19*z = 0

``

The directness and simplicity of this solution is certainly appealing. That appeal is what led to the desire to capture this approach in a syntax-free way.``

``

Solution via Tasks and Palette

Define Points

``

Define point A 

Name:

Coordinates:

  implies  

 

``

Define point B 

Name:

Coordinates:

  implies  

 

``

Define point C 

Name:

Coordinates:

  implies  

 

``

Of course, the DefinePoint template need only be installed once, but used three times. It is installed three times so a record of its use would be provided.

``

Define Plane

``

Define plane P:

 

Name:

 

Data:

Coordinates:

    implies  

     

NULL

Equation of Plane

``

Exhibit an equation for plane P:

 

Data:

 

``  implies     

``

 

Legal Notice: © Maplesoft, a division of Waterloo Maple Inc. 2012. Maplesoft and Maple are trademarks of Waterloo Maple Inc. This application may contain errors and Maplesoft is not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact Maplesoft for permission if you wish to use this application in for-profit activities.

``

NULL