Maple User Manual
Maple User Manual
Java and all Java based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United
States and other countries. Maplesoft is independent of Sun Microsystems, Inc.
All other trademarks are the property of their respective owners.
This document was produced using a special version of Maple and DocBook.
Printed in Canada
ISBN 978-1-897310-20-5
iii
Contents • v vi • Contents
4 Mathematical Computations .............................................................. 121 Multiple Plots in the Same Plot Region ......................................... 213
4.1 In This Chapter ............................................................................ 123 5.3 Customizing Plots ....................................................................... 215
4.2 Algebra ........................................................................................ 124 Interactive Plot Builder Options ................................................... 215
Polynomial Algebra ...................................................................... 124 Context Menu Options .................................................................. 216
4.3 Linear Algebra ............................................................................ 133 The plot and plot3d Options ......................................................... 219
Creating Matrices and Vectors ...................................................... 133 5.4 Analyzing Plots ........................................................................... 222
Accessing Entries in Matrices and Vectors ................................... 142 Point Probe, Rotate, Pan, and Zoom Tools .................................... 222
Linear Algebra Computations ....................................................... 143 5.5 Creating Animations ................................................................... 222
Student LinearAlgebra Package .................................................... 150 Interactive Plot Builder ................................................................. 223
4.4 Calculus ....................................................................................... 151 The plots[animate] Command ....................................................... 224
Limits ............................................................................................ 151 5.6 Playing Animations ..................................................................... 226
Differentiation ............................................................................... 153 Animation Context Bar .................................................................. 226
Series ............................................................................................. 159 5.7 Customizing Animations ............................................................. 228
Integration ..................................................................................... 161 Interactive Plot Builder Animation Options .................................. 228
Differential Equations .................................................................... 164 Context Menu Options .................................................................. 228
Calculus Packages ......................................................................... 164 The animate Command Options .................................................... 229
4.5 Optimization ............................................................................... 166 5.8 Exporting ..................................................................................... 230
Point-and-Click Interface .............................................................. 167 5.9 Code for Color Plates .................................................................. 230
Large Optimization Problems ....................................................... 169 6 Creating Mathematical Documents ..................................................... 231
MPS(X) File Support .................................................................... 171 6.1 In This Chapter ............................................................................ 232
Additional Information .................................................................. 171 6.2 Document Formatting .................................................................. 233
4.6 Statistics ...................................................................................... 171 Quick Character Formatting .......................................................... 233
Probability Distributions and Random Variables .......................... 171 Quick Paragraph Formatting .......................................................... 235
Statistical Computations ................................................................ 173 Copy and Paste ............................................................................... 236
Plotting .......................................................................................... 175 Sections .......................................................................................... 237
Additional Information .................................................................. 177 Display Hidden Formatting Attributes ........................................... 238
4.7 Teaching and Learning with Maple ............................................ 178 Indentation and the Tab Key .......................................................... 238
Student Packages and Tutors ........................................................ 179 Character and Paragraph Styles ..................................................... 239
5 Plots and Animations .......................................................................... 187 Document Blocks ........................................................................... 247
5.1 In This Chapter ............................................................................ 187 Typesetting ..................................................................................... 252
5.2 Creating Plots .............................................................................. 188 Using Tables for Layout ................................................................. 252
Interactive Plot Builder ................................................................. 189 Formatting Lists: Bullets, Numbers, and Indent ............................ 262
Context Menu ................................................................................ 203 Bookmarks ..................................................................................... 264
Dragging to a Plot Region ............................................................. 206 Inserting Images ............................................................................. 265
The plot and plot3d Commands .................................................... 207 Show or Hide Worksheet Content .................................................. 266
The plots Package ......................................................................... 210 6.3 Embedded Components ............................................................... 268
Contents • vii viii • Contents
Adding Graphical Interface Components ...................................... 268 Functional Operators ..................................................................... 292
Editing Component Properties: General Process ........................... 269 Strings ........................................................................................... 297
Removing Graphical Interface Components .................................. 269 7.3 Working with Maple Expressions ................................................ 298
Example Component Properties .................................................... 270 Low-Level Operations ................................................................... 298
Printing and Exporting a Document with Embedded Compon- Manipulating Expressions ............................................................. 304
ents ................................................................................................. 271 Evaluating Expressions ................................................................. 310
6.4 Creating Graded Assignments ...................................................... 271 8 Basic Programming ............................................................................ 321
Creating a Question ........................................................................ 271 8.1 In This Chapter ............................................................................ 321
Viewing Questions in Maple .......................................................... 272 8.2 Flow Control ................................................................................ 322
Saving Test Content ....................................................................... 272 Conditional Execution (if Statement) ........................................... 322
6.5 Auto-Execute ................................................................................ 272 Repetition (for Statement) ............................................................. 325
Setting the Auto-Execute Feature .................................................. 273 8.3 Iterative Commands .................................................................... 333
Removing the Auto-Execute Setting .............................................. 273 Creating a Sequence ...................................................................... 333
Repeating Auto-Execution ............................................................. 273 Adding and Multiplying Expressions ........................................... 334
Security Levels ............................................................................... 273 Selecting Expression Operands ..................................................... 335
6.6 Canvas .......................................................................................... 274 Mapping a Command over a Set or List ....................................... 336
Insert a Canvas ............................................................................... 274 Mapping a Binary Command over Two Lists or Vectors ............... 336
Drawing .......................................................................................... 275 Additional Information .................................................................. 337
Canvas Style ................................................................................... 275 8.4 Procedures ................................................................................... 338
6.7 Spell Checking ............................................................................. 276 Defining and Running Simple Procedures .................................... 338
How to Use the Spellcheck Utility ................................................. 277 Procedures with Inputs .................................................................. 339
Selecting a Suggestion ................................................................... 277 Procedure Return Values ............................................................... 339
Spellcheck Usage and the Document ............................................. 278 Displaying Procedure Definitions ................................................. 340
User Dictionary .............................................................................. 278 Displaying Maple Library Procedure Definitions ......................... 340
6.8 Hyperlinks .................................................................................... 279 Modules ......................................................................................... 342
Inserting a Hyperlink in a Document ............................................. 280 9 Maplets ................................................................................................ 343
6.9 Worksheet Compatibility ............................................................. 283 9.1 In This Chapter ............................................................................ 343
7 Maple Expressions .............................................................................. 285 9.2 Simple Maplet .............................................................................. 343
7.1 In This Chapter ............................................................................ 285 9.3 Using Maplets ............................................................................. 344
7.2 Creating and Using Data Structures ............................................ 285 Maplet File .................................................................................... 344
Expression Sequences ................................................................... 286 Maple Document ............................................................................ 345
Sets ................................................................................................ 287 9.4 Authoring Maplets ...................................................................... 345
Lists ............................................................................................... 288 Maplet Builder .............................................................................. 346
Arrays ............................................................................................ 289 Maplets Package ........................................................................... 356
Tables ............................................................................................ 290 Saving ............................................................................................ 362
Matrices and Vectors ..................................................................... 291 10 Input, Output, and Interacting with Other Products ......................... 363
Contents • ix x • Contents
List of Tables Table 5.14: Creating Animations Using the Interactive Plot Builder ..... 223
Table 5.15: The animate Command ....................................................... 225
Table 1.1: Shortcuts for Entering Mathematical Expressions .................... 6 Table 5.16: Animation Options .............................................................. 226
Table 1.2: Entering a Definite Integral ..................................................... 13 Table 5.17: Customizing Animations Using the Context Menu ............ 229
Table 1.3: Symbol Completion Shortcut Keys ......................................... 17 Table 8.1: Default Clause Values ........................................................... 327
Table 1.4: Summary of Document Mode Tools ....................................... 31 Table 8.2: Iterative Commands .............................................................. 333
Table 1.5: Maple Help Resources ............................................................ 32 Table 8.3: The seq Command ................................................................ 333
Table 3.1: Select Integer Commands ....................................................... 73 Table 8.4: The add and mul Commands ................................................ 334
Table 3.2: Modular Arithmetic Operators ................................................ 76 Table 8.5: The select, remove, and selectremove Commands ............... 335
Table 3.3: Overview of Solution Methods for Important Equation Table 8.6: The map Command ............................................................... 336
Types ........................................................................................................ 78 Table 8.7: The zip Command ................................................................. 337
Table 3.4: Sample Dimensions ................................................................ 97 Table 10.1: Summary of Content Translation When Exporting to Different
Table 3.5: Scientific Constants ............................................................... 105 Formats .................................................................................................. 371
Table 4.1: Maple Resources for Mathematical Computation ................ 121
Table 4.2: Polynomial Arithmetic Operators ......................................... 125
Table 4.3: Polynomial Coefficient and Degree Commands ................... 130
Table 4.4: Select Other Polynomial Commands .................................... 132
Table 4.5: Additional Polynomial Help ................................................. 133
Table 4.6: Matrix and Vector Arithmetic Operators ............................... 144
Table 4.7: Select Matrix and Vector Operators ...................................... 146
Table 4.8: Select LinearAlgebra Package Commands ........................... 148
Table 4.9: Limits .................................................................................... 152
Table 4.10: Student and Instructor Resources ........................................ 178
Table 5.1: Windows of the Interactive Plot Builder ............................... 190
Table 5.2: Displaying a Plot of a Single Variable Expression ................ 192
Table 5.3: Displaying a Plot of Multiple Expressions of 1 Variable ..... 194
Table 5.4: Displaying a Plot of a Multi-variable Expression ................ 195
Table 5.5: Displaying a Conformal Plot ............................................... 197
Table 5.6: Displaying a Plot in Polar Coordinates ................................ 199
Table 5.7: Interactive Plotting ............................................................... 201
Table 5.8: The plot and plot3d Commands ............................................ 207
Table 5.9: Customizing Plots Using Interactive Plot Builder ................ 216
Table 5.10: Customizing 2-D Plots Using the Context Menu ................ 217
Table 5.11: Customizing 3-D Plots Using the Context Menu ................ 218
Table 5.12: Popular Plot Options ........................................................... 219
Table 5.13: Plot Analysis Options .......................................................... 222
xi
xiv • Preface
Preface Interface
MapletTM Applications
Description
Graphical user interface containing windows, textbox
regions, and other visual interfaces, which gives you
The Maple Software point-and-click access to the power of Maple. You can
perform calculations and plot functions without using
the worksheet or command-line interfaces.
The MapleTM software is a powerful system that you can use to solve complex
mathematical problems. You can also create professional quality documents, This manual describes how to use the Standard Worksheet interface. Some
presentations, and custom interactive computational tools in the Maple en- features are not available in the Classic Worksheet interface and Command-
vironment. line version. The Standard Worksheet interface has two modes: Document
mode and Worksheet mode.
You can access the power of the Maple computational engine through a
variety of interfaces. Document Mode - Using the Document mode, you can perform quick cal-
Interface Description culations. You can enter a mathematical expression, and then evaluate, ma-
nipulate, solve, or plot with a few keystrokes or mouse clicks.
Standard Worksheet Full-featured graphical user interface offering features
that help you create electronic documents that show all
Worksheet Mode - The Worksheet mode is designed for:
your assumptions, the calculations, and any margin of
error in your results; or hide the computations to allow
• Interactive use through Maple commands, which may offer advanced
your reader to focus on the problem setup and final res-
ults. The advanced formatting features help you create functionality or customized control not available using context menus
the customized document you need. Because the docu- or other syntax-free methods
ments are live, you can edit the parameters and, with the
click of a button, compute the new results.
• Programmatic use of the powerful Maple language
The User Manual was created using the Standard Using either mode, you can create high quality interactive mathematical
Worksheet interface to Maple. An interactive version of
this manual is available in the Standard Worksheet inter-
presentations or documents.
face. From the Help menu, select Manuals, Dictionary,
and more>Manuals>User Manual. In This Manual
Classic Worksheet Basic worksheet environment for older computers with
limited memory. This manual provides an overview of all Maple features including:
Command-line version Command-line interface, without graphical user inter- • Performing computations
faces features, for solving very large complex problems
or batch processing with scripts. • Creating plots and animations
MaplesoftTM Graphing Calculator Graphical calculator interface to the Maple computational • Creating interactive documents
engine. Using it, you can perform simple computations
(Microsoft® Windows® only)
and create customizable, zoomable graphs.
• The Maple programming language
• Using and creating custom Maplet applications
xiii
Preface • xv xvi • Preface
• File input and output, and using Maple with third party products
• Data structures
For a complete list of manuals, study guides, toolboxes, and other resources,
visit the Maplesoft Web site at http://www.maplesoft.com.
Audience
The information in this manual is intended for Maple users who have read
the Maple Getting Started Guide.
Conventions
This manual uses the following typographical conventions.
• bold font - Maple command, package name, option name, dialog, menu,
and text field
• italics - new or important concept
• Note - additional information relevant to the section
• Important - information that must be read and followed
Customer Feedback
Maplesoft welcomes your feedback. For suggestions and comments related
to this and other manuals, contact [email protected]
2 • 1 Document Mode
ing the information in this chapter, see Chapter 2, Worksheet Mode (page 35),
1 Document Mode for information on using Worksheet mode.
Using the Maple software, you can create powerful interactive documents. Worksheet mode sample:
You can visualize and animate problems in two and three dimensions. You
can solve complex problems with simple point-and-click interfaces or easy- Find the value of the derivative of at .
to-modify interactive documents. You can also devise custom solutions using
the Maple programming language. While you work, you can document your >
process, providing text descriptions.
(1.1)
1.1 Introduction
>
Maple has two modes: Document mode and Worksheet mode.
Document mode is designed for quickly performing calculations. You can (1.2)
enter a mathematical expression, and then evaluate, manipulate, solve, or
plot it with a few keystrokes or mouse clicks. This chapter provides an
overview of Document mode. >
Important: In any Maple document, you can use Document mode and
Worksheet mode is designed for interactive use through commands and Worksheet mode.
programming using the Maple language. The Worksheet mode supports the
features available in Document mode described in this chapter. After review- Using either mode:
1
1.2 In This Chapter • 3 4 • 1 Document Mode
Note: This chapter was created using Document mode. All other chapters Document Mode Summary - Summary of • Table of Document Mode Tools
were created using Worksheet mode. key Document mode features
Getting Help - A list of resources available • Table of Maple Help Resources
1.2 In This Chapter in the Maple Help System
Section Topics
Simple Mathematical Expressions - Introduc- • Text and Math Modes
1.3 Simple Mathematical Expres-
tion to Math and Text modes, and how to
easily enter simple expressions
• Rational Expressions sions
• Powers
• Products In Document mode, you can enter two types of content: Text and Math. The
Text mode and Math mode icons at the left end of the toolbar indicate the
• Shortcuts for Entering Mathematical Ex-
pressions current mode. The toolbar is located near the top of the Maple window, im-
mediately below the menu bar.
• Other Expressions
To switch between Text and Math modes, press the F5 key. (Alternatively,
click the Text mode or Math mode toolbar icon.) Consequently, it is easy
to enter sentences containing text and inline mathematical expressions.
1.3 Simple Mathematical Expressions • 5 6 • 1 Document Mode
Implied Multiplication
Entering mathematical expressions, such as , , and ,
In most cases, you do not need to include the multiplication operator, .
is natural in Math mode.
Insert a space character between two quantities to multiply them.
Rational Expressions (Fractions) Note: In some cases, you do not need to enter the multiplication operator or
a space character. For example, Maple interprets a number followed by a
To enter a fraction:
variable as multiplication.
1. Enter the numerator.
Important: Maple interprets a sequence of letters, for example, xy, as a
2. Press the forward slash (/) key. single variable. To specify the product of two variables, you must insert a
space character (or multiplication operator), for example, x y or . For
3. Enter the denominator.
more information, refer to the ?2DMathDetails help page.
4. To exit the denominator, press the right arrow key.
Shortcuts for Entering Mathematical Expressions
Powers
Table 1.1 lists shortcut keys for entering and navigating mathematical expres-
To enter a power: sions.
1. Enter the base. Table 1.1: Shortcuts for Entering Mathematical Expressions
Products (Text)
Fraction / (forward slash)
To enter a product:
2. Press the asterisk (*) key, which displays in math as . Subscript _ (underscore)
To the right of the expression, Maple inserts an equal sign and then the value
Navigating an ex- Arrow keys
pression
of the expression.
For a complete list of shortcut keys, refer to the Math Shortcut and Hints =
help page. To access this help page in the Maple software, in Math mode
enter ?MathShortcuts and then press Enter. For information on the Maple You can replace the inserted equal sign with text or mathematical content.
Help System, see Getting Help (page 32).
To replace the equal sign:
Other Expressions 1. Select the equal sign. Press Delete.
It is also easy to enter mathematical expressions, such as: 2. Enter the replacement text or mathematical content.
For example, you can replace the equal sign with the text "is equal to".
• Piecewise-continuous functions:
is equal to
• Limits: In mathematical content, pressing Enter evaluates the expression and displays
it centered on the following line. The cursor moves to a new line below the
output.
1.5 Editing Expressions and Updating Output • 9 10 • 1 Document Mode
• Operators: , , , /, , , , , ...
1.5 Editing Expressions and Updat-
ing Output • Constants: π, e, ...
• Palettes
• Symbol names
Palettes
Palettes are collections of related items that you can insert by clicking or
dragging. Palettes contain:
• Numbers and constants, like i (the imaginary unit), π, and ∞. For example,
see the Common Symbols palette (Figure 1.1).
• Layouts, like an item with a superscript and subscript. For example, see
the Layout palette (Figure 1.2). Figure 1.3: Expression Palette Figure 1.4: Matrix Palette
• Mathematical operations, like a definite integral with placeholders for
the integrand, variable of integration, and endpoints of the interval of Using Palettes
integration. For example, see the Expression palette (Figure 1.3).
To insert a palette item:
• Specialized tools. For example, see the Matrix palette (Figure 1.4). For
information on the Matrix palette, see Creating Matrices (page 133). 1. In the palette, click the item to insert. The item is inserted at the cursor
location.
Note: You can drag palette items to any location in the document.
or
• From the Common Symbols palette, drag the π symbol to the appropriate
location in the document.
4. Replace the final placeholder, y, with the expression that defines the
function value. Press Enter.
3. Enter 1, and then press Tab. The integrand
placeholder is selected.
4. Enter , and then press Tab. The variable For example, define a function that doubles its input.
of integration placeholder is selected.
5. Enter x.
Note: To insert the right arrow symbol , you can also enter the characters
To evaluate the integral, press Ctrl+= (Command+=, for Macintosh) or ->.
Enter. For more information, see Computing with Palettes (page 20).
Important: The expression is different from the function .
• From the View menu, select Palettes, and then Expand Docks.
• Drag the palette (by clicking its title) to the new location. Figure 1.6: Handwriting Palette
1. Right-click (Control-click, for Macintosh) a palette dock. Maple displays 2. Click the button. A list of potential matching symbols is
a context menu—a menu that lists actions you can perform on the ob- displayed. To view more symbols (where indicated), click the drop-down
ject—near the palette. arrows associated with the displayed symbols.
2. From the context menu, select Show Palette, and then select the palette. 3. To insert a symbol, click the displayed symbol.
Handwriting Palette Symbol Names
Finding the right symbol to insert can be time consuming. The Handwriting
Each symbol has a name, and some have aliases. By entering its name (or
palette provides an efficient way to find and insert the right symbol. You
an alias) in Math mode, you can insert the symbol.
draw the symbol with your mouse and then Maple matches your input against
items available in the system. See Figure 1.6. Note: If you hover the mouse pointer over a palette item, a tooltip displays
the symbol's name.
1.6 Entering Expressions • 17 18 • 1 Document Mode
1. Enter sqrt.
2. Press the completion shortcut key. Maple displays a pop-up list of exact
matches .
For example, to multiply two complex numbers:
3. In the completion list, select . Maple inserts the symbol with the • Use the symbol name and completion list to enter the imaginary unit,
placeholder selected. .
4. Enter 603729.
=
5. Press Ctrl + = (Command + =, for Macintosh).
Example: Indefinite Integral
=
You can enter any expression using symbol names and the completion list.
1. In Math mode, enter int. Press the completion shortcut key. Computing with Palettes
As discussed in Palettes (page 11), some palettes contain mathematical op-
2. From the completion list, select the indefinite integral item .
erations.
3. Enter sin(x).
To perform a computation using a palette mathematical operation:
4. Enter d. Press the completion shortcut key.
1. In a palette that contains operators, such as the Expression palette, click
5. From the completion list, select d (differential). an operator item.
3. To execute the operation and display the result, press Ctrl+= (Com-
Note: From the int completion list, you can directly insert . mand+=, for Macintosh) or Enter.
Using the Document mode, you can access the power of the advanced Maple
mathematical engine without learning Maple syntax. In addition to solving 1. Using the Expression palette, enter the definite integral. See Table
problems, you can also easily plot expressions. 1.2 (page 12).
The primary tools for syntax-free computation are: 2. Press Ctrl+= (Command+=, for Macintosh).
• Palettes
=
• Context menus
• Assistants and tutors
Context Menus
Note: The Document mode is designed for quick calculations, but it also
supports Maple commands. For information on commands, see Com- A context menu is a pop-up menu that lists the operations and actions you
mands (page 39) in Chapter 2, Worksheet Mode (page 35). can perform on a particular expression. See Figure 1.7.
Important: In Document mode, you can execute a statement only if you
enter it in Math mode. To use a Maple command, you must enter it in Math
mode.
1.7 Performing Computations • 21 22 • 1 Document Mode
From the context menu, you can also select operations different from evalu-
ation. To the right of the expression, Maple inserts a right arrow symbol (→)
and then the result.
1.7 Performing Computations • 23 24 • 1 Document Mode
Solving an Equation
You can find an exact (symbolic) solution or an approximate (numeric)
solution of an equation. For more information on symbolic and numeric
computations, see Symbolic and Numeric Computation (page 66).
To solve an equation:
1. Enter an equation.
You can replace the inserted right arrow with text or mathematical content.
Assistants
Assistants help you accomplish many tasks, such as solving ordinary differ-
ential equations (ODEs) and ODE systems, creating plots, curve fitting, im-
porting data, and building an installer (Figure 1.11).
• From the Tools menu, select Assistants, and then one of the topic sub-
menus.
Figure 1.9: FPS Units Palette Figure 1.10: SI Units Palette
For example, compute the electric current passing through a wire that con-
ducts 590 coulombs in 2.9 seconds.
Figure 1.11: Installer Builder Assistant
Tutors
For more information on using units, see Units (page 96). Over 40 interactive tutors help student users gain insight and understanding
of topics in courses such as precalculus, calculus, multivariate calculus,
1.7 Performing Computations • 27 28 • 1 Document Mode
vector calculus, and linear algebra. Some tutors help you work through a
problem step-by-step.
• From the Tools menu, select Tutors, and then one of the topic submenus.
For example, you can create a plot of the compositions of two functions using
the Function Composition Tutor.
1. From the Tools menu, select Tutors, Precalculus, and then Compositions.
The Function Composition Tutor is displayed. See Figure 1.12.
2. In the f(x) = and g(x) = text fields, enter the two functions.
3. Click the Display button. The tutor displays the compositions g(f(x)) and
f(g(x)).
4. To insert the plot into your document, click the Close button.
The Plot Builder can be launched from the Tools menu or the context menu
for an expression.
3. From the context menu, select Plots, and then Plot Builder. The Interact-
ive Plot Builder is displayed. See Figure 1.13.
4. In the Select Plot Type dialog, select the plot type, for example, 3-D plot
or 2-D contour plot.
5. To immediately create a plot, click the Plot button. To customize the plot
before generating it, click the Options button.
For more information on plots, see Plots and Animations (page 187).
*
Inline evaluation is available in Document mode and document blocks. For information
on document blocks, see Document Blocks (page 247).
1.9 Getting Help • 33 34 • 1 Document Mode
Resource Description
Help Pages Help for Maple features, commands, packages, and more. Help
pages include examples and screenshots to help you quickly
learn.
• From the Help menu, select Maple Help. You can search
for a help topic, perform a text search, or browse the Table
of Contents. You can also open a help page by entering
?<topic_name> at the input prompt (in Worksheet mode)
or in Math mode (in Document mode).
Task Templates Set of commands with placeholders that you can use to quickly
perform a task.
• From the Tools menu, select Tasks, and then Browse.
Applications and Example Executable documents that demonstrate the power and flexib-
Worksheets ility of the Maple interactive document or provide an overview
of computations in a particular field.
• From the Help menu, select Manuals, Dictionary, and
more, and then Applications and Examples.
Mathematics and Engineer- Over 5000 definitions, including 300 figures and plots.
ing Dictionary • From the Help menu, select Manuals, Dictionary, and
more, and then Dictionary.
For more information on the Maple Help System, refer to the Maple Getting
Started Guide.
36 • 2 Worksheet Mode
35
2.2 Input Prompt • 37 38 • 2 Worksheet Mode
Section Topics
Equation Labels - Automatically generated • Displaying Equation Labels
labels that you can use to refer to expressions
• Referring to a Previous Result
• Execution Groups with Multiple Outputs Suppressing Output
• Label Numbering Schemes
To suppress the output, enter a colon (:) at the end of the input.
• Features of Equation Labels
>
2.2 Input Prompt A set of Maple input and its output are referred to as an execution group.
In Worksheet mode, you enter input at the Maple input prompt (>). The de-
fault mode for input is Math mode (2-D Math). 1-D Math Input
To evaluate input: You can also insert input using Text mode (1-D Math). The input is entered
as a one-dimensional sequence of characters. 1-D Math input is red.
• Press Enter.
To enter input using 1-D Math:
Maple displays the result (output) below the input.
• At the input prompt, press F5 to switch from 2-D Math to 1-D Math.
For example, to find the value of , enter the expression, and then > 123^2 - 29857/120;
press Enter.
>
Important: 1-D Math input must end with a semicolon or colon. If you use
a semicolon, Maple displays the output. If you use a colon, Maple suppresses
the output.
For example, compute the sum of two fractions. > 123^2 - 29857/120:
1. From the Tools menu, select Options. The Options dialog is displayed.
2.3 Commands • 39 40 • 2 Worksheet Mode
2. On the Display tab, in the Input display drop-down list, select Maple You can enter commands using 1-D or 2-D Math. You must use 1-D Math
Notation. input when programming in Maple. Basic Programming (page 321) provides
an introduction to Maple programming.
3. Click Apply to Session (to set for only the current session) or Apply
Globally (to set for all Maple sessions). To learn how to use Maple commands, use task templates. See Task Tem-
plates (page 51).
To convert 2-D Math input to 1-D Math input:
For example, to differentiate an expression, use the diff command. The re-
quired parameters are the expression to differentiate, which must be specified
2.3 Commands first, and the independent variable.
> package[command](arguments)
If you are frequently using the commands in a package, load the package.
For a complete list of functions (commands that implement mathematical To load a package:
functions), for example, BesselI and AiryAi, available in the library, refer • Use the with command, specifying the package as an argument.
to the ?initialfunctions help page. (To display this help page, enter ?initial-
functions at the input prompt.) The with command displays a list of the package commands loaded (unless
you suppress the output by entering a colon at the end of the calling se-
> quence).
After loading a package, you can use its commands as top-level commands,
that is, without specifying the package name.
For detailed information on the properties of a function, use the Function- For example, use the NLPSolve command from the Optimization package
Advisor command. to find a local minimum of an expression and the value of the independent
variable at which the minimum occurs.
>
>
>
For detailed information on how to use a function in Maple, refer to its help
page.
>
For example:
>
Note: In 1-D and 2-D Math input, when accessing a help page using ?, you For more information on optimization, see Optimization (page 166).
do not need to include a trailing semicolon or colon.
Package Commands
To use a package command, the calling sequence must include the package
name, and the command name enclosed in brackets ([ ]).
2.3 Commands • 43 44 • 2 Worksheet Mode
To unload a package:
2.4 Palettes
• Use the unwith command, specifying the package as an argument.
Palettes are collections of related items that you can insert by clicking or
> dragging. See Figure 2.1.
To use the examples in this manual, you may be required to use the unwith
command between examples.
Some packages contain commands that have the same name as a top-level
command. When you load one of these packages, Maple returns a warning.
>
Warning, the name changecoords has been redefined
In general, this manual does not include the warning messages Maple returns.
To use the top-level command, unload the package. (For alternative methods Figure 2.1: Expression Palette
of accessing the top-level command, see the ?with help page.)
You can use palettes to enter input.
For example, evaluate a definite integral using the definite integration item
>
In 1-D Math, clicking the definite integration item inserts the corresponding
command calling sequence.
> int(f,x=a..b);
Specify the problem values (using the Tab to move to the next placeholder),
and then press Enter.
> int(tanh(x), x = 0..1):
Note: Some palette items cannot be inserted into 1-D Math because they are
not defined in the Maple language. When the cursor is in 1-D Math input,
unavailable palette items are dimmed.
For more information on palettes, see Palettes (page 11) and Performing Figure 2.2: Integer Context Menu
Computations (page 19) in Chapter 1.
In Worksheet mode, you can use context menus to perform operations on 2-
D Math and output.
For example:
2.6 Assistants and Tutors
To determine a rational expression (fraction) that approximates a
floating-point number: Assistants and tutors provide point-and-click interfaces, with buttons, text
input regions, and sliders. See Figure 2.3.
1. Right-click (Control-click, for Macintosh) the floating-point number.
>
(2.1)
>
For information on equation labels and equation label references, see Equa-
tion Labels (page 59).
Figure 2.3: Interactive Plot Builder: Select Plot Type Dialog
For more information on context menus, see Context Menus (page 20) in
Chapter 1.
Launching an Assistant or Tutor
To launch an assistant or tutor:
Example: Using the Interactive Plot Builder 3. In the Add/Edit Expression dialog, enter the expression to plot using 1-
D Math. See Figure 2.5.
To plot an expression using the Interactive Plot Builder:
1. From the Tools menu, select Assistants, and then Plot Builder. Maple
inserts the following command in the document and launches the Interactive
Plot Builder.
>
You can also browse the task templates in the Table of Contents of the Maple
Help System.
For more information on assistants and tutors, see Assistants and Tu-
tors (page 26) in Chapter 1.
• Click the Insert Default Content button. Maple inserts the default con- To use an inserted task template:
tent. The default content level is set using the Options dialog. For details,
see the following steps. 1. Specify values for the parameters in placeholders or using graphical inter-
face components. You can move to the next placeholder by pressing Tab.
• Click the Insert Minimal Content button. Maple inserts only the com-
mands and embedded components, for example, a button to launch the 2. Execute all commands in the task by:
related assistant or tutor.
• Placing the cursor in the first task command, and then pressing Enter
• Click the Copy Task to Clipboard button. Place the cursor where you repeatedly to execute each command.
want to insert the task, and then paste the task. Maple inserts the default
content. Use this method to quickly insert a task multiple times. • Selecting all the template commands, and then clicking the execute
toolbar icon .
To change the default content level, use the Options dialog.
3. If the template contains a button that computes the result, click it.
1. From the Tools menu, select Options. The Options dialog opens.
For more information on task templates, refer to the Maple Getting Started
2. In the Options dialog, select the Display tab. Guide or the ?tasks help page.
3. In the Task content to insert drop-down list, select All Content, Standard
Content, or Minimal Content. 2.8 Text Regions
• Minimal Content - Only the commands and embedded components To add descriptive text in Worksheet mode, use a text region.
• Standard Content - Commands, embedded components, and instructions To insert a text region:
for using the template
• All Content - All content in the task template, including hyperlinks to • In the toolbar, click the Text region icon .
related help pages
The default mode in a text region is Text mode.
Maple stores a list of the most recently inserted task templates.
In a text region, you can:
To insert a recently inserted task:
• Enter text with inline mathematical content by switching between Text
• From the Tools menu, select Tasks, and then the task name. and Math modes. To toggle between Text mode and Math mode, press
F5. Note: The mathematical content in a text region is not evaluated.
Maple inserts the default content. To enter mathematical content that is evaluated, enter it at an Input
Prompt (page 37).
Performing the Task
• Insert any palette item. Palette items are inserted in Math mode (2-D
After you insert a task template, enter the parameters for your task, and then Math).
compute the result.
2.9 Names • 55 56 • 2 Worksheet Mode
You can format text in a text region. Features include: Recall that you can enter using the following two methods.
• Character styles
• Use the Common Symbols palette
• Paragraph styles
• In 2-D Math enter pi, and then press the symbol completion short cut
• Sections and subsections key. See Shortcuts for Entering Mathematical Expressions (page 6).
• Tables When Maple evaluates an expression that contains a name, it replaces the
For more information on formatting documents, see Creating Mathematical name with its value. For example:
Documents (page 231).
>
2.9 Names
Instead of re-entering an expression every time you need it, you can assign For information on Maple evaluation rules, see Evaluating Expres-
it to a name or add an equation label to it. Then you can quickly refer to the sions (page 310).
expression using the name or an equation label reference. For information
on labels, see the following section Equation Labels (page 59). Mathematical Functions
To define a function, assign it to a name.
Assigning to Names
For example, define a function that computes the cube of its argument.
You can assign any Maple expression to a name: numeric values, data
structures, procedures (a type of Maple program), and other Maple objects.
>
Initially, the value of a name is itself.
For information on creating functions, see Defining a Mathematical Func-
> tion (page 14).
>
>
Note: To insert the right arrow, enter the characters ->. In 2-D Math, Maple
replaces -> with the right arrow symbol . In 1-D Math, the characters
are not replaced.
2.9 Names • 57 58 • 2 Worksheet Mode
For example, define a function that squares its argument. Unassigning All Names
> square := x -> x^2: The restart command clears the Maple internal memory. The effects include
unassigning all names and unloading all packages. For more information,
> square(32); refer to the ?restart help page.
Note: To use the examples in this manual, you may be required to use the
unassign or restart command between examples.
For more information on functions, see Functional Operators (page 292).
Valid Names
Protected Names A Maple name must be one of the following.
Protected names are valid names that are predefined or reserved.
• A sequence of alphanumeric and underscore (_) characters that begins
If you attempt to assign to a protected name, Maple returns an error. with an alphabetical character. Note: To enter an underscore character
in 2-D Math, enter a backslash character followed by an underscore
> character, that is, \_.
Error, attempting to assign to `sin` which is protected • A sequence of characters enclosed in left single quotes (``).
For more information, refer to the ?type/protected and ?protect help pages. Important: Do not begin a name with an underscore character. Maple re-
serves names that begin with an underscore for use by the Maple library.
Unassigning Names Examples of valid names:
The unassign command resets the value of a name to itself. Note: You must
• a
enclose the name in right single quotes ('').
• a1
>
• polynomial
> • polynomial1_divided_by_polynomial2
• `2a`
• `x#y`
Right single quotes (unevaluation quotes) prevent Maple from evaluating • `x y`
the name. For more information on unevaluation quotes, see Delaying
Evaluation (page 317) or refer to the ?uneval help page.
>
(2.4)
The following chapters describe how to use Maple to perform tasks such as
solving differential (and other types of) equations, producing plots and anim-
2.10 Equation Labels • 63 64 • 2 Worksheet Mode
Integer Operations - How to perform integer • Important Integer Commands Uncertainty Propagation
computations • Non-Base 10 Numbers • Quantities with Uncertainty
65
3.2 Symbolic and Numeric Computation • 67 68 • 3 Performing Computations
>
If a mathematical function is passed a floating-point argument, it normally
attempts to produce a floating-point approximation to the result.
For more information, see the ?evalf and ?Digits help pages.
>
Note: When appropriate, Maple performs floating-point computations directly
using your computer's underlying hardware.
Sources of Error
Converting Exact Quantities to Floating-Point
By its nature, floating-point computation normally involves some error.
Values Controlling the effect of this error is the subject of active research in Numer-
ical Analysis. Some sources of error are:
To convert an exact quantity to a numeric approximation of that quantity,
use the evalf command or the Approximate context menu operation (see • An exact quantity may not be exactly representable in decimal form:
Approximating the Value of an Expression (page 22)).
and are examples.
>
• Small errors can accumulate after many arithmetic operations.
• Subtraction of nearly equal quantities can result in essentially no useful
information. For example, consider the computation for
By default, Maple computes such approximations using 10 digit arithmetic.
You can modify this in one of two ways:
• Locally, you can pass the precision as an index to the evalf call. >
>
No correct digits remain. If, however, you use Maple to analyze this expres-
sion, and replace this form with a representation that is more accurate for
• Globally, you can set the value of the Digits environment variable. small values of , a fully accurate 10-digit result can be obtained.
> >
3.3 Integer Operations • 71 72 • 3 Performing Computations
>
You can quickly perform many integer operations using context menus. Se- >
lecting an integer, and then right-clicking (for Macintosh, Control-clicking)
displays a context menu with integer commands, for example, Integer
Factors, which applies the ifactor command. See Figure 3.1.
For more information on equation labels, see Equation Labels (page 59).
You can also enter the ifactor command and specify the integer to factor as
an argument.
3.3 Integer Operations • 73 74 • 3 Performing Computations
>
>
Maple has many other integer commands, including those listed in Table
3.1.
>
Table 3.1: Select Integer Commands
Command Description
abs absolute value (displays in 2-D math as ) For information on finding integer solutions to equations, see Integer
factorial factorial (displays in 2-D math as ) Equations (page 93).
> >
> For information on enclosing keywords in right single quotes ('), see
Delaying Evaluation (page 317).
> /
Division (displays in 2-D Math as ) >
>
Exponentiation1 &^ >
The mod operator also supports polynomial and matrix arithmetic over finite
rings and fields. For more information, refer to the ?mod help page.
3.4 Solving Equations • 77 78 • 3 Performing Computations
Gaussian Integers Table 3.3: Overview of Solution Methods for Important Equation Types
Gaussian integers are complex numbers in which the real and imaginary Equation Type Solution Method
parts are integers. Equations and inequations solve and fsolve commands
The GaussInt package contains commands that perform Gaussian integer Ordinary differential equations ODE Analyzer Assistant (and dsolve command)
operations. Partial differential equations pdsolve command
The GIfactor command returns the Gaussian integer factorization. Integer equations isolve command
Integer equations in a finite field msolve command
>
Linear systems LinearAlgebra[LinearSolve] command
Recurrence relations rsolve command
You can enter the imaginary unit using the following two methods.
Note: Many solve operations are available as task templates
• In the Common Symbols palette, click the i or j item. See (Tools>Tasks>Browse) and in context menus. This section focuses on other
Palettes (page 11). methods.
• Enter i or j, and then press the symbol completion key. See Symbol
Names (page 16).
Solving Equations and Inequations
Using Maple, you can symbolically solve equations and inequations. You
Note: In 1-D Math input, enter the imaginary unit as an uppercase i (I).
can also solve equations numerically.
The GIsqrt command approximates the square root in the Gaussian integers.
To solve an equation or set of equations using context menus:
> 1. Right-click (for Macintosh, Control-click) the equations.
2. From the context menu, select Solve (or Solve Numerically). See Figure
3.2.
For more information on Gaussian integers including a list of GaussInt
package commands, refer to the ?GaussInt help page.
>
(3.3)
>
Figure 3.2: Context Menu for an Equation Symbolically Solving Equations and Inequations
In Worksheet mode, Maple inserts a calling sequence that solves the equation The solve command is a general solver that determines exact symbolic
followed by the solutions. solutions to equations or inequations. The solutions to a single equation or
inequation are returned as an expression sequence. If Maple does not find
If you select Solve, Maple computes exact solutions. any solutions, the solve command returns the empty expression sequence.
> >
(3.2)
It is recommended that you verify the solutions returned by the solve com-
> mand. For details, see Working with Solutions (page 86).
>
>
W represents the Lambert W function.
>
Multiple Equations To solve multiple equations or inequations, specify
them as a set or list.
>
To produce all solutions, set the _EnvAllSolutions environment variable to
true.
>
RootOf Structure The solve command may return solutions, for example,
to higher order polynomial equations, in an implicit form using RootOf
structures.
To solve for multiple unknowns, specify them as a list.
3.4 Solving Equations • 83 84 • 3 Performing Computations
> >
>
(3.4) (3.5)
Note: You can also numerically solve equations using the context menus.
See Solving Equations and Inequations (page 78).
These RootOf structures are placeholders for the roots of the equation
. The index parameter numbers and orders the four It is recommended that you verify the solutions returned by the fsolve com-
mand. For details, see Working with Solutions (page 86).
solutions.
Multiple Equations To solve multiple equations, specify them as a set. The
Like any symbolic expression, you can convert RootOf structures to a fsolve command solves for all unknowns.
floating-point value using the evalf command.
> >
To find additional solutions to a general equation, use the avoid option to (3.6)
ignore known solutions.
For more information and examples, refer to the ?fsolve/details help page.
>
For information on verifying and using solutions returned by the fsolve
command, see the following section, Working with Solutions.
Complex Solutions To search for a complex solution, or find all complex Working with Solutions
and real roots for a univariate polynomial, specify the complex option.
Verifying It is recommended that you always verify solutions (that the solve
> and fsolve commands return) using the eval command.
>
>
If the fsolve command does not find any solutions, it is recommended that
you specify a range in which to search for solutions, or specify an initial
(3.7)
value.
Range To search for a solution in a range, specify the range in the calling
sequence. The range can be real or complex. >
>
>
The syntax for specifying a region in the complex plane is lower-left
point..upper-right point.
>
>
(3.8)
>
Initial Values You can specify a value for each unknown. The fsolve com-
mand uses these as initial values for the unknowns in the numerical method.
> For more information, see Substituting a Value for a Subexpression (page 310).
3.4 Solving Equations • 87 88 • 3 Performing Computations
>
For more information on defining and using functions, see Functional Oper-
ators (page 292).
Creating a Function from a Solution The assign command assigns a value Other Specialized Solvers
as an expression to a name. It does not define a function. To convert a
solution to a function, use the unapply command. In addition to equations and inequations, Maple can solve other equations
including:
Consider one of the solutions for q to the equation . • Ordinary differential equations (ODEs)
• Partial differential equations (PDEs)
> • Integer equations
• Integer equations in a finite field
> • Linear systems
• Recurrence relations
• From the Tools menu, select Assistants, and then ODE Analyzer.
3.4 Solving Equations • 89 90 • 3 Performing Computations
Maple inserts the dsolve[interactive]() calling sequence in the document. 4. In the Solve Numerically window (Figure 3.4), you can specify the nu-
The ODE Analyzer Assistant (Figure 3.3) is displayed. meric method and relevant parameters and error tolerances to use for solving
the problem.
In the main ODE Analyzer Assistant window, you can define ODEs, initial
or boundary value conditions, and parameters. To define derivatives, use the
diff command. For example, diff(x(t), t) corresponds to , and
You can control the return value of the ODE Analyzer using the On Quit,
Return drop-down list. You can select to return nothing, the displayed plot,
the computed numeric procedure (for numeric solutions), the solution (for
symbolic solutions), or the Maple commands needed to produce the solution
values and the displayed plot.
>
(3.9)
>
Integer Equations in a Finite Field
To solve an equation modulo an integer, use the msolve command. For more
information, refer to the ?msolve help page. The msolve command finds
The solution is an arbitrary univariate function applied to . solutions for all variables.
Maple generally prints only the return value, errors, and warnings during a
>
computation. To print information about the techniques Maple uses, increase
the infolevel setting for the command.
Integer Equations
To find only integer solutions to an equation, use the isolve command. The
isolve command finds solutions for all variables. For more information, refer
to the ?isolve help page. >
3.5 Units, Scientific Constants, and Uncertainty • 95 96 • 3 Performing Computations
Units
The Units package in Maple provides a library of units, and facilities for
using units in computations. It is fully extensible so that you can add units
as required.
For more information on using Maple to solve linear algebra problems, see
Linear Algebra (page 133). Note: Some unit operations are available as task templates (see
Tools>Tasks>Browse) and through context menus.
Solving Recurrence Relations
Overview of Units
To solve a recurrence relation, use the rsolve command. For more informa-
tion, refer to the ?rsolve help page. The rsolve command finds the general A dimension is a measurable quantity, for example, length or force. The set
term of the function. of dimensions that are fundamental and independent are known as base di-
mensions.
>
In Maple, the base dimensions include length, mass, time, electric current,
thermodynamic temperature, amount of substance, luminous intensity, in-
formation, and currency. For a complete list, run Units[GetDimensions]().
For the complete list of units (and their contexts and symbols) available for
a dimension, refer to the corresponding help page, for example, the
?Units/length help page for the units of length.
Figure 3.6: Unit Converter Assistant
Each unit has a context. The context differentiates between different defini-
tions of the unit. For example, the standard and US survey miles are different To perform a conversion:
units of length, and the second is a unit of time and of angle. You can specify
the context for a unit by appending the context as an index to the unit, for 1. In the Convert text field, enter the numeric value to convert.
example, mile[US_survey]. If you do not specify a context, Maple uses the
default context. 2. In the Dimension drop-down list, select the dimensions of the unit.
Units are collected into systems, for example, the foot-pound-second (FPS) 3. In the From and To drop-down lists, select the original unit and the unit
system and international system, or système international, (SI). Each system to which to convert.
has a default set of units used for measurements. In the FPS system, the foot, 4. Click Perform Unit Conversion.
pound, and second are used to measure the dimensions of length, mass, and
time. The unit of speed is the foot/second. In SI, the meter, kilogram, and Maple inserts the corresponding convert/units command into the document.
second are used to measure the dimensions of length, mass, and time. The
units of speed, magnetic flux, and power are the meter/second, weber, and >
watt.
Conversions
Important: Using the Units Calculator, you can convert temperatures and
To convert a value measured in a unit to the corresponding value in a different temperature changes.
unit, use the Units Calculator.
3.5 Units, Scientific Constants, and Uncertainty • 99 100 • 3 Performing Computations
>
To convert absolute temperatures, the Unit Converter uses the convert/tem- Figure 3.7: Units (FPS) Palette Figure 3.8: Units (SI) Palette
perature command. For example, 32 degrees Fahrenheit corresponds to 0
degrees Celsius. To insert a unit:
>
For example, to enter standard (the default context) miles, you can
specify the unit name, mile, or symbol, mi.
>
3.5 Units, Scientific Constants, and Uncertainty • 101 102 • 3 Performing Computations
>
Some units support prefixes. For example, SI units support prefixes to names (3.10)
and symbols. You can specify 1000 meters using kilometer or km. For more
information, refer to the ?Units/prefixes help page. >
>
(3.11)
>
Performing Computations with Units
In the default Maple environment, you cannot perform computations with
quantities that have units. You can perform only unit conversions. For more
information about the default environment, refer to the ?Units/default help For information on differentiation and integration, see Calculus (page 151).
page.
Changing the Current System of Units
To compute with expressions that have units, you must load a Units envir-
onment, Natural or Standard. It is recommended that you use the Standard If a computation includes multiple units, all units are expressed using units
environment. from the current system of units.
> >
>
Scientific Constants and Element Properties
Computations often require not only units (see Units (page 96)), but also the
values of scientific constants, including properties of elements and their
isotopes. Maple supports computations with scientific constants. You can
use the built-in constants and add custom constants.
To view the name of the default system of units, use the Units[UsingSystem]
command. Overview of Scientific Constants and Element Properties
Scientific Constants
Maple contains many built-in scientific constants, which you can easily in-
Extensibility clude in your computations.
You can extend the set of: List of Scientific Constants
• Base dimensions and units You have access to scientific constants important in engineering, physics,
• Complex dimensions chemistry, and other fields. Table 3.5 lists some of the supported constants.
For a complete list of scientific constants, refer to the ?ScientificCon-
• Complex units
stants/PhysicalConstants help page.
• Systems of units
For more information about units, refer to the ?Units help page.
3.5 Units, Scientific Constants, and Uncertainty • 105 106 • 3 Performing Computations
The GetConstant command in the ScientificConstants package returns the To see the list of supported isotopes for an element, use the GetIsotopes
complete definition of a constant. command.
To view the definition of the Newtonian gravitational constant, specify the >
symbol G (or its name) in a call to the GetConstant command.
>
Maple supports isotopes and has a distinct set of properties for isotopes, in-
> cluding abundance, binding energy (bindingenergy), and mass excess
(massexcess). For a complete list of isotope properties, refer to the ?Scien-
tificConstants/properties help page.
Element Properties
Maple also contains element properties and isotope properties.
3.5 Units, Scientific Constants, and Uncertainty • 107 108 • 3 Performing Computations
> Value
To obtain the value of a ScientificConstants object, use the evalf command.
>
>
> Note: The value returned depends on the current system of units. For inform-
ation on controlling the system of units, see Changing the Current System
of Units (page 102).
Units
To obtain the units for a ScientificConstants object, use the GetUnit com-
mand.
Value, Units, and Uncertainty
To use constants or element properties, you must first construct a Scientific- >
Constants object.
>
>
• Constants
• Elements (and isotopes)
>
• Element (or isotope) properties
>
Units Quantities with errors can have units. For example, the scientific
> constants and element (and isotope) properties in the ScientificConstants
packages are quantities with errors and units.
For a relative error, you can specify the units in only the value.
To access the value and uncertainty of a quantity with uncertainty, use the >
evalf and ScientificErrorAnalysis[GetError] commands.
>
For information on the correlation between, variance of, and covariance
between quantities with uncertainty, refer to the ?ScientificErrorAnalysis
help page.
>
Performing Computations with Quantities with Uncertainty
Many Maple commands support quantities with uncertainty.
3.5 Units, Scientific Constants, and Uncertainty • 113 114 • 3 Performing Computations
>
Additional Information
For information on topics including:
• Creating new rounding rules
• Setting the default rounding rule
3.6 Restricting the Domain • 115 116 • 3 Performing Computations
Note: The assume and assuming commands are not supported by the
RealDomain package.
Some commands that generally return NULL instead return a numeric result
when you use the RealDomain package. The assume Command
You can use the assume command to set variable properties, for example,
> x::real, and relationships between variables, for example, x < 0 or x < y.
For information on valid properties, refer to the ?assume help page. For in-
formation on the double colon (::) operator, refer to the ?type help page.
Complex return values are excluded or replaced by undefined. The assume command allows improved simplification of symbolic expres-
sions, especially multiple-valued functions, for example, computing the
> square root.
To assume that x is a positive real number, use the following calling sequence.
>
Then compute the square root of .
>
The trailing tilde (~) on the name x indicates that it carries assumptions.
When you use the assume command to place another assumption on x, all
previous assumptions are removed.
>
3.6 Restricting the Domain • 117 118 • 3 Performing Computations
Displaying Assumptions To view the assumptions on an expression, use To test whether an expression can satisfy a condition, use the coulditbe
the about command. command.
> >
Originally x, renamed x~: is assumed to be: RealRange(-infinity,Open(0))
Imposing Multiple Assumptions To simultaneously impose multiple con- Removing Assumptions To remove all assumptions on a variable, unassign
ditions on an expression, specify multiple arguments in the assume calling its name.
sequence.
>
>
For more information, see Unassigning Names (page 57).
To specify additional assumptions without replacing previous assumptions,
use the additionally command. The syntax of the additionally calling se- For more information on the assume command, refer to the ?assume help
quence is the same as that of the assume command. page.
>
The following test returns false because there are values of x and y (x = 0,
y = 10) that satisfy the assumptions, but do not satisfy the relation in the is
calling sequence. Using the assuming command is equivalent to imposing assumptions with
the assume command, evaluating the expression, and then removing the as-
> sumptions.
3.6 Restricting the Domain • 119 120 • 3 Performing Computations
>
x: nothing known about this object
If you do not specify the names to which to apply a property, it is applied to >
all names.
> For more information on the assuming command, refer to the ?assuming
help page.
>
>
>
The assuming command does not affect variables inside procedures. (For
information on procedures, see Procedures (page 338).) You must use the
assume command.
> f := proc(x) sqrt(a^2) + x end proc;
>
122 • 4 Mathematical Computations
121
4.1 In This Chapter • 123 124 • 4 Mathematical Computations
Multiplication1 * >
Important: You must insert a space character or a multiplication operator
( ) between adjacent variables names. Otherwise, they are interpreted as
a single variable.
Division: Quotient quo >
and Remainder rem For example, does not divide the single variable .
>
>
1
You can specify multiplication explicitly by entering *, which displays in 2-D Math as
. In 2-D Math, you can also implicitly multiply by placing a space character between For information on polynomial arithmetic over finite rings and fields, refer
two expressions. In some cases, the space character is optional. For example, Maple inter- to the ?mod help page.
prets a number followed by a name as an implicit multiplication.
2
In 2-D Math, exponents display as superscripts. Sorting Terms
To sort the terms of a polynomial, use the sort command.
To expand a polynomial, use the expand command.
4.2 Algebra • 127 128 • 4 Mathematical Computations
>
The first term has total degree 4. The other two terms have total degree 3.
The order of the final two terms is determined by the order of their names
> in the list.
To sort the terms by pure lexicographic order, that is, first by decreasing
order of the first unknown in the list option, and then by decreasing order of
Note: The sort command returns the sorted polynomial, and updates the the next unknown in the list option, specify the 'plex' option.
order of the terms in the polynomial.
>
The terms of p1 are sorted.
>
For information on enclosing keywords in right single quotes ('), see
Delaying Evaluation (page 317).
To specify the unknowns of the polynomial and their ordering, include a list The first term has a power of to the 3. The second, a power of to the
of names. 2. The third, a power of to the 0.
> Using context menus, you can perform operations, such as sorting, for
polynomials and many other Maple objects.
To sort a polynomial:
> 1. Right-click (Control-click, for Macintosh) the polynomial.
You can use context menus to perform operations on 2-D Math content in-
cluding output. For more information, see Context Menus (page 20) (for
Document mode) or Context Menus (page 46) (for Worksheet mode).
Collecting Terms
To collect the terms of polynomial, use the collect command.
>
In Worksheet mode, Maple inserts the calling sequence that performs the lcoeff Leading coefficient
>
sort followed by the sorted polynomial.
>
>
4.2 Algebra • 131 132 • 4 Mathematical Computations
Command Description Example To solve for the roots of a polynomial, use the solve command. For inform-
tcoeff Trailing coefficient
ation on the solve command, see Solving Equations and Inequa-
> tions (page 78). (The isolve command solves an equation for integer solutions.
For more information, see Integer Equations (page 93).)
Other Commands
coeffs Sequence of all coefficients in increasing
> Table 4.4 lists other commands available for polynomial operations.
degree order.
Note: It does not return zero coeffi-
Table 4.4: Select Other Polynomial Commands
cients.
Command Description
Command Description
sqrfree Square free factorization (multivariate polyno-
mial)
Additional Information
You can perform many linear algebra operations using task templates. In the
Task Browser (Tools>Tasks>Browse), expand the Linear Algebra folder.
Creating Matrices
To create a matrix, use the Matrix palette. See Figure 4.2.
4.3 Linear Algebra • 135 136 • 4 Mathematical Computations
>
Creating Vectors
To create a vector, use angle brackets (< >).
To create a column vector, specify a comma-delimited sequence, <a, b, c>.
The number of elements is inferred from the number of expressions.
>
>
1. Enter the values of the entries. To move to the next entry placeholder, Matrices and smaller, and vectors with 10 or fewer elements display
press Tab. in the document. Larger objects are displayed as a placeholder.
2. After specifying all entries, press Enter. For example, insert a matrix.
4.3 Linear Algebra • 137 138 • 4 Mathematical Computations
2. In the Type drop-down list, select a matrix type, for example, Custom
values.
>
You can view the matrix or vector as a table or as an image, which can be 5. Enter the values in the diagonal entries.
inserted into the document. For more information, refer to the ?Mat-
rixBrowser help page.
To set the maximum dimension of matrices and vectors displayed inline: >
For example, interface(rtablesize = 15). Note: To create a matrix with randomly-generated entries, select the Random
Type.
For more information, refer to the ?interface help page.
You cannot specify properties when defining vectors using the angle-
Creating Matrices and Vectors for Large Problems bracket notation. You must use the Vector constructor.
By default, matrices and vectors can store any values. To increase the effi- To define a column vector using the Vector constructor, specify:
ciency of linear algebra computations, create matrices and vectors with
• The number of elements. If you explicitly specify all element values,
properties. You must specify the properties, for example, the matrix or vector
this argument is not required.
type or the data type, when defining the object.
• A list of expressions that define the element values.
The Matrix palette (Figure 4.2) supports several properties.
• Parameters such as shape, datatype, and fill that set properties of the
To specify the matrix type: vector.
• Use the Shape and Type drop-down lists. The following two calling sequences are equivalent.
To create a row vector using the Vector constructor, include row as an index.
>
For example:
>
>
>
> • The scalar multiplication operator is the asterisk (*), which displays in
math as . The noncommutative matrix and vector multiplication op-
erator is the period (.).
• There is no division operator (/) for matrix algebra. (You can construct
the inverse of a matrix using the exponent .)
>
See Table 4.6.
>
Similarly, you can access submatrices using an index. In the following two- Table 4.6: Matrix and Vector Arithmetic Operators
dimensional matrix, the first entry selects rows and the second, columns. Operation Operator Example
Addition >
>
Multiplication . >
Linear Algebra Computations
You can perform matrix and vector computations using context menus and
the LinearAlgebra package.
Matrix Arithmetic
The matrix and vector arithmetic operators are the standard Maple arithmetic
operators up to the following two differences.
4.3 Linear Algebra • 145 146 • 4 Mathematical Computations
Operation Operator Example Table 4.7: Select Matrix and Vector Operators
>
Hermitian Transpose ^%H1
>
Exponentiation2 ^ >
1
Exponential operators display in 2-D Math as superscripts.
2
After loading the LinearAlgebra package, the cross product operator is available as the
1
You can specify scalar multiplication explicitly by entering *, which displays in 2-D infix operator &x . Otherwise, it is available as the LinearAlgebra[CrossProduct] com-
Math as . In 2-D Math, you can also implicitly multiply a scalar and a matrix or vector mand.
by placing a space character between them. In some cases, the space character is optional.
For example, Maple interprets a number followed by a name as an implicit multiplication. For information on matrix arithmetic over finite rings and fields, refer to the
2
In 2-D Math, exponents display as superscripts. ?mod help page.
Point-and-Click Interaction
A few additional matrix and vector operators are listed in Table 4.7.
Using context menus, you can perform many matrix and vector operations.
Define two column vectors.
Matrix operations available in the context menu include the following.
>
4.3 Linear Algebra • 147 148 • 4 Mathematical Computations
For example, compute the infinity norm of a matrix. See Figure 4.5. • Compute the norm (1, Euclidean, and infinity)
• Compute the transpose
• Select an element
For more information on context menus, see Context Menus (page 20) (for
Document mode) or Context Menus (page 46) (for Worksheet mode).
Command Description
GaussianElimination Perform Gaussian elimination on a matrix
HessenbergForm Reduce a square matrix to Hessenberg form
HilbertMatrix Construct a generalized Hilbert matrix
IsOrthogonal Test if a matrix is orthogonal To express (25, -4, 9) in this basis, use the LinearSolve command.
LeastSquares Compute the least-squares approximation to A . x = b >
LinearSolve Solve the linear system A . x = b
MatrixInverse Compute the inverse of a square matrix or pseudo-inverse of a non-
square matrix
QRDecomposition Compute a QR factorization of a matrix
RandomMatrix Construct a random matrix
SylvesterMatrix Construct the Sylvester matrix of two polynomials
For information on arithmetic operations, see Matrix Arithmetic (page 143). Numeric Computations
For information on selecting entries, subvectors, and submatrices, see Access- You can very efficiently perform computations on large matrices and vectors
ing Entries in Matrices and Vectors (page 142). that contain floating-point data using the built-in library of numeric linear
Example Determine a basis for the space spanned by the set of vectors {(2, algebra routines. Some of these routines are provided by the Numerical Al-
13, -15), (7, -2, 13), (5, -4, 9)}. Express the vector (25, -4, 9) with respect to gorithms Group (NAG®). Maple also contains portions of the CLAPACK
this basis. and optimized ATLAS libraries.
For information on performing efficient numeric computations using the
>
LinearAlgebra package, refer to the ?EfficientLinearAlgebra help page.
> See also Creating Matrices and Vectors for Large Problems (page 139).
Find a basis for the vector space spanned by these vectors, and then construct Student LinearAlgebra Package
a matrix from the basis vectors.
The Student package contains subpackages that help instructors teach con-
> cepts and allow students to visualize and explore ideas. These subpackages
also contain computational commands.
4.4 Calculus • 151 152 • 4 Mathematical Computations
This section describes the key Maple calculus commands, many of which >
are used in task templates or available in the context menus.
For a complete list of calculus commands, refer to the Mathematics (includ- >
ing Calculus, Differential Equations, Power Series, and Vector Calculus
subfolders) and Student Package sections of the Maple Help System Table
of Contents. Using the limit command, you can also compute multidimensional limits.
Limits
>
To compute the limit of an expression as the independent variable ap-
proaches a value:
• Use the evalf(Limit(arguments)) calling sequence. 1. In the Expression palette, click the differentiation item or the
Important: Use the inert Limit command, not the limit command. For more
partial differentiation item .
information, refer to the ?limit help page.
2. Specify the expression and independent variable, and then evaluate it.
The Limit command accepts the same arguments as the limit command.
> >
For information on the evalf command, see Numerical Approxima- You can also differentiate using context menus. For more information, see
tion (page 313). Context Menus (page 20).
The Limit command does not compute the limit. It returns an unevaluated To calculate a higher order or partial derivative, edit the derivative symbol
limit. inserted. For example, to calculate the second derivative of
with respect to :
>
>
For more information on the Limit command, refer to the ?Limit help page.
>
To calculate a higher order derivative, specify a sequence of differentiation The D operator returns a functional operator.
variables. Maple recursively calls the diff command.
For example, find the derivative of an operator that represents the mathem-
> atical function .
To calculate a partial derivative, use the same syntax. Maple assumes that 1. In the Expression palette, click the single-variable function definition
the derivatives commute. item .
• To move to the next placeholder, press the Tab key. Note: If pressing
the Tab key inserts a tab, click the Tab icon in the toolbar.
>
To enter higher order derivatives, it is convenient to use the sequence oper-
ator ($). For more information, refer to the ?$ help page.
Now, define the operator, G, that maps to the derivative of .
4.4 Calculus • 157 158 • 4 Mathematical Computations
>
>
For more information on the D operator, refer to the ?D help page. For a
comparison of the diff command and D operator, refer to the ?diffVersusD
help page.
Directional Derivative
To compute and plot a directional derivative, use the Directional Derivative
Tutor. The tutor computes a floating-point value for the directional derivat-
ive.
Figure 4.7: Directional Derivative Tutor
To launch the tutor:
To compute a symbolic value for the directional derivative, use the Stu-
From the Tools menu, select Tutors, Calculus - Multi-Variable, and then dent[MultivariateCalculus][DirectionalDerivative] command. The first
Directional Derivatives. Maple launches the Directional Derivative Tutor. list of numbers specifies the point at which to compute the derivative. The
See Figure 4.7. second list of numbers specifies the direction in which to compute the deriv-
ative.
For example, at the point [1, 2], the gradient of points in the direction
[2, 4], which is the direction of greatest increase. The directional derivative
in the orthogonal direction [-2, 1] is zero.
>
4.4 Calculus • 159 160 • 4 Mathematical Computations
>
>
To set the order for all computations, use the Order environment variable.
Series For information about the Order variable and the term, refer to the
To generate the Taylor series expansion of a function about a point, use the ?Order help page.
taylor command. The expansion is of type series. Some commands, for example, plot, do not
accept arguments of type series. To use the expansion, you must convert it
> to a polynomial using the convert/polynom command.
>
Note: If a Taylor series does not exist, use the series command to find a
general series expansion.
For example, the cosine integral function does not have a taylor series expan-
sion about 0. For more information, refer to the ?Ci help page.
>
Error, does not have a taylor expansion, try series()
>
4.4 Calculus • 161 162 • 4 Mathematical Computations
For information on Maple types and type conversions, see Maple Expres- To compute the definite integral of an expression:
sions (page 285).
To compute the indefinite integral of an expression: For example, to integrate over the interval (0, ∞):
>
Recall that you can also enter symbols, including and , using symbol
completion.
• Enter the symbol name (or part of the name), for example, int and d, and
then press the completion shortcut key.
The int Command
For more information, see Symbol Names (page 16).
You can also compute an indefinite integral using context menus. For more and use the int command. To use the int command directly,
information, see Context Menus (page 20).
specify the following arguments.
• Expression to integrate
• Variable of integration
4.4 Calculus • 163 164 • 4 Mathematical Computations
>
(4.3) Note: To enter an underscore character (_) in 2-D Math, enter \_.
For information on solving ODEs and PDEs, see Other Specialized Solv-
Numeric Integration
ers (page 88).
To perform numeric integration:
Calculus Packages
• Use the evalf(Int(arguments)) calling sequence.
In addition to top-level calculus commands, Maple contains calculus pack-
Important: Use the inert Int command, not the int command. For more in- ages.
formation, refer to the ?int help page.
VectorCalculus Package
In addition to the arguments accepted by the int command, you can include
optional arguments such as method, which specifies the numeric integration The VectorCalculus package contains commands that perform multivariate
method. and vector calculus operations on VectorCalculus vectors (vectors with an
additional coordinate system attribute) and vector fields (vectors with addi-
For example:
tional coordinate system and vectorfield attributes), for example, Curl, Flux,
and Torsion.
>
>
>
4.4 Calculus • 165 166 • 4 Mathematical Computations
For information on using Maple as a teaching and learning tool, and some
computational examples, see Teaching and Learning with Maple (page 178).
4.5 Optimization
Find the flux of VectorField1 through a sphere of radius r at the origin.
Using the Optimization package, you can numerically solve optimization
> problems. The package uses fast Numerical Algorithms Group (NAG) al-
gorithms to minimize or maximize an objective function.
Compute the torsion of a space curve. The curve must be a vector with • Linear programs
parametric function components. • Quadratic programs
• Nonlinear programs
>
• Linear and nonlinear least-squares problems
The primary method for solving optimization problems is the Optimization 3. Click the Solve button. The solution is displayed in the Solution text box.
Assistant. You can also enter the problem (objective function, constraints, and bounds)
To launch the Optimization Assistant: in the calling sequence.
• From the Tools menu, select Assistants, and then Optimization. For example, find the maximum of subject to the constraints
Maple inserts the Optimization[Interactive]() calling sequence (in Worksheet .
mode), and launches the Optimization Assistant. See Figure 4.8.
>
In the Optimization Assistant window, click the Plot button. The Optimiz-
ation Plotter window is displayed. See Figure 4.9.
To solve a problem:
1. Enter the objective function, constraints, and bounds.
4.5 Optimization • 169 170 • 4 Mathematical Computations
problem variables.
>
>
Define the matrix A, the coefficient matrix for the linear inequality con-
straints.
>
>
Figure 4.9: Optimization Assistant Plotter Window The QPSolve command solves quadratic programs.
For information on the algorithms used to solve optimization problems, refer >
to the ?Optimization/Methods help page.
For additional information on performing efficient computations, refer to supports many discrete distributions, including the Bernoulli, geometric,
the ?Optimization/Computation help page. and Poisson distributions.
MPS(X) File Support For a complete list of distributions, refer to the ?Statistics/Distributions
help page.
To import linear programs from a standard MPS(X) data file, use the Import-
You can define random variables by specifying a distribution in a call to the
MPS command.
RandomVariable command.
Additional Information >
For a complete list of commands and other Optimization package informa-
tion, refer to the ?Optimization help page. >
In addition to standard data analysis tools, the Statistics package provides represents the Dirac delta function. For more information, refer to the
a wide range of symbolic and numeric tools for computing with random
?Dirac help page.
variables. The package supports over 35 major probability distributions and
can be extended to include new distributions. Adding Custom Distributions
Probability Distributions and Random Variables To add a new distribution, specify a probability distribution in a call to the
Distribution command.
The Statistics package supports:
• Continuous distributions, which are defined along the real line by prob-
ability density functions. Maple supports many continuous distributions, >
including the normal, Student-t, Laplace, and logistic distributions.
• Discrete distributions, which have nonzero probability only at discrete
points. A discrete distribution is defined by a probability function. Maple
To construct a piecewise-continuous function in 1-D Math, use the piecewise
command, for example, t -> piecewise(t < 0, 0, t < 3, 1/3, 0).
4.6 Statistics • 173 174 • 4 Mathematical Computations
Define a new random variable with this distribution. • Specify the 'numeric' option.
> >
Example 2
Compute the hazard rate of the Cauchy distribution with location and scale
parameters a and b at an arbitrary point t.
Calculate the mean value of the random variable.
>
>
Examples
Example 1
Compute the average absolute range from the interquartile of the Rayleigh
distribution with scale parameter 3. You can also specify that Maple compute the result numerically.
> >
Plotting
You can generate statistical plots using the visualization commands in the
Statistics package. Available plots include:
• Bar chart
• Frequency plot
• Histogram
• Pie Chart
• Scatter Plot
For example, create a scatter plot for a distribution of points that vary from
• Function
>
>
4.6 Statistics • 177 178 • 4 Mathematical Computations
Maple Application CenterTM The Maple Application Center contains tutorials and ap-
plications that help instructors begin using Maple and use
Maple in the classroom. Browse the many resources in
the Education and Education PowerTools categories.
(http://www.maplesoft.com/applications)
Additional Information
For more information on the Statistics package, including regression analysis,
estimation, data manipulation, and data smoothing, refer to the ?Statistics
help page.
4.7 Teaching and Learning with Maple • 179 180 • 4 Mathematical Computations
Resource Description
Maple Student CenterTM The Maple Student Center contains tutorials and applica-
tions that help students learn how to use Maple, explore
mathematical concepts, and solve problems. Available
resources include:
• Study guides - Complete lessons with examples for
academic courses, including precalculus and calculus.
For example, the Interactive Precalculus Study Guide
contains worked problems, each solved as in a stand-
ard textbook, using Maple commands and custom
Maplet graphical interfaces.
• Free course lessons for many subjects including pre-
calculus to vector calculus; high school, abstract, and
linear algebra; engineering; physics; differential
equations; cryptography; and classical mechanics.
(http://www.maplesoft.com/academic/students)
• Teach concepts without being distracted by the mechanics of the compu- Students can:
tations. • Perform step-by-step computations, for example, compute a derivative
• Create examples and quickly update them during a lesson to demonstrate by applying differentiation rules using commands or a tutor
different cases or show the effect of the variation of a parameter. (Tools>Tutors>Calculus - Single Variable>Differentiation Methods).
See Figure 4.11.
• Create plots and animations to visually explain concepts, for example,
the geometric relationship between a mathematical function and its de- • Perform computations.
rivatives (Tools>Tutors>Calculus - Single Variable>Derivatives). See • Visually explore concepts.
Figure 4.10.
4.7 Teaching and Learning with Maple • 181 182 • 4 Mathematical Computations
By rotating the three-dimensional plot, you can show that the gradient points
in the direction of greatest increase of the surface (see Figure 4.12) and show
the direction of the gradient vector in the x-y plane (see Figure 4.13).
To launch a tutor:
• Plot that visually indicates the vector field, path of integration, and tangent
vectors to the path
• Unevaluated line integral
• Numeric value of the line integral
>
>
4.7 Teaching and Learning with Maple • 185 186 • 4 Mathematical Computations
For more information on the Student package, refer to the ?Student help
page.
>
(4.4)
>
>
188 • 5 Plots and Animations
5.1 In This Chapter Exporting - Methods for exporting plots • Saving Plots to File Formats
Section Topics Code for Color Plates - Information on color • Accessing Code for the Color Plates
plates
Creating Plots - Interactive and command-driven • Interactive Plot Builder
methods to display 2-D and 3-D plots • Context Menu
• Dragging to a Plot Region 5.2 Creating Plots
• The plot and plot3d Commands
Maple offers several methods to easily plot an expression. These methods
• The plots Package
include:
• Multiple Plots in the Same Plot Re-
gion • The Interactive Plot Builder
• Context menus
Customizing Plots - Methods for applying plot • Interactive Plot Builder Options • Dragging to a plot region
options before and after a plot displays • Context Menu Options
• Commands
• The plot and plot3d Command Op-
tions Each method offers a unique set of advantages. The method you use depends
on the type of plot to display, as well as your personal preferences.
187
5.2 Creating Plots • 189 190 • 5 Plots and Animations
Interactive Plot Builder Table 5.1: Windows of the Interactive Plot Builder
1. Specify Expressions window 2. Select Plot Type window
The Interactive Plot Builder is a point-and-click interface to the Maple
plotting functionality. The interface displays plot types based on the expres-
sion you specify. The available plot types include plots, interactive plots,
animations, or interactive animations. Depending on the plot type you select,
you can create a:
• 2-D / 3-D plot
• 2-D / 3-D conformal plot of a complex-valued function
• 2-D / 3-D complex plot
• 2-D density plot
• 2-D gradient vector-field plot
• 2-D implicit plot
The output from the Interactive Plot Builder is a plot of the expression or
the command used to generate the plot in the document.
Plot Builder.
Builder.
3. Plot Options window - Apply plot options. Once finished, you can display window.
the plot or return the command that generates the plot to the document.
5.2 Creating Plots • 193 194 • 5 Plots and Animations
Example 2 - Display a plot of multiple expressions of 1 variable Launch the Plot Options win- Click Command.
dow and return the plot com-
Maple can display multiple expressions in the same plot region to compare mand syntax to the document.
and contrast. The Interactive Plot Builder accepts multiple expressions.
Display the actual plot. Execute the inserted command, that is, display the plot.
5.2 Creating Plots • 195 196 • 5 Plots and Animations
Step Details
Launch the Plot Options win- In the Select Plot Type window:
dow.
a. Notice the available plot types for an expression
each type.
b. Click Options.
By default, Maple displays each plot in a plot region using a different color. a. From the Variables column, change the
You can also apply a line style such as solid, dashed, or dotted for each ex-
pression in the graph. For more information, refer to the ?plot/options help Range fields to 0 .. 0.05.
page. To see the Maple syntax used to generate this plot, see Maple com-
b. From the Labels column, enter z.
mands from Creating Plots: Interactive Plot Builder (page 207)
c. From the Color group box, select Light
Example 3 - Display a plot of a multi-variable expression
Model, and then green-red.
Maple can display three-dimensional plots and offers numerous plot options
such as light models, surface styles, and shadings to allow you to customize d. From the Color group box, select Shading,
the plot.
and then z (grayscale).
Table 5.4: Displaying a Plot of a Multi-variable Expression
e. From the Style group box, select patch w/o
Step Details
Launch the Interactive Plot Add the expression (1+sin(x*y))/(x^2+y^2). grid.
Builder and enter an expression.
f. From the Miscellaneous group box, select
Step Details
Select a plot type. In the Select Plot Type window:
expression.
0 .. 2+2*I.
To see the Maple syntax used to generate this plot, see Maple commands a. From the Axes group box, select normal.
from Creating Plots: Interactive Plot Builder (page 207)
b. From the Miscellaneous group box, select
Example 4 - Display a conformal plot
the Grid Size drop-down menu option 30, 30.
Maple can display a conformal plot of a complex expression mapped onto
a two-dimensional grid or plotted on the Riemann sphere in 3-D. Plot the expression. Click Plot.
select polar.
select magenta.
Steps Details
Select a plot type. In the Select Plot Type window:
window.
Adjust the plot. 1. To adjust the numeric values, use the slider.
Figure 5.1: Interactive Parameter Window 2. Click Done to return the plot to the Maple document.
By invoking the Interactive Plot Builder through the context menu, the
expression automatically passes to the builder and Maple does not display
the Specify Expression window.
3. From the context menu, select Plots > 3-D Plot > x,y.
To see the Maple syntax used to generate this plot, see Maple commands
from Creating Plots: Interactive Plot Builder (page 207)
For information on customizing plots using the Interactive Plot Builder,
refer to Customizing Plots : Interactive Plot Builder Options (page 215).
Context Menu
A context menu in Maple displays a list of commands to manipulate, display,
or calculate using a Maple expression. The commands in the menu depend
on the type of the expression. To display the context menu for a Maple ex-
pression, right-click (for Macintosh, Control-click) the expression.
>
For information on customizing plots using the context menu, see Context
Menu Options (page 216).
Advantages of the drag-and-drop method include the ease of adding and re-
moving plots and the independence from plotting command syntax.
3. Select the full expression in the input region and drag it into the plot region.
>
The plot and plot3d Commands Example 3 - Display a plot of a multi-variable expression
> For more information on the plot options described in this section, refer to
the ?plot/options and ?plot3d/options help pages.
5.2 Creating Plots • 209 210 • 5 Plots and Animations
>
>
>
The matrixplot command plots the values of a plot object of type Matrix.
The matrixplot command accepts options such as heights and gap to control
the appearance of the plot. For more information on Matrices, see Linear
Algebra (page 133).
>
>
>
5.2 Creating Plots • 213 214 • 5 Plots and Animations
>
This example plots a curve over a hill with the shadow of the curve projected
onto the hill.
>
>
>
Multiple Plots in the Same Plot Region
List of Expressions >
To display multiple expressions in the same plot region, enter the expressions >
in a list data structure. To distinguish the surfaces, apply different shading
options, styles, or colors to each surface. Maple can draw curves in three-dimensional space.
5.3 Customizing Plots • 215 216 • 5 Plots and Animations
text field.
Now that you have seen how easy it is to incorporate a plot into your work,
the next section illustrates how to customize plots. Plot the expression. Click Plot.
options using the Plot toolbar and Plot menu options. These menus display Steps Details
when a plot region is selected. Regardless of the method used to insert a plot Change the color. Place the mouse pointer on the curve and right-click (Con-
into Maple, you can use the context menu to apply different plot options. trol-click, for Macintosh). Note: The curve is selected when
For a list of options available when plotting in two and three dimensions, it becomes highlighted. Select Color, and then Green.
see The plot and plot3d Options (page 219).
Change the line style. Select Style, and then Point.
In the previous plot, all interesting details of the plot are lost because there
is a singularity at x = 1. The solution is to view a narrower range, for example,
Maple has many preselected light source configurations.
from y = 0 to 7.
Table 5.11: Customizing 3-D Plots Using the Context Menu
Table 5.10: Customizing 2-D Plots Using the Context Menu
Steps Details
Steps Details
Change the style. Right-click the plot region. Select Style, and then Patch
Alter the y-axis range. 1. Right-click the plot region. Select Axes, and then Range. (Without Grid).
2. In the Axes Ranges dialog, in the y group box, select the
bottom radio button and enter 0 and 7 in the text regions Apply a light scheme. Select Lighting, and then Light Scheme 1.
provided. Change the color. Select Color, and then Z (Grayscale).
5.3 Customizing Plots • 219 220 • 5 Plots and Animations
If you are using commands to insert a plot, you can specify plot options as symbol Defines the symbol for points in the plot, one of: asterisk, box, circle,
cross, diagonalcross, diamond, point, solidbox, solidcircle, or
arguments at the end of the calling sequence. You can specify the options soliddiamond for 2-D plots; asterisk, box, circle, cross, diagonal-
in any order. Applying plot options in the command syntax offers a few more cross, diamond, point, solidsphere, or sphere for 3-D plots
options and greater control than what is available in the Interactive Plot
title Defines a title for the plot
Builder and context menus.
thickness Defines the thickness of lines in the plot
Table 5.12: Popular Plot Options
transparency (3-D) Controls the transparency of the plot surface
Option Description
view Defines the minimum and maximum coordinate values of the curve
axes Defines the type of axes, one of: boxed, frame, none, or normal displayed on the screen
> Zoom Zoom into or out of the plot by changing the view ranges for 2-D
plots. Smartplots will resample to reflect the new view. Make the
plot larger or smaller in the plot window for 3-D plots
select Animation.
1 .. 30. For information on playing the animation, see Playing Animations (page 226).
To see the Maple syntax used to generate this plot, see Maple Syntax for
Set plot options. In the Plot Options window: Creating Animations: Interactive Plot Builder Example (page 225).
a. From the Style group box, select Surface. The plots[animate] Command
b. From the Color group box, in the Light Model You can also use the animate command, in the plots package, to generate
drop-down menu select red-turquoise.
animations.
To access the command, use the short form name after invoking the For more information on the animate command, refer to the ?plots[animate]
with(plots) command. help page.
>
5.6 Playing Animations
Maple Syntax for Creating Animations: Interactive Plot Builder
Example Animation Context Bar
The following example shows the plotting command returned by the example To run the animation, click the plot to display the Animate context bar.
in Interactive Plot Builder (page 223).
Table 5.16: Animation Options
Name Icon Description
>
Previous View the previous
Frame frame in the animation.
Stop Stop the animation.
Animate a 2-D plot
Play Play the selected anim-
> ation.
Next Frame View the next frame in
the animation.
5.6 Playing Animations • 227 228 • 5 Plots and Animations
You can also run the animation using the context menu or the Plot menu.
5.7 Customizing Animations • 229 230 • 5 Plots and Animations
The animate command offers a few options that are not available for static To export an image:
plots. Refer to the ?animate help page for information on these additional
1. Right-click the plot region (for Macintosh, Control-click).
options. By default, a two-dimensional animation consists of sixteen plots
(frames) and a three-dimensional animation consists of eight plots (frames). 2. Select Export and the file format.
To create a smoother animation, increase the number of frames using the
frames option. Alternatively:
Note: Computing more frames increases time and memory requirements. 1. Click the plot.
2. From the Plot menu, select Export, and then the file format.
>
Maple has various plot drivers. By setting the plotdevice, a file can be
> automatically created without returning the image to the document. For more
information, refer to the ?plotdevice help page.
From the Help menu, select Manuals, Dictionary, and more, On the Web,
and then Application Center.
• Insert hyperlinks to other Maple files, Web sites, or email addresses • Document Blocks
• Typesetting
• Insert images, tables, and symbols
• Using Tables for Layout
• Generate two- and three-dimensional plots and animations • Formatting Lists: Bullets, Numbers, Indent
• Sketch in the document • Bookmarks
• Copy, cut, and paste information • Inserting Images
231
6.2 Document Formatting • 233 234 • 6 Creating Mathematical Documents
Attributes Submenu: Setting Fonts, Character Size, and Attributes Attributes Submenu: Spacing, Indent, Alignment, Bullets, Line
Break, and Page Break
You can change various character attributes such as font, character size,
style, and color in one dialog. You can change various paragraph attributes in one dialog.
To modify text: • From the Format menu, select Paragraph, and then Attributes. The
Paragraph Style dialog opens. See Figure 6.3.
1. In the document, select text to modify.
• When changing spacing, you must indicate units (inches, centimeters,
2. From the Format menu, select Character, and then Attributes. The or points) in the Units drop-down list.
Character Style dialog opens. See Figure 6.2.
2. From the Edit menu, select Copy. 3. Enter the section heading.
3. Place the cursor at the insertion point. 4. Press the Enter key.
4. From the Edit menu, select Paste. 5. Enter the body of the section.
If you paste into an input region, Maple interprets all the pasted content as Using the Indent and Outdent Toolbar Icons
input. If you paste into a text region, Maple interprets all the pasted content
as text. Note, however, that 2-D Math retains its format in both input and You can shift sections to create or remove subsections.
text regions. Enclose the selection in a subsection
When you copy and paste to another application, in general, Maple retains
the original structure.
Outdent the selection
Sections
You can organize your document into sections.
Display Hidden Formatting Attributes
You can display icons that indicate the presence of hidden formatting attrib-
utes in the document, such as document block boundaries, execution groups
marked for autoexecute, and bookmarks.
• From the View menu, select Markers. A vertical bar is displayed along
the left pane of the document. Icons for hidden elements are displayed
Using the Insert Menu to Add Sections in the vertical bar next to the associated content in the document.
1. Place the cursor in the paragraph or execution group above the location Indentation and the Tab Key
at which to insert a new section.
The Tab icon allows you to set the Tab key to move between placeholders
• If the cursor is inside a section, Maple inserts the new section after the or to indent.
current section. Tab icon off. Allows you to move between placeholders using the Tab key.
• If the cursor is in an execution group, Maple inserts the new section after As an illustration, click the exponent button in the Expression palette. The
expression is inserted with the first placeholder highlighted. To move to
the execution group.
the next placeholder, use the Tab key.
2. From the Insert menu, select Section. An arrow marks the start of the
section.
6.2 Document Formatting • 239 240 • 6 Creating Mathematical Documents
The Tab icon is disabled when using 2-D Math (Math mode), and as such, • New styles that you have created through the Style Management (Figure
the Tab key allows you to move between placeholders. 6.4) and Character Style (Figure 6.5) dialogs.
Tab icon on. Allows you to indent in the document using the Tab key. To apply a character style to text in your document:
1. From the Format menu, select Styles. The Style Management dialog
opens. See Figure 6.4.
2. Click Create Character Style. The Character Style dialog opens. See
Figure 6.5.
Figure 6.4: Style Management Dialog
3. In the Style group box, enter a style name in the blank text field.
Applying Character Styles 4. Select the properties for the new character style, such as Font, Size, At-
By using the drop-down list in the document context bar, you can apply: tributes, and Color. In the Attributes group box, the Superscript and
Subscript check boxes are mutually exclusive. When you select one of the
• Existing Maple character styles.
6.2 Document Formatting • 241 242 • 6 Creating Mathematical Documents
two check boxes, the other is disabled. You must clear one before selecting 4. Select the properties to modify, such as Font, Size, Attributes, and Color.
the other. In the Attributes group box, the Superscript and Subscript check boxes
are mutually exclusive. When you select one of the two check boxes, the
Note: A preview of the style is displayed in the Example group box at the other is disabled. You must clear one before selecting the other.
bottom of the Character Style dialog.
A preview of the style is displayed in the Example group box at the bottom
5. To create the style, click OK or to abandon creation, click Cancel. of the Character Style dialog.
2. In the styles drop-down list in the context bar of your document, select
an appropriate paragraph style. All Maple paragraph styles are preceded by
the letter P. The selected text now reflects the attributes of the paragraph
Figure 6.5: Character Style Dialog style you have chosen.
1. From the Format menu, select Styles. The Style Management dialog
opens. See Figure 6.4.
1. From the Format menu, select Styles. The Style Management dialog
opens. See Figure 6.4.
2. Click Create Paragraph Style. The Paragraph Style dialog opens. See
Figure 6.6.
3. In the Style group box, enter the new paragraph style name in the blank
text field.
4. In the Units drop-down list, select the units used to determine spacing
and indentation. Select from inches (in), centimeters (cm), or points (pt).
5. Select the properties to use for this paragraph style, such as Spacing, In-
dent, Justification, Bullet Style, Linebreak, and Page Break Before.
6. To add a font style, click Font. The Character Style dialog opens. For
detailed instructions, see Creating Character Styles (page 240). Figure 6.6: Paragraph Style Dialog
7. To create the style, click OK, or to abandon creation, click Cancel.
Modifying Paragraph Styles
To modify a paragraph style:
1. From the Format menu, select Styles. The Style Management dialog
opens. See Figure 6.4.
3. Select the properties you want to modify, such as Spacing, Indent, Justi-
fication, and Bullet, Linebreak, and Units.
3. Select all the styles that are part of your document style set. For example,
if you modified the Author paragraph style to justify left versus the default
style of centered, ensure that you have selected the Author check box in the
Choose Styles dialog.
2. In the Style Set Operations group box, click New Style Set. The Choose Reverting to a Style Set
Styles dialog opens. See Figure 6.8.
At any point, you can revert your document style set to the Default Maple
Style Set or to a User-defined Style Set.
6.2 Document Formatting • 247 248 • 6 Creating Mathematical Documents
3. In the Style Set Operations group box, click Revert to StyleSet. 2. Execute the area, creating output that can be referenced elsewhere in the
document.
4. In the Choose Styles dialog, select all the styles to revert, that is, overwrite
with either the Default Maple Style Set or the User-defined Style Set. 3. Intersperse the area with content that is to remain visible, adding references
to the input and output in the appropriate locations.
5. Click OK.
Document Blocks
With document blocks, you can create documents that present text and math
in formats similar to those found in business and education documents.
By hiding Maple input such that only text and results are visible, you create
a document with better presentation flow. Before using document blocks, it
is recommended that you display Markers. A vertical bar is displayed along 4. Select the entire area (text and math content) to format.
the left pane of the document. Icons representing document blocks are dis-
played in this vertical bar next to associated content. 5. From the Format menu, select Create Document Block.
To activate Markers:
6. Select the entire area. From the View menu, select Inline Document
Output.
6.2 Document Formatting • 249 250 • 6 Creating Mathematical Documents
Before
The block displays text and output only. You can select areas to display input
only.
7. Select the output region you want to display as input. From the View
menu, select Toggle Input/Output Display. The selected region displays
input.
In the following figures, note how the expression is entered as part of the Expand an Execution Group within a Document Block
text and then evaluated with the context menu option Evaluate and Display
Inline. An execution group is a grouping of Maple input with its corresponding
Maple output. It is distinguished by a large square bracket at the left called
a group boundary.
6.2 Document Formatting • 251 252 • 6 Creating Mathematical Documents
As document blocks can contain many execution groups, you can select to Typesetting
expand an execution group within a document block.
You can control typesetting and 2-D Math equation parsing options in the
1. Place the cursor in the document block region. Standard Worksheet interface. Extended typesetting uses a customizable set
2. From the View menu, select Expand Execution Group. of rules for displaying expressions.
3. To hide the group, select View>Collapse Execution Group. The rule-based typesetting functionality is available when Typesettinglevel
is set to Extended (Tools>Options>Display tab). This parsing functionality
Switch between Input and Output applies to 2-D Math editing (Math mode) only.
Input is displayed in one instance, or only output is displayed. To specify rules, use the Typesetting Rule Assistant.
Inline Document • From the View menu, select Typesetting Rules. The Typesetting Rule
Assistant dialog opens.
Document blocks can display content inline, that is, text, input, and output
in one line as presented in business and education documents. For more information, see the ?Typesetting, ?TypesettingRuleAssist, and
?OptionsDialog help pages.
To display content inline:
1. Place the cursor in the document block. Using Tables for Layout
2. From the View menu, select Inline Document Output. Tables allow you to organize content in a document.
Creating a Table
To create a table:
1. From the Insert menu, select Table.
2. Specify the number of rows and columns in the table creation dialog.
3. Click OK.
The default properties for the table include visible borders and auto-adjust-
ment to 100% of the document width. These options, as well as the table
6.2 Document Formatting • 253 254 • 6 Creating Mathematical Documents
dimensions, can be modified after table creation. The following is an example • Column insertion can be to the left or right of the document position
table using the default settings. marker or selection.
• Row insertion can be above or below the marker or selection.
Any content that can be placed into a document can also be placed into a With deleting operations using the Delete key, the Delete Table Contents
table cell, including other sections and tables. Table cells can contain a mix dialog opens allowing you to specify the desired behavior. For example, you
of: can delete the selected rows, or delete the contents of the selected cells.
Navigating Table Cells You can merge cells across row or column borders. See Figure 6.10. The
resultant cell must be rectangular. The contents of the individual cells in the
Use the Tab key to move to the next cell. merge operation are concatenated in execution order. See Figure 6.11.
Tab icon off. Allows you to move between cells using the Tab key.
Tab icon on. Allows you to indent in the table using the Tab key.
Alternatively, the size of the table can be controlled from the Table Proper- For column alignment, the current selection is expanded to encompass all
ties dialog. Select Tables>Properties. Two sizing modes are supported. rows in the selected columns. The alignment choice applies to all cells
within the expanded selection. If the document does not contain a selection,
(1) Fixed percentage of page width. Using this option, the table width ad- the cursor position is used to identify the column.
justs whenever the width of the document changes. This option is useful for
ensuring that the entire content of the table fits in the screen or printed page. Similarly, the selection is expanded to include all columns in the selected
rows for vertical alignment options. The following table illustrates the ver-
(2) Scale with zoom factor. This option is used to preserve the size and tical alignment options. The baseline option is useful for aligning equations
layout of the table regardless of the size of the document window or the across multiple cells within a row of a table.
zoom factor. If the table exceeds the width of the document window, the
horizontal scroll bar can be used to view the rightmost columns. Note: Using
this option, tables may be incomplete when printed.
Table Borders
The style of exterior and interior borders is set using the Table Properties
dialog. Select Table>Properties.
• You can set all, none, or only some of the borders to be visible in a table.
• You can control the visibility of interior borders by using the Group
submenu of the Table menu.
• Grouping rows or columns suppresses interior borders within the table
selection.
• Grouping rows and columns requires that the interior border style is set Controlling the Visibility of Cell Content
by row and column group.
The Table Properties dialog includes two options to control the visibility
• Hidden borders are visible when the mouse hovers over a table. Note of cell content. These options allow control over the visibility of Maple input
that you can hide the visibility of lines on mouse pointer roll over by and execution group boundaries. Thus, Maple input can be hidden in a table
using the View>Show/Hide Contents dialog, and clearing the Hidden even if input is set to visible for the document in the View>Show/Hide
Table Borders check box. Contents dialog.
Alignment Options
The table alignment tools control the horizontal alignment of columns and
vertical alignment of rows.
6.2 Document Formatting • 257 258 • 6 Creating Mathematical Documents
Examples
> > Table of Values
> x:=x+1; > x:=x+1; This example illustrates how to set the visibility options for cell contents to
display a table of values.
> y := t -> 1/2*t^2:
> >
t [s] 0 1 2 3 4 5 6
Column-wise execution order
y(t) [m] > y(0); > y(1); > y(2); > y(3); > y(4); > y(5); > y(6);
> x:=1; > x:=x+1;
> >
Table settings:
> x:=x+1; > x:=x+1;
In the Properties dialog (Table>Properties menu):
t [s] 0 1 2 3 4 5 6 6. (Optional) Change Table Size Mode size option to Scale with zoom
y(t) [m]
factor.
Table settings:
3. Change row Alignment to Center. Formatting Lists: Bullets, Numbers, and Indent
Table of Mathematical Expressions Bullet, numbered, and indented lists provide an easy way to organize inform-
ation in your document.
This example illustrates using the baseline alignment option to align equations
across columns in a table. Formatting Lists Using the Context Bar
f(x)
To arrange content in a bullet list using the context bar drop-down list:
2. In the character and paragraph style drop-down list, select P Bullet Item.
The selected text is displayed as a (dot) bullet list.
Bookmarks
Use a bookmark to designate a location in an active document. This bookmark
can then be accessed from other regions in your document or by using hyper-
links in other documents.
2. In the character and paragraph style drop-down list, select P List Item.
Inserting, Renaming, and Deleting a Bookmark
The selected text is displayed as an indented list.
To insert a bookmark:
Formatting Lists Using the Paragraph Style Dialog
1. Place the cursor at the location at which to place the bookmark.
With the Paragraph Style dialog, you can select various list styles: dot,
dash, indent, numbers, lowercase letters, uppercase letters, lowercase Roman 2. From the Format menu, select Bookmarks. The Bookmark dialog opens,
numerals, and uppercase Roman numerals. listing existing bookmarks in the document.
To arrange content in a list using the Paragraph Style dialog: 3. Click New. The Create Bookmark dialog opens. Enter a bookmark name
and click Create.
1. Select the text to be arranged.
4. The new bookmark appears in the Bookmark dialog list. Click OK.
2. From the Format menu, select Paragraph, and then Attributes. The
Paragraph Style dialog opens. Note: You can also rename and delete bookmarks using the Bookmark
dialog.
3. In the Bullet and Numbering drop-down list, select one of the styles.
4. If you have selected one of the numbered styles (number, letters, Roman
numerals), set an initial list value.
6.2 Document Formatting • 265 266 • 6 Creating Mathematical Documents
Go to a Bookmark If the source file is altered, the embedded image does not change because
the original object is pasted into the document.
You can automatically move the cursor to the location of the bookmark in
the active document. To resize an inserted image:
1. From the Edit menu, select Go To Bookmark. The Go To Bookmark 1. Click the image. Resizing anchors appear at the sides and corners of the
dialog opens with the current bookmarks listed. image.
2. Select the bookmark and click OK. The cursor moves to the bookmark. 2. Move the mouse over the resize anchor. Resizing arrows appear.
Inserting Images 3. Click and drag the image to the desired size.
Images help illustrate ideas and enhance presentations. You can insert images ImageTools Package
in your document at a cursor location or in a table. You can manipulate image data using the ImageTools package. This package
You can insert images in these file formats is a collection of utilities for reading and writing common image file formats,
into your document. and for performing basic image processing operations within Maple.
• Graphics Interchange Format - gif
• Joint Photographic Experts Group - Within Maple, images are represented as dense, rectangular Arrays of 64-
jpe, jpeg, jpg bit hardware floating-point numbers. Grayscale images are 2-D, whereas
• Portable Network Graphics - png color images are 3-D (the third dimension representing the color channels).
• Bitmap Graphics - bmp In addition to the commands in the ImageTools package, many ordinary
• Tagged Image File Format - tif, tiff, Array and Matrix operations are useful for image processing.
jfx
• Portable aNyMap - pnm For details about this feature, refer to the ?ImageTools help page.
• Kodak FlashPix - fpx
Show or Hide Worksheet Content
You can hide document elements of a specific type so that they are not visible.
To insert an image into the document at the cursor location: This does not delete them, but hides them from view. Hidden elements are
not printed or exported, but they are copied and pasted.
1. From the Insert menu, select Image. The Load Image dialog opens.
In a document, use the Show Contents dialog to hide all spreadsheets, input,
2. Specify a path or folder name. output, or graphics, plus section boundaries, execution group boundaries,
3. Select a filename. and hidden table borders on mouse pointer roll over. The dialog is accessed
from the View>Show/Hide Contents menu.
4. Click Open. The image is displayed in the document.
6.2 Document Formatting • 267 268 • 6 Creating Mathematical Documents
• To hide an inserted plot, clear the Graphics check box in the Show • Button, Toggle Button
Contents dialog. • Combo Box, Check Box, List Box
Inserted images and the Canvas are not considered output. As such, they • Text Area, Label
are not hidden if you clear the Output check box.
• Slider, Plot, Function
• To hide an inserted image or canvas, clear the Graphics check box in
the Show Contents dialog.
6.3 Embedded Components • 269 270 • 6 Creating Mathematical Documents
2. In the Components palette, click the Slider item. A slider is inserted into
the document.
Figure 6.13: Components Palette
3. In the Components palette, click the Label item. A label is inserted next
to the slider.
Editing Component Properties: General Process
4. Right-click (Control-click, for Macintosh) the label component. Select
To edit properties of components embedded in the document: Component Properties. The Label Properties dialog appears.
1. Right-click (Control-click, for Macintosh) the component to display the 5. Name the component SliderLabel and click Ok.
context menu.
6. Right-click (Control-click, for Macintosh) the slider component. Select
2. Select Component Properties. The related dialog opens. Component Properties. The Slider Properties dialog opens.
3. Enter values and contents in the fields as necessary. 7. Name the component Slider1.
4. For actions, such as Action When Value Changes in the Slider component 8. Enter the lowest position as 0 and the highest as 100.
dialog, click Edit. A blank dialog opens allowing you to enter Maple code
that is executed when the event occurs. For details, refer to the ?Document- 9. Enter minor tick marks at 10 and major tick marks at 20.
Tools help page. 10. To define an action when the value of the slider changes, click Edit. The
Action When Value Changes dialog opens.
Removing Graphical Interface Components
11. Enter the following calling sequence and click OK to close all dialogs.
You can remove an embedded component by:
DocumentTools[SetProperty ]('SliderLabel',caption,
• Using the Delete key
DocumentTools[GetProperty] ('Slider1', 'value' ) );
• Using the Backspace key
The value from the slider as you move the arrow indicator populates the
• Placing the cursor at the component and selecting from the document
Label caption field.
menu, Edit>Delete Element
6.4 Creating Graded Assignments • 271 272 • 6 Creating Mathematical Documents
For details on these commands, refer to the ?DocumentTools/SetProperty Viewing Questions in Maple
and the ?DocumentTools/GetProperty help pages.
To view and test your questions in Maple:
Printing and Exporting a Document with Embed-
• From the View menu, select Assignment. This view displays all of the
ded Components questions in your assignment with access to hints, plotting, and grading.
Printing: When printing a document, embedded components are rendered After answering your questions, you can test the grading function by clicking
as they appear on screen. the Grade button. A Maplet dialog is displayed indicating if the question
was answered correctly. If hints were provided in the question, these are also
Exporting: Exporting a document with embedded components to other
displayed.
formats produces the following results.
• HTML format - components are exported as .gif files. Saving Test Content
• RTF format - components are rendered as bitmap images in the .rtf When you save a document with test content, the authoring and assignment
document. modes determine what the user sees when opening your document.
• LaTeX - components are exported as .eps files.
• If you save the document in authoring mode (task template contents
visible), the user sees this content when opening the document.
6.4 Creating Graded Assignments • If you save the document in assignment mode, the users sees only the
You can use Maple to create graded assignments. Question types include assignment layout.
multiple choice, essay, true-or-false, fill-in-the-blanks, and Maple-graded. In both cases the View>Assignment menu is accessible. As such, users
Note: This feature can be used to create questions for Maple T.A.—an online (students) can switch between the original document contents and the dis-
automated testing and assessment system. For details about Maple T.A., see played assignment.
Input, Output, and Interacting with Other Products (page 363).
6.5 Auto-Execute
Creating a Question
An execution group is a grouping of Maple input with its corresponding
To create a question: Maple output. It is distinguished by a large square bracket, called a group
boundary, at the left. An execution group may also contain any or all of the
1. Open the Task browser (Tools>Tasks>Browser).
following: a plot, a spreadsheet, and text.
2. From the Maple T.A. folder, select the appropriate question type.
3. Insert the question template into a document. Execution groups are the fundamental computation and documentation ele-
ments in the document. If you place the cursor in an input command and
4. Enter the question content as described in the template. press the Enter or Return key, Maple executes all of the input commands
5. Repeat steps 1 to 4 for each question to add to the document. in the current execution group.
6.5 Auto-Execute • 273 274 • 6 Creating Mathematical Documents
Repeating Auto-Execution
To execute all marked groups:
Figure 6.14: Canvas and Drawing Properties Palette
• From the Edit menu, select Execute, and then Repeat Autoexecution.
Insert a Canvas
Security Levels
To insert a canvas:
By default, Maple prompts the user before automatically executing the doc-
ument. 1. Place the cursor where the canvas is to be inserted.
To set security levels for the autoexecute feature, use the Security tab in the
Options dialog. For details, refer to the ?OptionsDialog help page. 2. From the Insert menu, select Canvas. A canvas with grid lines appears
in the document at the insertion point. The Drawing menu is available and
associated context bar icons are displayed.
6.6 Canvas • 275 276 • 6 Creating Mathematical Documents
The tools include the following: selection tool, Pencil (free style drawing), 2. For grid lines, select the appropriate grid check boxes (horizontal or ver-
eraser, text insert, straight line, square, rounded square, ellipse, diamond, tical) and adjust spacing as required using the slider.
alignment, launch drawing and canvas properties palettes.
3. For colors, click the Grid or Canvas color. The color wheel opens. Select
Drawing from various colors.
To remove gridlines:
For details about the drawing feature, see the Maple help system.
• Clear the Show horizontal grid or Show vertical grid check boxes, and
To draw with the pencil tool in the canvas:
click OK.
1. From the Drawing icons, select the pencil icon.
2. (Optional) Select a line thickness in the Drawing Properties palette. 6.7 Spell Checking
3. Click and drag your mouse in the canvas to draw lines. Release the mouse The Spellcheck utility examines all designated text regions of your document
to complete the drawing. for potential spelling mistakes, including regions that are in collapsed sec-
tions. It does not check input, output, text in execution groups, or math in
To adjust the color of drawing tools: text regions. See Figure 6.15.
1. Open the Drawing Properties palette. Note: The Spellcheck utility uses American spelling.
2. Click the color wheel. By default, the wheel is black. Move the slider to
view more colors.
3. Select a color on the color wheel. The color is displayed in the rectangle.
Canvas Style
You can alter the Canvas in the following ways:
How to Use the Spellcheck Utility Spellcheck Usage and the Document
1. From the Tools menu, select Spellcheck. Alternatively, press the F7. The When using the Spellcheck utility, you can fix spelling errors in the
Spellcheck dialog appears. It automatically begins checking the document Spellcheck dialog. You cannot change the text in the document while the
for potential spelling mistakes. Spellcheck utility is running.
2. If the Spellcheck utility finds a word that it does not recognize, that word The Spellcheck utility does not check grammar.
is displayed in the Not Found text box.
User Dictionary
You have six choices:
You can create and maintain a custom dictionary that works with the Maple
• To ignore the word, click Ignore.
Spellcheck utility.
• To ignore all instances of the word, click Ignore All.
Properties of the Custom Dictionary File
• To change the word, that is, accept one of the suggested spellings for the
word, to the one that is in the Change To text box, click Change. • It must be a text file, that is, have the file extension .txt. For example,
mydictionary.txt.
• To change all instances of the word, that is, accept the suggested spelling
to replace all instances of the word, click Change All. • It is a list of words, one word per line.
• To add the word to your dictionary, click Add. For details, see the fol- • It is case sensitive. This means that integer and Integer require individual
lowing User Dictionary section. entries in the dictionary file.
• To close the Spellcheck dialog, that is, quit the Spellcheck utility, click • It does not require manual maintenance. You build your dictionary file
Cancel. by using the Add functionality of the Spellcheck. However, you can
manually edit the file if an error is introduced.
3. When the Spellcheck is complete, a dialog containing the message
"spellchecking complete" appears. Click OK to close this dialog. To specify a custom dictionary to be used with the Maple Spellcheck
utility:
Selecting a Suggestion
1. Create a .txt file using your favorite text editor in a directory/folder of
To select one of the suggestions as the correct spelling, click the appropriate your choice.
word from the list in the Suggestions text box.
2. In Maple, open the Options dialog, Tools>Options, and select the Gen-
If none of the suggestions are correct, highlight the word in the Change To eral tab.
text box and enter the correct spelling. Click Change to accept this new
3. In the User Dictionary field, enter the path and name of the .txt file you
spelling.
created in step 1, or click Browse to select the location and filename.
6.8 Hyperlinks • 279 280 • 6 Creating Mathematical Documents
4. To ignore Maple words that are command and function names, select the
Use Maple Words in Spellchecker check box. A check mark indicates that
the Spellcheck ignores Maple words.
1. Click the Add button. If this is the first time you are adding a word, the
Select User Dictionary dialog opens. Figure 6.16: Hyperlink Properties Dialog
2. Enter or select the custom dictionary (.txt file) you created. See User
Dictionary (page 278). Inserting a Hyperlink in a Document
3. Click Select. The word is automatically added to your custom dictionary To insert a hyperlink in the document:
file.
1. Highlight the text that you want to make a hyperlink.
Note: Specifications in the Options dialog determine whether this word is
recognized in your next Maple session. If you set your custom dictionary 2. From the Format menu, select Hyperlink.
use to Apply to Session, then this word will not be recognized in a new 3. In the Hyperlink Properties dialog box, enter the text of the hyperlink
Maple session. If you set your custom dictionary use to Apply Globally, name in the Link Text edit field. See Figure 6.16.
then this new word will be recognized. See User Dictionary (page 278).
4. Optionally, use an image as the link. Select the Include an Image check
6.8 Hyperlinks box and Browse for the correct file. In .mw files, the image appears as the
link, while in .mws files, the Link Text you entered appears as the link. You
Use a hyperlink in your document to access any of the following. can resize the image as necessary. Click the image. Resizing anchors appear
at the sides and corners of the image.
• Email
• Dictionary Topic 5. Specify the hyperlink Type and Target as described in the appropriate
following section.
• Help Topic
• Maplet Application Linking to an Email Address
2. In the Target field, enter the email address. If the Maplet application exists, clicking the link launches the Maplet applic-
ation. If the Maplet application contains syntax errors, then error messages
3. Click OK. are displayed in a pop-up window.
Note: For information about email hyperlinks in the Classic Worksheet in- When linking to a custom Maplet application, the path is absolute. When
terface, see Worksheet Compatibility (page 283). sharing documents that contain links to Maplet applications, ensure that
target Maplet applications are in the same directory.
Linking to a Dictionary Topic
3. Click OK.
To link to a Dictionary topic:
Note: To link to a Maplet application available on a MapleNet Web page,
1. In the Type drop-down list, select Dictionary Topic.
use the URL hyperlink type to link to the Web page. For information on
2. In the Target field, enter a topic name. Dictionary topics begin with the MapleNet, see Input, Output, and Interacting with Other Products (page 363).
prefix Definition/, for example, Definition/dimension.
Linking to a Web Page
3. Click OK.
To link to a Web page:
Linking to a Help Page
1. In the Type drop-down list, select URL.
To link to a help page:
2. In the Target field, enter the URL, for example, www.maplesoft.com.
1. In the Type drop-down list, select Help Topic.
3. Click OK.
2. In the Target field, enter the topic of the help page.
Linking to a Document
(Optional) In the Bookmark drop-down list, enter or select a bookmark.
To link to a document:
3. Click OK.
1. In the Type drop-down list, select Worksheet.
Linking to a Maplet Application
2. In the Target field, enter the path and filename of the document or click
To link to a Maplet application: Browse to locate the file. (Optional) In the Bookmark drop-down list, enter
or select a bookmark.
1. In the Type drop-down list, select Maplet.
Note: When linking to a custom document, the path is absolute. When
2. In the Target field, enter the local path to a file with the .maplet extension. sharing documents that contain hyperlinks, ensure that target documents are
Optionally, click Browse to locate the file. in the same directory.
3. Click OK.
6.9 Worksheet Compatibility • 283 284 • 6 Creating Mathematical Documents
tures
Constants, data structures, mathematical expressions, and other objects are Using negative integers, you can select an expression from the end of a se-
Maple expressions. For more information on expressions, refer to the Maple quence.
Help System.
285
7.2 Creating and Using Data Structures • 287 288 • 7 Maple Expressions
> >
You can select multiple expressions by specifying a range using the range Note: The union operator is available in 1-D Math input as union. For more
operator (..). information, refer to the ?union help page.
> For more information on sets, refer to the ?set help page.
Lists
A list is an expression sequence enclosed in brackets ([ ]).
Note: This syntax is valid for most data structures.
>
Sets
A set is an expression sequence enclosed in curly braces ({ }).
Note: Lists preserve both the order and repetition of elements.
>
Accessing Entries
A Maple set has the basic properties of a mathematical set. To refer to an element in a list:
• Each element is unique. Repeated elements are stored only once. • Use square brackets.
• The order of elements is not stored. For example:
For example:
>
>
For example, you can solve a list (or set) of equations using a context menu
or the solve command.
7.2 Creating and Using Data Structures • 289 290 • 7 Maple Expressions
> >
For more information, see Solving Equations and Inequations (page 78). >
For more information on sets and lists, refer to the ?set help page.
Arrays The Array constructor supports other syntaxes. It also supports many options.
For more information on the Array constructor and the Array data structure,
Conceptually, the Array data structure is a generalized list. Each element refer to the ?Array help page.
has an index that you can use to access it.
Large Arrays
The two important differences are:
Only one- and two-dimensional Arrays (with at most 10 indices in each di-
• The indices can be any integers. mension) display in the document. Larger Arrays display as a placeholder.
• The dimension can be greater than one.
>
Creating and Using Arrays
To define an Array, use the Array constructor.
Tables
Tables are conceptually an extension of the Array data structure, but the
table data structure is implemented using hash tables. Tables can be indexed
by any values, not only integers.
7.2 Creating and Using Data Structures • 291 292 • 7 Maple Expressions
>
>
You can also assign anything, for example, a list, to each element.
>
For more information on these data structures, including how to access entries
>
and perform linear algebra computations, see Linear Algebra (page 133).
Functional Operators
For more information on tables, refer to the ?table help page.
A functional operator is a mapping . The value of is the
Matrices and Vectors result of evaluating .
Matrices and Vectors are specialized data structures used in linear algebra Using functional operators, you can define mathematical functions.
and vector calculus computations.
Defining a Function
> To define a function of one or two variables:
1. In the Expression palette, click one of the function definition items. See
For information on defining Matrices and Vectors, see Creating Matrices Figure 7.1. Maple inserts the function definition.
and Vectors (page 133).
2. Replace the placeholder f with the function name. Press Tab. Note: If
> pressing the Tab key inserts a tab, click the Tab icon in the toolbar.
4. Replace the final placeholder, y, with the expression that defines the
function value. Press Enter.
7.2 Creating and Using Data Structures • 293 294 • 7 Maple Expressions
>
Distinction between Functional Operators and Other Expressions For example, a multivariate function:
>
A vector function:
To evaluate the functional operator f at a value of x:
>
• Specify the value as an argument to f.
7.2 Creating and Using Data Structures • 295 296 • 7 Maple Expressions
>
Using Operators
To perform an operation on a functional operator, specify arguments to the
operator. For example, for the operator f, specify f(x), which Maple evaluates
as an expression. See the following examples.
>
For information on plotting, see Plots and Animations (page 187).
> Integration Integrate a function using the int command.
>
>
Low-Level Operations
Using Strings
Expression Types
The StringTools package is an advanced set of tools for manipulating and
using strings. A Maple type is a broad class of expressions that share common properties.
Maple contains over 200 types, including:
>
• `+`
> • boolean
• constant
• integer
> • Matrix
• trig
• truefalse
>
For more information and a complete list of Maple types, refer to the ?type
help page.
The type commands return true if the expression satisfies the type check.
Otherwise, they return false.
7.3 Working with Maple Expressions • 299 300 • 7 Maple Expressions
> >
The has command searches the structure of the expression for an exactly
>
matching subexpression.
For example:
>
>
(7.1) If the expression is not in normal form, Maple normalizes the expression
before selecting the numerator or denominator. (For more information on
> normal form, refer to the ?normal help page.)
>
>
>
For the following equation, the left endpoint of the range is the left-hand
side of the right-hand side of the equation.
> >
(7.2)
The expression can be any algebraic expression. For information on the be-
havior for non-rational expressions, refer to the ?numer help page.
7.3 Working with Maple Expressions • 303 304 • 7 Maple Expressions
Components of an Expression To return all subexpressions of a particular type, specify the type as the
second argument. For information on types, see Testing the Type of an Ex-
The components of an expression are called its operands. pression (page 299).
To count the number of operands in an expression:
>
• Use the nops command.
For example, construct a list of solutions to an equation.
To test whether an expressions has subexpressions of a specific type (without
> returning them), use the has command. For more information, see Testing
for a Subexpression (page 300).
Manipulating Expressions
Using the nops command, count the number of solutions. This section introduces the most commonly used manipulation commands.
For additional manipulation commands, see Iterative Commands (page 333).
>
Simplifying
To simplify an expression:
For more information on the nops command and operands, refer to the ?nops
help page. • Use the simplify command.
>
7.3 Working with Maple Expressions • 305 306 • 7 Maple Expressions
> For more information on polynomials, see Polynomial Algebra (page 124).
To factor an integer:
>
>
> Combining
To combine subexpressions in an expression:
The combine command applies transformations that combine terms in sums, Convert a measurement in radians to degrees:
products, and powers into a single term.
>
>
To convert measurements that use units, use the Unit Converter or the con-
vert/units command.
>
>
The combine command applies only transformations that are valid for all
possible values of names in the expression. For information on the Unit Converter and using units, see Units (page 96).
> Convert a list to a set:
>
To perform the operation under assumptions on the names, use the assuming
command. For more information about assumptions, see Assumptions on
Variables (page 116). Maple has extensive support for converting mathematical expressions to a
new function or function class.
>
>
Converting
Find an expression equivalent to the inverse hyperbolic cotangent function
To convert an expression: in terms of Legendre functions.
• Use the convert command. >
The convert command converts expressions to a new form, type (see Expres-
sion Types (page 298)), or in terms of a function. For a complete list of con-
versions, refer to the ?convert help page.
7.3 Working with Maple Expressions • 309 310 • 7 Maple Expressions
represents the Legendre function of the second kind. For more inform-
ation, refer to the ?LegendreQ help page.
For more information on converting to a class of functions, refer to the Sorting
?convert/to_special_function help page.
To sort the elements of an expression:
Normalizing
• Use the sort command.
To normalize an expression:
The sort command orders a list of values or terms of a polynomial.
• Use the normal command.
>
The normal command converts expressions into factored normal form.
>
>
>
You can also use the normal command for zero recognition.
>
For information on sorting polynomials, see Sorting Terms (page 126).
1. Right-click (Control-click, for Macintosh) the expression. Maple displays Substitutions performed by the eval function are syntactical, not the more
a context menu. powerful algebraic form of substitution.
2. From the context menu, select Evaluate at a Point. The Evaluate at a If the left-hand side of the substitution is a name, Maple performs the substi-
Point dialog is displayed. tution.
Maple inserts the eval command calling sequence that performs the substitu-
tion. This is the most common use of the eval command.
For example, substitute in the following polynomial. If the left-hand side of the substitution is not a name, Maple performs the
substitution only if the left-hand side of the substitution is an operand of the
> expression.
>
>
(7.3)
2. Specify the expression, variable, and value to be substituted. Maple did not perform the evaluation because is not an operand of
. For information on operands, refer to the ?op help page.
For example:
For algebraic substitution, use the algsubs command, or the simplify com-
> mand with side relations.
7.3 Working with Maple Expressions • 313 314 • 7 Maple Expressions
By default, Maple calculates the result to ten digits of accuracy, but you can
> specify any number of digits as an index, that is, in brackets ([ ]).
>
See also Numerically Computing a Limit (page 153) and Numeric Integra-
tion (page 163).
> >
> >
(7.5)
>
> >
>
> >
> >
Important: The evalb command does not perform arithmetic for inequalities To control the level of evaluation of an expression:
involving <, , >, or , and does not simplify expressions. Ensure that
• Use the eval command with an integer second argument.
you perform these operations before using the evalb command.
If passed a single argument, the eval command fully evaluates that expression.
> If you specify an integer second argument, Maple evaluates the expression
to that level.
7.3 Working with Maple Expressions • 317 318 • 7 Maple Expressions
> >
> Error, (in sum) summation variable previously assigned, second argument evaluates
to 4 = 1 .. 5
>
Important: It is recommended that you enclose keywords in unevaluation
quotes.
>
For example, if you enclose the keyword left in unevaluation quotes, Maple
uses the name, not its assigned value.
>
7.3 Working with Maple Expressions • 319 320 • 7 Maple Expressions
>
>
>
>
(7.6)
>
(7.7)
>
For information on equation labels and equation label references, see Equa-
tion Labels (page 59).
>
321
8.2 Flow Control • 323 324 • 8 Basic Programming
The simplest if statement has only one conditional expression. In an if statement with elif clauses, Maple evaluates the conditional expres-
sions in order until one returns true. Maple executes the corresponding
> if conditional_expression then statement sequence, and then exits the if statement. If no evaluation returns
statement_sequence true, Maple exits the if statement.
end if;
> x := 11:
If the conditional expression evaluates to true, the sequence of statements > if not type(x, integer) then
is executed. Otherwise, Maple immediately exits the if statement. printf("%a is not an integer.", x);
For example: elif x >= 10 then
printf("%a is an integer with more than one digit.", x);
> x := 1173: elif x >= 0 then
printf("%a is an integer with one digit.", x);
> if not isprime(x) then end if;
ifactor(x);
end if; 11 is an integer with more than one digit.
> if not(type(x, integer)) then • Until a counter variable value exceeds a limit (for/from loop)
printf("%a is not an integer.", x); • For each operand of an expression (for/in loop)
elif x >= 0 then
printf("%a is an integer with one digit.", x); • Until a boolean condition does not hold (while loop)
elif x >= 10 then
for/from Loop
printf("%a is an integer with more than one digit.", x);
end if; The for/from loop statement repeats a statement sequence until a counter
variable value exceeds a limit.
11 is an integer with one digit.
Syntax
elif and else Clauses
The for/from loop has the following syntax.
In an if statement with elif and else clauses, Maple evaluates the conditional
> for counter from initial by increment to final do
expressions in order until one returns true. Maple executes the corresponding
statement_sequence
statement sequence, and then exits the if statement. If no evaluation returns
end do;
true, Maple executes the statement sequence in the else clause.
> x := -12:
The behavior of the for/from loop is:
> if not type(x, integer) then 1. Assign the initial value to the name counter.
printf("%a is not an integer.", x);
elif x >= 10 then 2. Compare the value of counter to the value of final. If the counter value
printf("%a is an integer with more than one digit.", x); exceeds the final value, exit the loop. (This is the loop bound test.)
elif x >= 0 then
3. Execute the statement_sequence.
printf("%a is an integer with one digit.", x);
else 4. Increment the counter value by the value of increment.
printf("%a is a negative integer.", x);
end if; 5. Repeat steps 2 to 4, until Maple exits the loop.
The from, by, and to clauses are optional and can be in any order between
-12 is a negative integer.
the for clause and the do keyword.
For more information on the if statement, refer to the ?if help page.
Table 8.1 lists the default clause values.
Repetition (for Statement)
Using repetition statements, you can repeatedly execute a statement se-
quence. You can repeat the statements in three ways.
8.2 Flow Control • 327 328 • 8 Basic Programming
> n;
for/in Loop
When the value of the counter variable n is strictly greater than 5, Maple
The for/in loop statement repeats a statement sequence for each component
exits the loop.
(operand) of an expression, for example, the elements of a list.
> n;
Syntax
The for/in loop has the following syntax.
The previous loop is equivalent to the following for/from statement. > for variable in expression do
statement_sequence
end do;
8.2 Flow Control • 329 330 • 8 Basic Programming
1. Assign the first operand of expression to the name variable. > while conditional_expression do
statement_sequence
2. Execute the statement_sequence. end do;
3. Assign the next operand of expression to variable.
A while loops repeats until its boolean expression conditional_expression
4. Repeat steps 2 and 3 for each operand in expression. If there are no more evaluates to false or FAIL. For more information on boolean expressions,
operands, exit the loop. (This is the loop bound test.) see Conditional Execution (if Statement) (page 322).
Example Example
The following loop returns a floating-point approximation to the sin function The following loop computes the digits of 872, 349 in base 7 (in order of
at the angles (measured in degree) in the list L. increasing significance).
> L := [23.4, 87.2, 43.0, 99.7]: > x := 872349:
while Loop
The while loop repeats a statement sequence until a boolean expression does
not hold.
8.2 Flow Control • 331 332 • 8 Basic Programming
After testing the loop bound condition at the beginning of each iteration of
the for loop, Maple evaluates conditional_expression.
The general for/from loop has the following syntax. For more information on the for statement and looping, refer to the ?do help
page.
8.3 Iterative Commands • 333 334 • 8 Basic Programming
mul Compute numeric product Table 8.4: The add and mul Commands
select Return operands that satisfy a condition Calling Sequence Syntax Examples
remove Return operands that do not satisfy a condition add(expression, name = initial .. final); > add(exp(x), x = 2..4);
selectremove Return operands that satisfy a condition and separately return operands mul(expression, name = initial .. final);
that do not satisfy a condition
map Apply command to the operands of an expression > mul(2*x, x = 1 .. 10);
zip Apply binary command to the operands of two lists or vectors
Creating a Sequence add(expression, name in expression); > add(u, u in [Pi/4, Pi/2, Pi]);
mul(expression, name in expression);
The seq command creates a sequence of values by evaluating a specified
expression over a range of index values or the operands of an expression.
See Table 8.3.
> mul(u, u in [Pi/4, Pi/2, Pi]);
Table 8.3: The seq Command
Calling Sequence Syntax Examples
seq(expression, name = initial .. final); > seq(exp(x), x=-2..0);
The endpoints of the index range (initial and final) in the add and mul
calling sequence must evaluate to numeric constants. For information on
symbolic sums and products, refer to the ?sum and ?product help pages.
8.3 Iterative Commands • 335 336 • 8 Basic Programming
• The select command returns the operands for which the procedure or
command returns true. For information on optional arguments to the selection commands, refer to
• The remove command returns the operands for which the procedure or the ?select help page.
command returns false.
Mapping a Command over a Set or List
• The selectremove command returns two expressions of the same type
as the input expression. The map command applies a name, procedure, or command to each element
in a set or list. See Table 8.6.
- The first consists of the operands for which the procedure or command re-
turns true. Table 8.6: The map Command
- The second consists of the operands for which the procedure or command Calling Sequence Syntax Examples
returns false or FAIL.
map(name_proc_cmd, expression); > map(f, {a, b, c});
See Table 8.5.
By default, the length of the returned object is that of the shorter list or vector.
If you specify a value as the (optional) fourth argument, it is used as the
8.4 Procedures
value of the missing elements of the shorter list or vector. In this case, the A Maple procedure is a program consisting of Maple statements. Using
length of the return value is that of the longer list or vector. See Table 8.7. procedures, you can quickly execute the contained sequence of statements.
Table 8.7: The zip Command
Defining and Running Simple Procedures
Calling Sequence Syntax Examples
zip(proc_cmd, a, b);
To define a procedure, enclose a sequence of statements between proc(...)
> zip(f, [i, j], [k, l]);
and end proc statements. In general, you assign a procedure definition to a
zip(proc_cmd, a, b, fill);
name.
> zip(AiryAi, [1, 2], [0], 1); The following procedure returns the square root of 2.
> p := proc() sqrt(2); end proc;
You can define a procedure that accepts user input. In the parentheses of the
proc statement, specify the parameter names. For multiple parameters, sep-
arate the names with commas.
> geometric_mean := proc(x, y)
Displaying Procedure Definitions
sqrt(x*y); Unlike simple Maple objects, you cannot display the value of a procedure
end proc: by entering its name.
> geometric_mean;
When the user runs the procedure, the parameter names are replaced by the
argument values.
> geometric_mean(13, 17);
You must evaluate the name of the procedure using the print (or eval)
command.
> print(geometric_mean);
> geometric_mean(13.5, 17.1);
For more information on writing procedures, including options and local Displaying Maple Library Procedure Definitions
and global variables, refer to the ?procedure help page.
Maple procedure definitions are a valuable learning tool. To learn how to
program in Maple, it is recommended that you examine the procedures
Procedure Return Values available in the Maple library.
When you run a procedure, Maple returns only the last statement result value By default, the print command returns only the proc and end proc statements
computed. Maple does not return the output for each statement in the proced- and (if present) the description fields of a Maple procedure.
ure. It is irrelevant whether you use semicolons or colons as statement sep-
arators. > print(assign);
> p := proc(a, b)
a + b;
a - b:
end proc: To display a Maple library procedure definition, first set the value of the
interface verboseproc option to 2. Then re-execute the print calling se-
quence. See Figure 8.1.
8.4 Procedures • 341 342 • 8 Basic Programming
A key feature of modules is that they export variables. This means that the
variables are available outside the module in which they are created. Most
Maple packages are implemented as modules. The package commands are
exports of the module.
> Maplets[Display](MySimpleMaplet):
A Maplet is a graphical user interface that provides interactive access to the
Maple engine through buttons, text regions, slider bars, and other visual in-
terfaces. You can design custom Maplet applications to use and share with
colleagues or students, or you can take advantage of the built-in Maplets that
cover numerous academic and specialized topics. For information on some
of the built-in Maplets, see Assistants and Tutors (page 26), Teaching and
Learning with Maple (page 178), or Ordinary Differential Equations Figure 9.1: A Simple Maplet
(ODEs) (page 88). Other methods of interaction with Maple are described
in the Maple Getting Started Guide and throughout this book. For more information on creating Maplets, including an overview of the
point-and-click Maplet Builder Assistant, see Authoring Maplets (page 345).
9.1 In This Chapter
Section Topics 9.3 Using Maplets
Simple Maplet - Illustrating a simple Maplet • Define and Run a Simple Maplet Maplet applications are launched by executing Maplet code. Maplet code
Using Maplets - Methods for launching a Maplet • Maplet File can be saved in a Maplet (.maplet) file or Maple document (.mw).
• Maple Document
Maplet File
Authoring Maplets - Methods for authoring and • Maplet Builder
saving a Maplet • Maplets Package To launch a Maplet application saved as a Maplet file:
• Saving • In Windows, double-click the file from a Windows file browser.
• In UNIX and on Macintosh, use the command-line interface. At the
command-line, enter maple -q maplet_filename.
9.2 Simple Maplet
To view and edit the Maplet code contained within the .maplet file:
A Maplet application can be defined using the commands in the
Maplets[Elements] package and then launched using the Maplets[Display] 1. Start Maple.
command. The following commands define and run a very simple Maplet 2. From the File menu, select Open. Maple displays the Open dialog.
application that contains the text string "Hello World". 3. In the Files of Type drop-down list, select .maplet.
> with(Maplets[Elements]): 4. Navigate to the location of the .maplet file and select the file.
5. Click Open.
343
9.4 Authoring Maplets • 345 346 • 9 Maplets
Maple Document simple Maplets. The Maplets package offers more capabilities, control and
options when designing complicated Maplet applications.
To launch a Maplet application for which the Maple code is contained in a
Maple document, you need to execute the Maplet code. To display the Maplet Designing a Maplet application is similar to constructing a house. When
application, you must use the Maplets[Display] command. Note: The Maplet building a house, you first construct the skeletal structure (that is, foundation,
code may be quite large if the Maplet application is complex. In this case, floors, and walls) and then proceed to add the windows and doors. Construct-
execute the document to ensure user-defined procedures that are referenced ing a Maplet is no different. First define the rows and columns of the Maplet
in the Maplet application are also defined. application and then proceed to add the body elements (for example, buttons,
text fields, and plotter regions).
Typical procedure:
Maplet Builder
1. If present, evaluate user-defined procedures.
To start the Maplet Builder:
Myproc:=proc...
• From the Tools menu, select Assistants, and then Maplet Builder.
2. Load the Maplets[Elements] package.
with( Maplets[Elements] );
Maplet_name:=Maplet( Maplet_definition );
Maplets[Display]( Maplet_name );
The Maplet Builder is divided into four different panes. Design a Maplet Using the Maplet Builder
• The Palette pane displays palettes, which contain Maplet elements, or- In this example, shown in Figure 9.3, the Maplet user enters a function and
ganized by category. For a description of the elements, see the plots the result.
?MapletBuilder/Palette help page. The Body palette contains the most
popular elements.
• The Layout pane displays the visual elements of the Maplet.
• The Command pane displays the commands and corresponding actions
defined in the Maplet.
• The Properties pane displays the properties of an instance of a defined
element in the Maplet.
Button element
Label element
Plotter element
TextField element
Define the number of rows in the Maplet Add a plot region to row 1
1. In the Properties pane: 1. From the Body palette, drag the Plotter element to the first row in the
Layout pane.
a. In the drop-down list, select BoxColumn1.
1. In the Properties pane: 1. From the Body palette, drag the Label element to the left column in
the Layout pane.
a. In the drop-down list, select BoxRow2.
2. In the Properties pane:
b. Change the numcolumns field to 3.
a. In the drop-down list, select Label1.
list contains the defined elements to which you can send information, in this
case, Plotter1 and TextField1. The List group box, located below the
Expression group box, displays the defined elements to which you can
the Expression group box. (Note: Do not include a semicolon (;) at the end
of the plot command). You can also double-click TextField1 in the List
group box to insert this element in the command syntax. Figure 9.11: Evaluate Expression Dialog
Maplets Package
When designing a complicated Maplet, the Maplets package offers greater
control. The Maplets[Elements] subpackage contains the elements available
when designing a Maplet application. After you define the Maplet, use the
Maplets[Display] command to launch the Maplet.
9.4 Authoring Maplets • 357 358 • 9 Maplets
end use:
end proc:
to a file, allowing you to import the numbers into another program. To convert
10 Input, Output, and a list or a list of lists to a Matrix, use the Matrix constructor. For more in-
formation, refer to the ?Matrix help page.
Interacting with Other Products
10.1 In This Chapter
>
Section Topics
Writing to Files - Saving to Maple file • Saving Data to a File
formats
• Saving Expressions to a File
Reading from Files - Opening Maple files • Reading Data from a File >
• Reading Expressions from a File
If the data is a Vector or any object that can be converted to type Vector,
Exporting to Other Formats - Exporting • Exporting Documents
use the ExportVector command. To convert lists to Vectors, use the Vector
documents in file formats supported by • MapleNet
other software constructor. For more information, refer to the ?Vector help page.
• Maple T.A.
>
Connectivity - Using Maple with other • Translating Maple Code to Other Program-
programming languages and software ming Languages
• Accessing External Products from Maple
• Accessing Maple from External Products >
After using Maple to perform a computation, you can save the results to a
file for later processing with Maple or another program. >
Saving Data to a File You can extend these routines to write more complicated data, such as
complex numbers or symbolic expressions. For more information, refer to
If the result of a Maple calculation is a long list or a large array of numbers, the ?ExportMatrix and ?ExportVector help pages.
you can convert it to Matrix form and write the numbers to a file using the
ExportMatrix command. This command writes columns of numerical data For more information on matrices and vectors, see Linear Algebra (page 133).
363
10.2 Writing to Files • 365 366 • 10 Input, Output, and Interacting with Other Products
If you construct a complicated expression or procedure, you can save them >
for future use in Maple. If you save the expression or procedure in the Maple
internal format, Maple can retrieve it more efficiently than from a document.
Use the save command to write the expression to a .m file. For more inform-
ation on Maple internal file formats, refer to the ?file help page.
For more information on writing to files, refer to the ?save help page.
You can save these expressions to the file qbinom.m. • Using the Select Data Source dialog, select the data file to import.
>
Clear the memory using the restart command and retrieve the expressions
using the read command.
>
10.3 Reading from Files • 367 368 • 10 Input, Output, and Interacting with Other Products
When you read a file with the read command, Maple treats each line in the
file as a command. Maple executes the commands and displays the results
in your document but it does not, by default, insert the commands from the
file in your document.
For example, the file ks.tst contains the following Maple commands.
S:= n -> sum( binomial( n, beta ) * ( ( 2*beta )! / 2^beta - beta!*beta ),
beta=1..n );
S(19);
When you read the file, Maple displays the results but not the commands.
>
From the main window, you can preview the selected file, and specify the If you set the interface echo option to 2, Maple inserts the commands from
source format, source form, and behavior on close. You can also select a the file into your document.
different file to be imported. Additional help is available from the Help menu
of the Import Data window. >
The Import Data Assistant provides a graphical interface to the Import- >
Matrix command. For more information, including options not available in S:=n->sum(binomial(n,beta)*((2*beta)!/2^beta-beta!*beta),beta=1..n);
the assistant, refer to the ?ImportMatrix help page.
> S(19); command in the preamble of your .tex file. For more information, refer to
the ?exporttoLaTeX help page.
Maple Input
For more information, refer to the ?read and ?interface help pages.
You can export a Maple document as Maple input so that it can be loaded
using the Maple Command-line version.
10.4 Exporting to Other Formats
Important: When exporting a document as Maple input for use in Command-
Exporting Documents line Maple, your document must contain explicit semicolons in 1-D Math
input. If not, the exported .mpl file will not contain semicolons, and Com-
You can save your documents by selecting Save or Save As from the File mand-line Maple will generate errors.
menu. By selecting Export As from the File menu, you can also export a
document in the following formats: HTML, LaTeX, Maple input, Maplet Maplet Application
application, Maple text, plain text, and Rich Text Format. This allows you
The Export as Maplet facility saves a Maple document as a .maplet file,
to access your work outside Maple.
so that you can run it using the command-line interface or the
HTML MapletViewer. The MapletViewer is an executable program that can launch
saved Maplet applications. It displays and runs Maplet applications independ-
The .html file that Maple generates can be loaded into any HTML browser. ently of the Maple Worksheet interface.
Exported mathematical content can be displayed in one of the following
formats: GIF, MathML 2.0 Presentation, MathML 2.0 Content, or Maple Important: When exporting a document as a Maplet Application for use in
Viewer, and is saved in a separate folder. MathML is the Internet standard, Command-line Maple or the MapletViewer, your document must contain
sanctioned by the World Wide Web Consortium (W3C), for the communic- explicit semicolons. If not, the exported .maplet file will not contain semi-
ation of structured mathematical formulae between applications. For more colons, and Command-line Maple and the MapletViewer will generate errors.
information about MathML, refer to the ?MathML help page. For information on using the MapletViewer, see Using Maplets (page 344).
Maple documents that are exported to HTML translate into multiple docu-
Maple Text
ments when using frames. If the frames feature is not selected, Maple creates
only one page that contains the document contents. Maple text is marked text that retains the distinction between text, Maple
input, and Maple output. Thus, you can export a document as Maple text,
LaTeX send the text file by email, and the recipient can import the Maple text into
The .tex file generated by Maple is ready for processing by LaTeX. All dis- a Maple session and regenerate the computations in the original document.
tributions of Maple include the necessary style files. By default, the LaTeX
Plain Text
style files are set for printing the .tex file using the dvips printer driver. You
can change this behavior by specifying an option to the \usepackage LaTeX Export a Maple document as plain text so that you can open the text file in
another application.
10.4 Exporting to Other Formats • 371 372 • 10 Input, Output, and Interacting with Other Products
Rich Text Format (RTF) Content HTML LaTeX Maple Maplet Maple Plain Rich
Input Applica- Text Text Text
The .rtf file generated by Maple can be loaded into any word processor that tion Format
supports RTF. Hyperlink Links to help Plain text Plain Plain Plain text Plain text Plain text
pages be- text text
Summary of Translation come plain
text. Links to
Table 10.1: Summary of Content Translation When Exporting to Different documents
Formats are renamed
and conver-
Content HTML LaTeX Maple Maplet Maple Plain Rich ted to
Input Applica- Text Text Text HTML links
tion Format
Embedded GIF Not expor- Not ex- Not ex- Not ex- Not ex- Static im-
Text Maintained Maintained Preceded Preceded Preceded Main- Main- image or ted ported ported ported ported age
by # by # by # tained tained sketch out-
1-D Math Maintained Maintained Main- Main- Preceded Preceded Static im- put
tained tained by > by > age Spread- HTML table LaTeX Not ex- Not ex- Not ex- Not ex- RTF
2-D Math GIF or Math- 1-D Math 1-D 1-D 1-D 1-D Static im- sheet tables ported ported ported ported table
ML or LaTeX Math (if Math (if Math or Math or age Document Approxim- LaTeX en- Not ex- Not ex- Not ex- Not ex- RTF
2e possible) possible) charac- charac- style ated by vironments ported ported ported ported style
ter-based ter-based HTML style and sec-
typeset- typeset- attributes tions,
ting ting LaTeX 2e
Plot GIF Postscript Not ex- Not ex- Not ex- Not ex- Static im- macro calls
file ported ported ported ported age
Animation Animated Not expor- Not ex- Not ex- Not ex- Not ex- Not ex- MapleNet
GIF ted ported ported ported ported ported
Hidden Not exported Not expor- Not ex- Not ex- Not ex- Not ex- Not ex-
Overview of MapleNet
content ted ported ported ported ported ported
Using MapleNet, you can deploy Maple content on the Web. Powered by
Manually Not suppor- Not suppor- Not sup- Not sup- Not sup- Not sup- RTF the Maple computation engine, MapleNet allows you to embed dynamic
inserted ted ted ported ported ported ported page formulas, models, and diagrams as live content in Web pages. The MapleNet
page break break ob-
ject
software is not included with the Maple software. For more information on
MapleNet, visit http://www.maplesoft.com/maplenet.
10.4 Exporting to Other Formats • 373 374 • 10 Input, Output, and Interacting with Other Products
MapleNet Documents and Maplets Any document content outside Maple T.A. sections (indicated by green
section markers) is ignored by the export process.
After you upload your Maple documents to the MapleNet server, it can be
accessed by anyone in the world using a Web browser. Even if viewers do For more details, refer to the ?exporttoMapleTA help page.
not have a copy of Maple installed, they can view documents and Maplets,
manipulate 3-D plots, and execute code at the click of a button. 10.5 Connectivity
TM TM
Custom Java Applets and JavaServer Pages Technology
Translating Maple Code To Other Programming
MapleNet provides a programming interface to the Maple math engine so
Languages
commands can be executed from a JavaTM applet or using JavaServer
PagesTM technology. Embed MapleNet into your Web application, and let Code Generation
Maple handle the math and visualization.
The CodeGeneration package is a collection of commands and subpackages
that enable the translation of Maple code to other programming languages.
Maple T.A. Languages currently supported include C, Fortran77, Java, MATLAB®, and
Visual Basic®.
Overview of Maple T.A.
Maple T.A. is a Web-based automated testing system, based on the Maple For details on Code Generation, refer to the ?CodeGeneration help page.
engine. Instructors can use pre-written questions or create custom question
banks and then choose from these questions to form quizzes and assignments. Accessing External Products from Maple
Maple T.A. automatically grades responses as students complete assignments
External Calling
and tests. For more information, visit http://www.maplesoft.com/mapleta.
External calling allows you to use compiled C, Fortran77, or Java code in
Exporting Assignments to Maple T.A. Maple. Functions written in these languages can be linked and used as if
You can use Maple to create graded questions for use in Maple T.A. For in- they were Maple procedures. With external calling you can use pre-written
formation on creating and testing questions, see Creating Graded Assign- optimized algorithms without the need to translate them into Maple com-
ments (page 271). Using the Maple T.A. export feature, you can create and mands. Access to the NAG library routines and other numerical algorithms
test Maple T.A. content. is built into Maple using the external calling mechanism.
To export the document: External calling can also be applied to functions other than numerical al-
gorithms. Routines exist that accomplish a variety of non-mathematical tasks.
1. From the File menu, select Export As. You can use these routines in Maple to extend its functionality. For example,
2. In the Export As dialog, specify a filename and the Maple T.A. (.zip) you can link to controlled hardware via a serial port or interface with another
file type. The .zip file containing your questions and assignment can be up- program. The Database Integration Toolbox uses external calling to allow
loaded to Maple T.A. as a course module. you to query, create, and update databases in Maple. For more information,
visit http://www.maplesoft.com/products/toolboxes.
10.5 Connectivity • 375 376 • 10 Input, Output, and Interacting with Other Products
For more information on using external calling, refer to the ?ExternalCalling • Maple Function Wizard to step you through the creation of a Maple
help page. function call
Mathematica Translator To enable the Maple Excel Add-in in Excel 2000, Excel 2003, or Excel
XP:
The MmaTranslator package provides translation tools for converting
Mathematica® expressions, command operations, and notebooks to Maple. 1. From the Tools menu, choose Add-Ins.
The package can translate Mathematica input to Maple input and Mathematica 2. If the Maple Excel Add-in is not listed:
notebooks to Maple documents. The Mma subpackage contains commands
that provide translation for Mathematica commands when no equivalent • Click Browse and navigate to the directory in which Maple is installed.
Maple command exists. In most cases, the command achieves the translation • In the Excel directory, select the WMIMPLEX.xla file.
through minor manipulations of the input and output of similar Maple com-
mands. • Click OK.
Note: The MmaTranslator package does not convert Mathematica programs. 3. Select the Maple Excel Add-in check box.
4. Click OK.
There is a Maplet interface to the MmaTranslator package. For more in-
formation, refer to the ?MmaToMaple help page. More information is available in the Using Maple in Excel online help file
within Excel.
Matlab Package
To view this help file:
The Matlab package enables you to call selected MATLAB functions from
a Maple session, provided you have MATLAB installed on your system. 1. Enable the add-in.
2. From the View menu, select Toolbars, and then Maple.
For more information, refer to the ?Matlab help page.
3. On the Maple toolbar, click the Maple help icon .
Accessing Maple from External Products OpenMaple
Microsoft Excel Add-In OpenMaple is a suite of functions that allows you to access Maple algorithms
and data structures in your compiled C, Java, or Visual Basic programs.
Maple is available as an add-in to Microsoft Excel 2000, Excel 2003, and
(This is the reverse of external calling, which allows access to compiled C,
Excel XP for Windows, and provides the following features.
Fortran77, and Java code from Maple.)
• Access to Maple commands from Excel
To run your application, Maple must be installed. You can distribute your
• Ability to copy and paste between Maple and Excel application to any licensed Maple user. For additional terms and conditions
• Access to a subset of the Maple help pages on the use of OpenMaple, refer to extern/OpenMapleLicensing.txt in your
Maple installation.
10.5 Connectivity • 377 378 • 10 Input, Output, and Interacting with Other Products
379
Index • 381 382 • Index
Directional Derivative Tutor, 157 email delaying, 317 expressions, 10, 285
discrim command, 132 adding hyperlink to, 280 levels of, 316 adding, 334
display embedded components, 268 Maple expressions, 310 evaluating, 310
bookmark, 264 end do keywords, 326, 328, 330 of expression at a point, 310 manipulating, 304
hidden formatting attributes, 238 end if keywords, 322 output below, 8, 21, 31 multiplying, 334
distribution end proc keywords, 338 output inline, 8, 21, 31 versus functional operators, 293
probability, 171 environment variables updated computations, 9
divide command, 126 _EnvAllSolutions, 82 exact F
divisors, 73 Digits, 69 computation, 67 factor
document blocks, 31, 247 Order, 160 numbers, 66 integers, 71
Document mode, 1 equation labels, 59 quantities polynomials, 131
summary, 30 displaying, 59 converting to floating-point, 69 QR factorization, 149
double colon operator, 116 features, 62 example worksheets, 33 factor command, 131, 305
dsolve command, 92 numbering schemes, 61 execution group, 38 factored normal form, 309
references to, 59 auto-execute, 272 factorial command, 73
E versus names, 62 expand FAIL, 323, 330
e-notation, 68 with multiple outputs, 61 command, 306 false, 323, 330
eigenvalues, 147 equations document block, 250 Faraday constant, 105
eigenvectors, 147 solving, 78 execution group, 251 files
elementary charge, 105 for real solutions, 114 series, 159 image formats, 265
elements, 104 numerically, 83 exponents reading from, 366
definition, 106 symbolically, 80 entering, 5 writing to, 363
isotopes, 106 transcendental, 82 export, 342 fill option, 140
definition, 106 errors to HTML, 369 finite fields, 75
properties, 106 quantities with, 110 to LaTeX, 369 solving equations, 94
list, 106 Euclidean algorithm, 132 to Maple input, 370 finite rings, 75
properties eval command, 311, 340 to Maple T.A., 373 floating-point
list, 106 evalb command, 315 to Maple text, 370 computation, 68
uncertainty, 109 evalc command, 314 to Maplet application, 370 accuracy, 70
units, 108 evalf command, 69, 83, 108, 111, 313 to other formats, 369 hardware, 70
using, 105 with Int command, 163 to plain text, 370 significant digits, 69
value, 108 with Limit command, 153 to Rich Text Format, 371 numbers, 67
value and units, 109 evaln command, 317 worksheets, 369 rational approximation, 47
elif clauses, 324 evaluation Expression palette, 12 Flux command, 165
order, 324 boolean expressions, 315 expression sequences, 80, 286 font color, 233
else clause, 323 complex expressions, 314 creating, 333
Index • 385 386 • Index
foot-pound-second (FPS) system, 25, Gaussian integers, 77 worksheet content, 266 prompt, 37
97 GaussInt package, 77 highlight color, 233 separating, 39
for/from loops, 326 gcd command, 132 Hilbert Matrix, 149 setting default mode, 38
for/in loops, 328 gcdex command, 132 histogram, 175 insert
formal power series solutions, 92 Getting Started Guide, 32 hyperlinks bookmark, 264
format lists Global Optimization Toolbox, 166 in worksheet, 279 hyperlink, 280
using paragraph styles, 263 global variables, 339 images, 265
Format menu glossiness I row and columns in tables, 253
bookmarks, 264 of 3-D plots, 219 i section, 237
document blocks, 248 go to entering, 18, 77 sketch pad, 274
quick formatting, 233 bookmark, 265 if statement, 322 table, 252
frac command, 118 gradient, 182 ifactor command, 71, 73, 306 instructor resources, 178
fractions Gradient Tutor, 181 igcd command, 73 Int command, 163
approximating, 22 Graphing Calculator images int command, 162
entering, 5 Maplesoft, xiii adding hyperlink to, 280 integers
frequency plot, 175 greatest common divisor, 73, 132 file format, 265 commands, 73
Frobenius form inserting, 265 computations, 71
matrix, 148 H imaginary unit context menu, 46
from clause, 326 has command, 300 entering, 18, 77 factoring, 71
excluding, 327 hastype command, 299 implies operator, 323 Gaussian, 77
fsolve command, 83 HazardRate command, 174 Import Data Assistant, 366 modulo m, 75
full evaluation, 316, 319 help indent solving equations, 93
Function Composition Tutor, 27 dictionary, 33 format, 236 solving modular equations, 94
FunctionAdvisor command, 41, 121 examples, 33 list, 262 integration, 12, 18, 20, 44, 161
functional operators, 14, 292 pages, 33 indeterminates, 303 definite, 162
differentiating, 156 quick, 32 indets command, 303 functional operators, 296
plotting, 295 quick reference card, 32 indices, 40, 142 indefinite, 161
versus expressions, 293 task templates, 33 inequations iterated, 164
functions help page solving, 78 line, 164, 184
converting between, 308 adding hyperlink to, 281 for real solutions, 114 numeric, 163
defining, 14 Hermitian transpose symbolically, 80 surface, 164
defining as functional operators, matrix and vector, 146 infinite loops, 332 with units, 102
292 Hessenberg form, 149 infolevel command, 93 Interactive Plot Builder Assistant,
hexadecimal numbers, 74 input 28, 49
G hidden formatting attributes, 238 1-D Math, 38 creating animations, 223
Gaussian elimination, 149 hide 2-D Math, 37 creating plots, 189
Index • 387 388 • Index
customizing animations, 228 multidimensional, 152 launching, 346 Hermitian transpose, 146
customizing plots, 215 line break, 236 Maplet authoring, 346 image, 139
interface command line integrals, 184 Maplets large, 137
rtablesize option, 139 linear algebra, 133 adding hyperlink to, 281 multiplication, 144
verboseproc option, 340 computations, 143 authoring, 345 operations, 146
international system (SI), 97 efficiency, 139, 150 Maplet Builder, 346 random, 140
InterquartileRange command, 173 LinearAlgebra package, 148 Maplets package, 356 scalar multiplication, 145
interval arithmetic, 110 teaching, 150, 179 launching selecting submatrices, 143
iquo command, 73 linear systems Maple worksheet, 345 shape, 139, 141
iroot command, 73 solving, 94, 149 Maplet file type, 344 transpose, 146
is command, 117 LinearAlgebra package, 146 Maplets package type, 139
isprime command, 73 commands, 148 Display command, 356 Matrix
isqrt command, 73 numeric computations, 150 Elements subpackage, 356 Browser, 136–137, 290
italic format, 233 LinearSolve command, 94 Maplet authoring, 356 constructor, 141
lists, 142, 288 saving data structure, 133
J formatting, 262 Maple worksheet, 362 palette, 12, 94, 133, 139
j returning solutions as, 80 maplet file, 362 max command, 73
entering, 77 local variables, 339 using, 344 maximize, 166
Jordan form, 147 logical operators, 323 markers maximum, 73
loops, 325 bookmarks, 264 Mean command, 173
L general, 331 displaying, 238 merge
labels, 59 infinite, 332 for document blocks, 247 table cells, 254
last name evaluation, 317 Math mode, 4 min command, 73
Layout palette, 11 M shortcuts, 6 minimal content, 53
lcm command, 132 Macintosh mathematical functions minimize, 166
lcoeff command, 130 command/symbol completion, 7 list, 41 minimum, 73
ldegree command, 131 manuals mathematics mod command, 73
least-squares, 149 Getting Started Guide, 32 computations, 121 mod operator, 75
left single quotes, 58 online, 32 teaching and learning, 178 modes
left-hand side, 301 map command, 336 matrices, 291 Document, 1
levels of evaluation, 316 Maple Application Center, 122, 178 arithmetic, 143 Math, 4
lexicographic order, 128 Maple Getting Started Guide, 32 context menus, 146 switching between, 4
lhs command, 301 Maple Student Center, 179 data type, 139, 141 Text, 4
Limit command, 153 Maplesoft Graphing Calculator, xiii defining, 133 Worksheet, 1
limit command, 152 Maplesoft Web site, 32, 121 efficiency, 139 modify
limits, 151 Maplet Builder filling, 141 character styles, 241
Index • 389 390 • Index
table, 253 non-base 10, 74 unloading, 43, 58 Plot Builder Assistant, 28, 49
modp command, 75 numer command, 302 warnings, 43 plot command, 160
mods command, 75 numeric page break, 236 plot3d command, 295
modular arithmetic, 73, 75 approximation, 313 palettes, 11, 20, 44, 121, 298, 311 plots
modules, 342 computation, 67 Common Symbols, 11 analyzing, 222
MPS(X) files, 171 numtheory[divisors] command, 73 docks, 15 pan, 222
msolve command, 94 adding palettes, 15 point probe, 222
mul command, 334 O expanding, 15 rotate, 222
multiplication ODE Analyzer Assistant, 88 Expression, 12 scale, 222
implied, 6 operands, 303 finding items, 15 code for color plates, 230
selecting, 335 inserting items, 12 creating, 188
N operators, 10 Layout, 11 context menu, 203
names, 10, 55 functional, 292 Matrix, 12, 133, 139 displaying multiple plots, 213
adding assumptions, 116 logical, 323 moving, 15 insert plot, 206
and symbols, 16 relational, 322 Symbol Recognition, 15 Interactive Plot Builder, 28, 49,
assigned, 317 optimization, 166 Units, 24, 99 189
assigning values to, 55 efficiency, 169 viewing, 15 plot command, 207
logical, 323 plotting, 168 paragraph styles plot3d command, 207
previously assigned, 318 point-and-click interface, 167 creating, 243 plots package, 210
protected, 57 Optimization Assistant, 167 description, 239 creating animations
removing assumptions, 118 Plotter, 168 format lists, 263 animate command, 224
reserved, 57 Options dialog, 53 parameters, 339 Interactive Plot Builder, 223
unassigning, 57, 118, 319 or operator, 323 parametric solutions, 83 customizing, 215
valid, 58 Order environment variable, 160 partial differential equations context menu, 216
versus equation labels, 62 ordinary differential equations solving, 92 Interactive Plot Builder, 215
with assumptions, 116 plotting solution, 91 paste, 237 plot options, 219
new style set, 245 solving, 88 PDEs, 92 plot3d options, 219
nops command, 303 orthogonal matrix, 149 pdsolve command, 92 customizing animations, 228
norm command, 132, 147 output pencil command-line options, 229
normal command, 309 suppressing, 38 sketch pad, 275 context menu, 228
normal form, 309 updating, 31 pi Interactive Plot Builder, 228
not operator, 323 inserting, 12 exporting, 230
numbered list, 262 P pie chart, 175 functional operators, 295
numbers, 10 packages, 40 piecewise command, 172 gradient, 183
exact, 66 list, 122 placeholders, 12 line integral, 184
floating-point, 67 loading, 42 Planck constant, 105 ODEs
Index • 391 392 • Index
list, 104 simplify command, 304, 312 sort superscript format, 233
name, 105 sketch pad lists, 310 Sylvester matrix, 149
symbol, 105 canvas style, 238 polynomials, 126, 310 symbol completion, 7
uncertainty, 109 gridline, 276 sort command, 126, 310 shortcut, 7
units, 108 slider plex option, 128 symbolic
using, 105 embedding, 268 spacing format, 236 computation, 66
value, 108 solutions spellcheck, 276 objects, 67
value and units, 109 assigning as expression, 87 American spelling, 276 symbols
ScientificConstants package, 104 assigning as function, 87 dictionary, 279 entering, 16
extensibility, 110 details, 93 sqrfree command, 133 finding, 15
objects, 107 formal, 92 square roots names, 16
ScientificErrorAnalysis package, 110 formal power series, 92 entering, 7, 17 system of units, 97
extensibility, 113 integers, 93 standard content, 53 controlling, 102
objects, 111 real, 114 Standard Units environment, 101 systeme international (SI), 25, 97
sections series, 92 Standard Worksheet, xiii
in worksheet, 237 verifying, 86 statements T
security levels solve multiple lines, 338 Tab
auto-execute, 273 equations, 78 Statistics package, 171 icon, 44
security tab for real solutions, 114 continuous distributions, 171 inserting, 44
options dialog, 273 numerically, 83 discrete distributions, 171 key, 12, 44
select command, 335 symbolically, 80 plots, 175 tables, 290
selectremove command, 335 inequations, 78 strings, 297 alignment, 255
semicolon, 38–39 for real solutions, 114 StringTools package, 297 and Classic worksheet, 258
seq command, 333 symbolically, 80 Student package, 158, 178–179 appearance, 255
series, 159 integer equations, 93 calculus subpackages, 166 borders, 255
command, 159 linear system, 94, 149 LinearAlgebra subpackage, 150 contents, 253
plotting, 160 modular integer equations, 94 Maplets, 178 execution order, 257
Taylor, 159 ODEs, 88 Tutors, 178 physical dimensions, 254
type, 160 PDEs, 92 student resources, 178 printing, 257
sets, 287 recurrence relation, 95 study guides, 179 using, 252
shape option, 140 transcendental equations, 82 style set management, 245 visibility of cell content, 256
show solve command, 80, 288 subscripts Task Browser, 51
worksheet content, 266 finding all solutions, 82 entering, 6 task templates, 51, 71, 96, 121, 133,
show contents dialog finding parametric solutions, 83 format, 233 151
using, 267 real solutions, 114 substitute, 310 default content, 53
significant digits, 69 solving procedures, 83 sum command, 334 inserting, 52
Index • 395 396 • Index