Contents Previous Next Index

2 Document Mode


Using the Maple software, you can create powerful interactive documents. You can visualize and animate problems in two and three dimensions. You can solve complex problems with simple pointandclick interfaces or easytomodify interactive documents. You can also devise custom solutions using the Maple programming language. While you work, you can document your process, providing text descriptions.

2.1 In This Chapter


Section

Topics

Introduction

•

Comparison of Document and Worksheet Modes


Entering Expressions  Overview of tools for creating complex mathematical expressions


Evaluating Expressions  How to evaluate expressions

•

Displaying the Value Inline

•

Displaying the Value on the Following Line


Editing Expressions and Updating Output  How to update expressions and regenerate results

•

Updating a Single Computation

•

Updating a Group of Computations

•

Updating All Computations in a Document


Performing Computations Overview of tools for performing computations and solving problems

•

Computing with Palettes






2.2 Introduction


Maple has two modes: Document mode and Worksheet mode.
Document mode is designed for quickly performing calculations. You can 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.
Document mode sample:
Find the value of the derivative of at .
Integrate over the interval .
=
Worksheet mode is designed for interactive use through commands and programming using the Maple language. The Worksheet mode supports the features available in Document mode described in this chapter. For information on using Worksheet mode, see Chapter 3, Worksheet Mode. Note: To enter a Maple input prompt while in Document mode, click
in the Maple toolbar.
Important: In any Maple document, you can use Document mode and Worksheet mode.
Interactive document features include:
•

Embedded graphical interface components, like buttons, sliders, and check boxes

•

Automatic execution of marked regions when a file is opened

•

Character and paragraph formatting styles

These features are described in Chapter 7, Creating Mathematical Documents.
Note: This chapter and Chapter 1 were created using Document mode. All of the other chapters were created using Worksheet mode.


2.3 Entering Expressions


Chapter 1 provided an introduction to entering simple expressions in 2D Math (see Entering Expressions). It is also easy to enter mathematical expressions, such as:
•

Piecewisecontinuous functions:

•

Limits:

•

Continued fractions:

and more complex expressions.
Mathematical expressions can contain the following objects.
•

Numbers: integers, rational numbers, complex numbers, floatingpoint values, finite field elements, , , ...

•

Constants: ...

•

Names (variables): ...

•

Data structures: sets, lists, Arrays, Vectors, Matrices, ...

Maple contains over a thousand symbols. For some numbers, operators, and names, you can press the corresponding key, for example, 9, =, >, or x. Most symbols are not available on the keyboard, but you can insert them easily using two methods, palettes and symbol names.

Example 1  Enter a Partial Derivative


To insert a symbol, you can use palettes or symbol names.
Enter the partial derivative using palettes.
Action

Result in Document

1.

In the Calculus palette, click the partial differentiation item
. Maple inserts the partial derivative. The variable placeholder is selected.



2.

Enter t, and then press Tab. The expression placeholder is selected.



3.

Enter . Note: To enter the exponential e, use the expression palette or command completion.





To evaluate the integral and display the result inline, press Ctrl+= (Command+=, for Macintosh) or Enter. For more information, see Computing with Palettes.
You can enter any expression using symbol names and the symbol completion list.
Action

Result in Document



2.

Select the partial differentiation item,



3.

Replace the placeholder with t. Use the right arrow to move out of the denominator. Enter as in the previous example.







Example 2  Define a Mathematical Function


Define the function which doubles its input.
Action

Result in Document

1.

In the Expression palette, click the single variable function definition item,
.



2.

Replace the placeholder f with the function name, Press Tab to move to the next placeholder.



3.

Replace the parameter placeholder, a, with the independent variable Press Tab.



4.

Replace the output placeholder, y, with the desired output,





=
=
Note: To insert the right arrow symbol , you can also enter the characters > in Math mode. In this case, symbol completion is automatic.
Important: The expression is different from the function .
For more information on functions, see Functional Operators.



2.4 Evaluating Expressions


To evaluate a mathematical expression, place the cursor in the expression and press Ctrl + = (Command + =, for Macintosh). That is, press and hold the Ctrl (or Command) key, and then press the equal sign (=) key.
To the right of the expression, Maple inserts an equal sign and then the value of the expression.
=
You can replace the inserted equal sign with text or mathematical content.
To replace the equal sign:
1.

Select the equal sign. Press Delete.

2.

Enter the replacement text or mathematical content.

For example, you can replace the equal sign with the text "is equal to".
is equal to
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.
 (2.1) 
By default, Maple labels output that is generated by pressing Enter. For information on equation labels, see Equation Labels. In this manual, labels are generally not displayed.
In text, pressing Enter inserts a line break.
You can use the basic algebraic operators, such as and , with most expressions, including polynomials—see Polynomial Algebra—and matrices and vectors—see Matrix Arithmetic.
=
=


2.5 Editing Expressions and Updating Output


One important feature of Maple is that your documents are live. That is, you can edit expressions and quickly recalculate results.
To update one computation:
2.

Press Ctrl + = (Command + =, for Macintosh) or Enter.

The result is updated.
To update a group of computations:
2.

Select all edited expressions and the results to recalculate.

3.

Click the Execute toolbar icon
.

All selected results are updated.
To update all output in a Maple document:
•

Click the Execute All toolbar icon
.

All results in the document are updated.


2.6 Performing Computations


Using the Document mode, you can access the power of the advanced Maple mathematical engine without learning Maple syntax. In addition to solving problems, you can also easily plot expressions.
The primary tools for syntaxfree computation are:
Note: The Document mode is designed for quick calculations, but it also supports Maple commands. For information on commands, see Commands in Chapter 3, Worksheet Mode.
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.

Computing with Palettes


As discussed in Entering Expressions, some palettes contain mathematical operations.
To perform a computation using a palette mathematical operation:
1.

In a palette that contains operators, such as the Expression or Calculus palettes, click an operator item.

2.

In the inserted item, specify values in the placeholders.

3.

To execute the operation and display the result, press Ctrl+= (Command+=, for Macintosh) or Enter.

For example, to evaluate inline:
2.

Press Ctrl+= (Command+=, for Macintosh).

=


Context Menus


A context menu is a popup menu that lists the operations and actions you can perform on a particular expression. See Figure 2.1.

Figure 2.1: Context Menu



To display the context menu for an expression:
•

Rightclick (Controlclick, for Macintosh) the expression.

The context menu is displayed beside the mouse pointer.
You can evaluate expressions using context menus. The Evaluate and Display Inline operation (see Figure 2.1) is equivalent to pressing Ctrl+= (Command+=, for Macintosh). That is, it inserts an equal sign (=) and then the value of the expression.
Alternatively, press Enter to evaluate the expression and display the result centered on the following line.
For more information on evaluation, see Evaluating Expressions.
From the context menu, you can also select operations different from evaluation. To the right of the expression, Maple inserts a right arrow symbol (→) and then the result.
For example, use the Approximate operation to approximate a fraction:
You can perform a sequence of operations by repeatedly using context menus. For example, to compute the derivative of use the Differentiate operation on the expression, and then to evaluate the result at a point, use the Evaluate at a Point operation on the output and enter 10:
The following subsections provide detailed instructions on performing a few of the numerous operations available using context menus. Figures in the subsections show related context menus or palettes.

Approximating the Value of an Expression


To approximate a fraction numerically:
3.

From the context menu, select Approximate, and then the number of significant digits to use: 5, 10, 20, 50, or 100.


Figure 2.2: Approximating the Value of a Fraction



You can replace the inserted right arrow with text or mathematical content.
To replace the right arrow ():
1.

Select the arrow and text. Press Delete.

2.

Enter the replacement text or mathematical content.

Note: To replace the right arrow with text, you must first press F5 to switch to Text mode.
For example, you can replace the arrow with the text "is approximately equal to" or the symbol ≈.


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.
To solve an equation:
3.

From the context menu, select Solve or Numerically Solve in the Solve menu item.


Figure 2.3: Finding the Approximate Solution to an Equation



For more information on solving equations, including solving inequations, differential equations, and other types of equations, see Solving Equations.


Using Units


You can create expressions with units. To specify a unit for an expression, use the Units palettes. The Units (FPS) palette (Figure 2.4) contains important units from the footpoundsecond (FPS) system of units used in the United States. The Units (SI) palette (Figure 2.5) contains important units from the international system (SI) of units.

Figure 2.4: FPS Units Palette




Figure 2.5: SI Units Palette



To insert an expression with a unit:
2.

In a unit palette, click a unit symbol.

Note: To include a reciprocal unit, divide by the unit.
To evaluate an expression that contains units:
1.

Enter the expression using the units palettes to insert units.

2.

Rightclick (Controlclick, for Macintosh) the expression.

3.

From the context menu, select Units and then Simplify.

For example, compute the electric current passing through a wire that conducts 590 coulombs in 2.9 seconds.
For more information on using units, see Units.



Assistants and Tutors


Assistants and tutors provide pointandclick interfaces with buttons, text input regions, and sliders. For details on assistants and tutors, see PointandClick Interaction.
Assistants and tutors can be launched from the Tools menu or the context menu for an expression. For example, you can use the Linear System Solving tutor to solve a linear system, specified by a matrix or a set of equations.

Example 3  Using a Context Menu to Open the Linear System Solving Tutor


Use the Linear System Solving tutor to solve the following system of linear equations, written in matrix form:
Action

Result in Document

1.

In a new document block, create the matrix or set of linear equations to be solved.



2.

Load the Student[LinearAlgebra] package. From the Tools menu, select Load Package → Student Linear Algebra. This makes the tutors in that package available. For details, see Package Commands.


Loading Student:LinearAlgebra

3.

Rightclick the matrix and select Student Linear Algebra → Tutors → Linear System Solving.... The Linear System Solving dialog appears, where you can choose the solving method. Gaussian Elimination reduces the matrix to rowechelon form, then performs backsubstitution to solve the system. Gauss Jordan Elimination reduces the matrix to reduced rowechelon form, where the equations are already solved. For this example, choose Gaussian Elimination.



4.

The Gaussian Elimination dialog opens. You can specify the Gaussian elimination stepbystep, or you can use the Next Step or All Steps buttons to have Maple perform the steps for you.

5.

Once the matrix is in rowechelon (uppertriangular) form, click the Solve System button to move to the next step.



6.

The Solve the system of equations in RowEchelon Form dialog appears. Click the buttons on the right to calculate the solution: first find the Equations, then solve for each variable. Click the Solution button to display the solution in the tutor.



7.

Click the Close button to return the solution to your document.





For more information on linear systems and matrices, see Linear Algebra.




Contents Previous Next Index
