# Preface

This tutorial is meant as an introduction to the mathematical program Maple created by MapleSoft © for the APMA 0330 course. This is a tutorial made solely for the purpose of education.

If you have not taken or are not taking a course regarding Maple or programming, such as CSCI 0150 or ENGN 0030, then please begin from Chapter 1. Otherwise, please begin from Chapter 2: Functions: Definition, as a Solution of ODE, Piecewise, Plotting. For those who have used Maple before, please note that there are certain commands and sequences of input that is specific to solving differential equations, so it is best to read through this tutorial in its entirety. This tutorial is based on Maple versions 10~15. Therefore, tutorials from other sources may or may not be compatible with this tutorial.

This tutorial corresponds to the Maple “mw” files that are posted on the APMA 0330 website. You, as the user, are free to use the m files to your needs for learning how to use the Maple program, and have the right to distribute this tutorial and refer to this tutorial as long as this tutorial is accredited appropriately.

Contents

Part I. Matrix Algebra

Basic operations with matrices

Geometrical and algebraic multiplicity

Diagonalization

Sylvester's formula

The resolvent method

The spectral decomposition method

Part II. Linear Systems of Ordinary Differential Equations

Systems of linear algebraic equations

Systems of ordinary differential equations

a) Variable coefficient equations

b) Constant coefficient equations

Variation of parameters

Method of undetermined coefficients

The Laplace transform

Autonomous Equations and Stability

Applications

a) Competition of species

b) Preditor-Prey models

c) SARS models

d) Multiple tanks problems

e) Lorentz equations

f) van der Pol equation

g) Other applications

ODEs models

Some numerical methods

a. Shooting method

b. Weighted residual method

c. Finite difference method

Part III. Non-linear Systems of Ordinary Differential Equations

Systems of linear algebraic equations

Systems of ordinary differential equations

a) Variable coefficient equations

b) Constant coefficient equations

Variation of parameters

Method of undetermined coefficients

The Laplace transform

Autonomous Equations and Stability

Applications

a) Competition of species

b) Preditor-Prey models

c) SARS models

d) Multiple tanks problems

e) Lorentz equations

f) van der Pol equation

g) Other applications

ODEs models

Some numerical methods

a. Shooting method

b. Weighted residual method

c. Finite difference method

Part IV. Numerical Methods

Sturm-Liouville problem

Heat transfer equations

Wave equations

Laplace equation

Applications

Part V. Series and Recurrences

Recurrencdes

Power series solutions to ODEs

Orthogonal polynomials

a. Chebyshev

b. Hermite

c. Laguerre

Euler Systems of equations

Fourier series

a) Even and odd functions

Part VI. Partial Differential Equations

Sturm-Liouville problem

Heat transfer equations

Wave equations

Laplace equation

Applications

Return to Maxima page

Return to the main page (APMA0340)

Return to the Part 1 (Matrix Algebra)

Return to the Part 2 (Linear Systems of ODEs)

Return to the Part 3 (Non-linear Systems of ODEs)

Return to the Part 4 (Numerical Methods)

Return to the Part 5 (Recurrences and Series)

Return to the Part 6 (PDEs)

# 1. 3D plotting

Return to Matlab page

Return to the main page (APMA0340)

Return to the Part 1 (Matrix Algebra)

Return to the Part 2 (Systems of ODEs)

Return to the Part 3 (Partial Differential Equations)

# 1. Functions: How to Define Function and Plots

## I. How to define functions

# 2. Solving ODEs: dfieldplot, DEplot, odeplot, Defining Function as Solution, Nullclines

## I. Solving Using Direction/Slope Fields (dfieldplot)

***

The input should generate the above direction field. Unfortunately, you must plot differential equations using dfieldplot explicitly. Therefore, it is best to solve a given differential equation to express it explicitly if it is given implicitly.

## II. Solving Using DEplot

***

The input should generate the above direction/slope field with three curves approaching y(t)=20. Note that the initial values used for the DEplot command can be in the form of an array using brackets. Unfortunately, for DEplot, like dfieldplot, the differential equations must be expressed explicitly.

# 3. Analytical Solutions (General and Particular Solutions) and Cauchy Problem

Deriving analytical solutions in Maple is a cumulative process. This means that the more specific the answer is that you’re looking for, the more steps you have to take to derive that answer. In general, deriving analytical solutions is a two step process, which is solving for a general solution and then solving for the particular solution.

## I. Solving ODEs (General Solution)

# 4. Sequences and Recurrences

Recurrences, although a very tedious computation method by hand, is very simple to do in Maple. The best way to learn how to do recurrences in Maple are by examples, and a perfect example for this topic is the Fibonacci sequence.

## I. Explicitly Defined Sequences

## II. Recursively Defined Sequences

Now that we’ve seen an explicitly defined sequence, let’s take a look at a recursively defined sequence.

The
format of a recursive sequence is different from the above example
mainly because the commands and input is entirely different. Here, you
will use for, from, to, do, and od commands, which are special commands.
Why are they special? For one, they appear differently when typed in
Maple. Normal commands appear red, but these commands appear in black
and bold. These commands also cannot solve equations alone compared to
other commands. They must be used together in order for c

# 5. Numerical Solutions: Plotting Difference Between Exact and Approximate in Regular Plot/Log Plot

## Explanation of syntax:

# Polynomial Approximation using Taylor series expansions

**The examples used for this section is related to the Cauchy example in the Analytical Solutions chapter.*

## VI. First Order Polynomial Approximation

*

## VIII. Third Order Polynomial Approximation

***

The total number of numerical operations here is 420. It is obvious at this point why using mathematical programs such as Maple is a desired approach for such problems.