Introduction to Maple for Engineers

This page is under construction. Some links do not work, but I intend at some point to add content there.

Welcome to Maple: in my opinion, the top example of a symbolic computation language in the world today, a product that continues to be developed and maintained by professionals around the world. These pages are intended to aid an engineering student to using and mastering the Maple environment and assumes that the user understands at least one other programming language, such as, but not restricted to, C, C++, Matlab or Python.

Setup

When you launch the Maple (the IDE version), you are welcomed with a page that allows you to select a New Document and a New Worksheet. The document format provides a word-processing interface that is useful for authoring reports that contain mathematical expressions that can be executed dynamically, but we will be using an interface closer to that of Matlab and Python: an interpreter that allows you to enter Maple statements, so be sure to select a New Worksheet. You can have multiple worksheets, each under its own tab, and you can always open a new worksheet using File→New→Worksheet Mode.

Next, we are looking to learn how to use the Maple programming language, so select Tools→Options and then select the Display tab and the first option is Input display:. From the drop-down menu, choose Maple Notation and not 2-D Math Notation. The Output display: option should be left as 2-D Math Notation.

In your worksheet, you should now see a prompt together with a blinking cursor:

[> |

If you are launching the command-line version of Maple (cmaple), you will, instead, see some ASCII art and a prompt:

    |\^/|     Maple 202? (...)
._|\|   |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 202?
 \  MAPLE  /  All rights reserved. Maple is a trademark of
 <____ ____>  Waterloo Maple Inc.
      |       Type ? for help.
> _

In either case, you can now type some text and it will appear in the Courier New font. In the graphical user interface, the font will also be red and bold. In the graphical user interface, you can change the font size by selecting either of the magnifying glasses with a + (enlargen) or - (reduce).

Onto our topics:

The basics: expressions, algebra and calculus

  1. integer and rational arithmetic (and assignments and comments)
  2. %, %% and %%%
  3. floating-point arithmetic
  4. algebraic expressions
  5. algebraic equations
  6. mathematical constants: Pi, gamma, infinity, undefined, etc.
  7. mathematical functions
  8. function algebra
  9. complex numbers
  10. radical expressions
  11. expression limits: limit(...)
  12. expression differentiation:diff(...)
  13. function differentiation: D(...)
  14. expression integration: int(...)
  15. expression Taylor series: series(...) and convert(..., 'polynom')
  16. expression asymptotic series: series(...) at infinity
  17. expression adding: add(...)
  18. expression summation: sum(...)
  19. expression multiplying: mul(...)
  20. expression product: product(...)
  21. expression plotting: plot(...)
  22. function plotting: plot(...)
  23. expression manipulation: expand(...), factor(...) and simplify(...)

Basic data structures: Expression sequences, sets and lists

  1. expression sequences
  2. lists and mod1(...)
  3. sets and set operators union, intersect, minus, in and subset
  4. unevaluated functions
  5. manipulating operands: op, nops, select, remove, map

Solving algebraic equations and systems of algebraic equations

  1. analytic solutions
  2. floating-point approximations

Solving recurrence relations

  1. analytic solutions

Tables: the Maple hash map

  1. tables

Comparison and logical operators, and flow-control statements

  1. comparison operators: =, <>, <, <=, >=, >,
  2. piecewise-defined expressions: piecewise(...)
  3. logical operator
  4. conditional statements
  5. looping statements
  6. discontinuities and plotting discontinuous expressions: discont(...), plot(..., 'discont' = true) and about(...)

Arrays and multi-dimensional arrays

  1. one-dimensional arrays
  2. multi-dimensional arrays

Integral transforms (Laplace and Fourier)

  1. Laplace transform
  2. Fourier transform

Solving initial- and boundary-value problems

  1. initial-value problems
  2. numerical approximations for initial-value problems
  3. boundary-value problems
  4. numerical approximations for boundary-value problems

Integral transforms (Laplace and Fourier)

  1. signal-processing functions: $u(t)$ and $\delta(t)$ and alias(...)
  2. signal-processing integration: $\int_{0^-}^\infty f(t) dt$
  3. partial-fraction decomposition: convert(..., 'parfrac')
  4. the convolution
  5. the Laplace transform: inttrans[laplace](...)
  6. the Fourier transform: inttrans[fourier](...)

Linear algebra

Important: Maple does not allow for symbolic vectors and matrices; however, the entries of a given vector or matrix can be rational, floating-point, or algebraic expressions including unknowns.

  1. defining vectors
  2. defining matrices
  3. matrix and vector operations
  4. the LinearAlgebra package

Vector calculus

When you include the VectorCalculus package, it sets up an environment in which you can set the coordinate system and then proceed to perform various operations on scalar and vector fields in two and three dimensions. Thus, we will go through four examples, two in two and the other two in three dimensions. It is possible to use the tools in this package without including using with( VectorCalculus );, but this is much more tedious as the coordinate system must be passed to each function call. You are welcome to investigate this on your own.

In this, we will see use of functions such as VectorCalculus['Gradient'](...), VectorCalculus['Divergence'](...), VectorCalculus['Curl'](...), etc.

  1. Vector calculus in two dimensions and rectangular coordinates
  2. Vector calculus in two dimensions and polar coordinates
  3. Vector calculus in three dimensions and Cartesian coordinates
  4. Vector calculus in three dimensions and spherical coordinates

Curve fitting

The CurveFitting packages has a number of functions that are useful in fitting curves to data; however, the two that engineers will be first interested in are presented here:

  1. point plotting: plots['pointplot'](...)
  2. polynomial interpolation: CurveFitting['PolynomialInterpolation'](...)
  3. least-squares best-fitting functions (or linear regression): CurveFitting['LeastSquares'](...)

Scientific constants

  1. scientific constants: ScientificConstants['Constant'](...), $G$, $e$, $\mu_0$, $h$, etc.
  2. elements: ScientificConstants['Element'](...), H, He, Li, Be, B, C, N, etc.

Scientific error analysis

  1. scientific error analysis

Tolerances

Statistics

The field of statistics is vast, and therefore, it is awkward that there is a single statictics package in Maple that tries to contain all aspects of this field. In the topics below, we will focus only on topics that are related.

  1. discrete distributions: Bernoulli(...), Binomial(...), Poisson(...)
  2. continuous distributions: Uniform(...), Normal(...)
  3. computational statistics: Mean(...), StandardDeviation(...), etc. of data sets

Caches

Stacks and queues (doubly-ended queues)

  1. doubly-ended queues: DEQueue(...)

Strings

  1. strings
  2. printf (just like in C/C++)

Units

  1. unit conversions

Permutations, combinations and other combinatorics

What are all permutations of $1, 2, 3$ or all combinations of $a, b, c, d$? These can be found with the combstruct package:

  1. permutations, combinations, partitions and compositions
  2. other combinatorial functions

Types

  1. types
  2. the :: (double colon) operator

Symbolic and numeric mathematics

  1. the sign of an expression (signum(...))
  2. integer functions (round(...), frac(...), ilog(...), etc.)
  3. special functions (Bessel functions, Airy functions, Jacobi elliptic functions, etc.)
  4. manipulating polynomials (...)
  5. identifying floating-point numbers (identify( ... ))

Code generation

  1. code generation (CodeGeneration[C]( ... ))

Graph theory

  1. graph theory package

Procedures

  1. procedures (proc(...) ... end proc)

Other oddities

  1. symbols with back-quotes: `Hello world!` := 3;

What's coming?

After this, I intend to focus on how to perform efficient numeric calculations as well as parallel programming with threads.