Programming in Maple

Roger Kraft
Department of Mathematics, Computer Science, and Statistics

Purdue University Calumet

roger@calumet.purdue.edu

Table of Contents

Introduction

1. Functions in Maple

1.1. Introduction

1.2. Functions in Mathematics

1.3. Functions in Maple

1.4. Expressions vs. functions: Some puzzles

1.5. Working with expressions and Maple functions (review)

1.6. Anonymous functions and expressions (review)

1.7. Functions that return a function (optional)

2. Maple's Evaluation Rules

2.1. Introduction

2.2. Full evaluation

2.3. Levels of evaluation

2.4. Delayed evaluation

2.5. A no evaluation rule

2.6. Last name evaluation

2.7. Evaluating function calls

2.8. Evaluating function definitions

2.9. Evaluating concatenated names (optional)

2.10. Evaluating indexed names (optional)

2.11. Online help for evaluation rules

3. Data Structures in Maple

3.1. Introduction

3.2. Basic data structures in Maple

3.2.1. Expression sequences

3.2.2. Lists

3.2.3. Sets

3.2.4. Some numeric data types

3.2.5. Names (or symbols)

3.2.6. Strings

3.2.7. Equations and inequalities

3.2.8. Ranges

3.2.9. Function calls

3.3. Data vs. data structure vs. data type

3.4. Data types in Mathematics

3.5. Nested data structures

3.6. Expressions as data structures

3.7. Expression trees

3.8. Why are expression trees important?

3.9. Some other basic data types (optional)

3.9.1. Logical data types

3.9.2. Dotted names

3.9.3. Indexed names

3.9.4. Series

3.9.5. Unevaluated expressions

3.9.6. `::`

3.10. Tables and arrays (optional)

3.10.1. Tables

3.10.2. Arrays

3.10.3. Vectors and matrices

3.10.4. Last name evaluation and the copy command

3.10.5. Names, data structures, and garbage collection

3.10.6. Index functions

3.10.7. Comparing tables with functions

3.11. Structured data types (optional)

3.11.1. Data types in general

3.11.2. Structured data types

3.11.3. Surface and nested data types

3.11.4. Defining data types

3.12. Online help for data structures and data types

4. Procedures in Maple

4.1. Introduction

4.2. From execution group to procedure

4.3. Some definitions

4.4. Parameter, local, and global variables

4.5. Another example

4.6. Maple functions are procedures

4.7. How a mathematical function is like a procedure

4.8. Anonymous procedures

4.9. Procedures and data structures

4.10. Procedure data structure

4.11. Remember tables

4.12. The args expression sequence (optional)

4.13. Recursive procedures (optional)

4.14. Working with execution groups and procedures

4.15. Online help for procedures

5. Maple's Control Statements

5.1. Introduction

5.2. Repetition statements

5.3. More loop examples

5.3.1. Example 1: Riemann sums

5.3.2. Example 2: Pascal's triangle

5.3.3. Example 3: Periodic extensions

5.3.4. Example 4: Drawing graphs

5.3.5. Example 5: Butterfly curve

5.3.6. Example 6: Animations

5.4. Conditional statements

5.5. Boolean expressions

5.6. For-loop like commands

5.7. Statements vs. expressions (optional)

5.8. Print levels, printlevel, and print commands (optional)

5.9. Procedures that return unevaluated or return NULL (optional)

5.10. Online help for control statements

6. Manipulating Data Structures with Procedures

6.1. Introduction

6.2. Differentiating a monomial

6.3. Differentiating a polynomial: the map command

6.4. Some real Maple procedures

6.5. "Reversing" a polynomial

6.6. Teaching Maple new tricks

6.7. Differentiating functions

6.8. Differentiating almost anything (optional)

6.9. Online help for Maple programming