Part 3: Commands and Packages - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Getting Started : Tutorials : MaplePortal/Tutorial3

Part 3: Commands and Packages

Go to Maple Portal     Previous Tutorial     Next Tutorial

 

Introduction

Using Top Commands and Packages

Getting Help

See Also

Introduction

Maple Tutorials are designed to help you get started with Maple, learn about the key tools available in Maple, and lead you through a series of problems.

 

In Part 3: Commands and Packages, you will learn more about Maple top-level commands and about how to use packages.  You will also learn to use the help system.

 

To try this material on your own, start with an empty Maple document. Perform the steps described in the left column of each table below.  The results of the steps are displayed in the right column for reference.

 

Refer to Help>Quick Reference for basic getting started tips.

 

Note for non-Windows users: The keystrokes given in this document are for Windows.  There will be differences for other platforms. If you are using a different platform, see Help>Quick Help for the list of the most common keystrokes.

 

Using Top Commands and Packages

Maple has over 4000 commands that provide comprehensive, in-depth coverage of a vast range of mathematical and programming topics.  In the tutorials 1-Talking to Maple and 2-Putting Your Ideas Together, you have already seen a number of Maple commands, including sin, taylor, int, exp, dsolve, solve, fsolve, rhs, and eval, and accessed many more behind-the-scenes using context-sensitive menus.  Context menus and interactive assistants all use user-accessible Maple commands to perform their tasks. Some Maple commands are top-level commands while others are organized into packages.

Maple Commands

Frequently, general purpose commands are available at the top level, and can be accessed at any time.  In addition to the command listed above, top level commands include trigonometric and special functions and commands for expression manipulation such as factor, expand, and simplify. To view the extensive list of top-level functions in Maple, see Index of Functions.

 

Tip: Most Maple commands are written in the Maple language, but a small collection are built into the compiled Maple kernel. Some of the commands you have already seen are built-in commands, such as taylor, rhs, and eval.   Other useful built-in commands are shown in the following table.

 

Useful and Efficient Commands

Examples

evalf - evaluate using floating-point arithmetic

ln2 = ln2

evalfln2 = 0.6931471806

evalb- evaluate as a Boolean expression

evalb11>0 = false

a2:

b2:

evalba=b = true

sort - sort a list of values or a polynomial

sort2, 1, 3, 1 = 1,1,2,3

sort1+2 x4+3 x+x3 = 2x4+x3+3x+1

seq - create a sequence

seq1..4 = 1,2,3,4

seqi3,i=1..4 = 1,8,27,64

map - apply a procedure to each operand of an expression

 

zip - zip together two data sets by applying a binary function to the components of the two data sets

 

The function iquo returns the quotient of two integers.

mapln,1,2,3,4 = 0,ln2,ln3,2ln2

zipiquo,207,241,345, 1235,17,21,30,44 = 12,11,11,28

select, remove, and selectremove - selection or removal from an expression

 

Those elements which satisfy the Boolean-valued command are returned.  Here, we use the Boolean-valued command issqr, which tests if an integer is a perfect square.  

selectissqr,42, 53, 64 = 64

indets - find the indeterminates of an expression

 

Expressions such as ⅇy are considered indeterminates.  Use the type `name` to return only variable names.

indetsxy+zxⅇy = x,y,z,ⅇy

indetsxy+zxⅇy,name = x,y,z

The tutorial 6-Data Structures includes more examples using some of these commands.  For more information on how to identify whether a command is implemented in the kernel, see type/builtin.

Using Packages

Maple also contains packages, which are collections of commands.  Some top Maple packages are listed in the table.

Package

Purpose

CodeGeneration

tools for translating Maple code to other languages

combinat

combinatorial functions, including commands for calculating permutations and combinations of lists and partitions of integers

CurveFitting

commands that support curve-fitting

DEtools

tools for manipulating, solving, and plotting systems of differential equations

DiscreteTransforms

commands for computing transforms of discrete data

DynamicSystems

commands for creating, manipulating, simulating, and plotting linear systems objects

LinearAlgebra

commands for manipulating Matrices and Vectors and performing Linear Algebra

Optimization

commands for numerically solving optimization theory problems

plots

commands for displaying graphical representations

Statistics

tools for mathematical statistics and data analysis

StringTools

optimized commands for string manipulation

For a full list of Maple packages, see Index of Packages.

 

There are two ways to use the commands in a package: by using the long form or short form of their calling sequences.

• 

Long form:  The commands in a package can always be accessed using the long form of the calling sequence.  This form is PackageName[CommandName].

• 

Short form: The short form of the calling sequence for all commands in a package can be used during the current Maple session after with(PackageName) has been entered.  The short form is simply CommandName.

Steps

Result

Example:

Use the Minimize command from the Optimization package to minimize 4x2lnx, given the initial point x=.5.

 

First, we will use the long form by calling Optimization[Minimize].

 

The minimum is given, followed by the x-value for which this minimum is attained.

expr4x2lnx:

OptimizationMinimizeexpr,initialpoint=x=.5

1.53972077083991810,x=0.353553390618445984

(2.2.1)

Now, enter with(Optimization).

 

A list of all the commands in the package is returned.  (To suppress the display of this list, use a colon (:) after this command.)

 

Now, all these commands can be used by just entering the command name.  This is the short form of the calling sequence.

 

Example:

Redo the problem, using the short form.

 

 

 

 

Tip:  Packages can also be loaded from the Tools menu.

withOptimization

ImportMPS,Interactive,LPSolve,LSSolve,Maximize,Minimize,NLPSolve,QPSolve

(2.2.2)

Minimizeexpr,initialpoint=x=.5

1.53972077083991810,x=0.353553390618445984

(2.2.3)

For more information on these two methods of accessing package commands, see Using Packages.

Getting Help

Maple has an extensive help system, including help pages, online manuals, examples, and an integrated dictionary of mathematical and engineering terms.

Steps

Useful for

Select the Help>Maple Help menu to display the help browser.  (You can also open Maple Help by pressing [Ctrl][F1].)

 

Enter the topic name (such as "integral") into the search box.  Click Search. The int help page opens.

 

You can copy and paste the examples section to your document.    From the Edit menu, select Copy Examples.  In your document, choose Edit>Paste.  (These options are also available from the context-sensitive menu.)

 

By default, examples are displayed in 2-D math.  To view the examples in 1-D math, click the  button to toggle the display.

 

Search and browse full help system, including help pages, dictionary, and manuals.

 

 

From the help page, you can see the calling sequences, read the description, and view examples.  

 

If you copy the examples to your document, you can then modify and execute the examples.

Within a document, there are two easy ways to get help on a topic:

 

1. 

To get help on a particular topic, use the ? notation. For example, type ?solve [Enter] in math mode.

 

2. 

For information on a topic name that already appears in your document, place the cursor on the word and press [F2].

 

Example:  Place the cursor on the word Optimization and press [F2].

Instant access to the help page when you know the topic name or command name.

 

 

?solve

 

 

 

 

 

The Minimize command is found in the Optimization package.

Help>Quick Help (or [F1]). Follow links for full explanations.

Quick keyboard shortcuts and links to further help.

Help > Quick Reference (or [Ctrl][F2])

Basic overview of important topics.

?examples,index

Example worksheets illustrating different mathematical and programming commands.  These worksheets will open in a new tab in your Maple window.

Tools>Task>Browse for task templates.

Fill-in-the-blank templates organized by concept.

Access Maple's manuals through the help system. Select the Help>Maple Help menu to display the help browser.  

Next, in the Table of Contents tab, expand the Manuals directory to access the User Manual or Programming Guide.

 

PDFs from the Maplesoft web site provide other format options for Maple's manuals.  Visit the Maplesoft Documentation Center, http://www.maplesoft.com/documentation_center.

Conceptual overviews as well as more in-depth explanation.

Help>Take a Tour of Maple for tour through Maple's features and to see sample applications.

Quick introduction to a variety of Maple features in slide-show format.

 

Examples of polished interactive technical documents.

See Also

index/function, index/package, UsingPackages

 

Go to Maple Portal     Previous Tutorial     Next Tutorial


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam