BASIC HELP WITH MAPLE

THE BASICSITERATIVE LOOPSSOLVING NON-LINEAR EQUATIONSSOLVING DIFFERENTIAL EQUATIONS GENERAL HELP

I know that many of you come with a lot of apprehension for Maple.
I can not promise miracles but I will try my best to help.


THE BASICS

A simple example:

In this example I try to show you a number of common problems.  I assigned values to X and x (4 and 5).
By typing their names in the next line I got their values.  As you can see they are different. 

Lesson #1  Maple is case sensitive

Lesson #2  To assign values to a variable use :=                                                                                                    
                   The equal sign by itself it not enough - see above; when typing y in the second line I get nothing :)
                   Frustrating I know.  Actually y=6 means an equation and not an assignment of 6 to variable y.      

To erase the value of a variable (x in the example below) type:

To reset Maple use:

The following cryptic error message means that each command needs to terminate with a semicolon (;)


The definition of variables in MAPLE is very flexible.  For example:
An equation can be stored in a variable. Or its solution can be stored in a variable etc. See the example below.
 


 


LOOPS

"Do loops" i.e. iterations of an action over a range of values for an index can be done as follows
(note that the first line has no semicolon at the end - this is one of the few exceptions)

Also WHILE loop are also possible:

eval(i-1) means to evaluate the expression (i-1) before assigning the value to i (because i=i-1 is a recursive relationship).


SOLVING NON-LINEAR EQUATIONS

Maple has a number of "solver" commands (solve,dsolve, fsolve etc.)
In principle solve should give you the analytical solutions if they exist (it never hurts to try).

If analytical solutions can not be found, most probably Maple will spit out something like this:

This means in Maplese that a root can not be found.
A numerical solver exists and is called fsolve

Note that it will only give you one solution.  You can guide Maple to look into a specific interval. For example between 0.5 and 10

In newer versions Maple solve automatically involves the numerical solver if a floating point number is included in the equation (e.g., 0.1 below).

Compare this with the previous example where I put 1/10 instead of 0.1 on purpuse. By expressing all numbers in integers and fractions I imply to Maple that I want the highest possible precision without numerical approximation.


SOLVING DIFFERENTIAL EQUATIONS

Maple has a very powerful  solver differential equations, the command "dsolve".  It has the capability of providing both analytical solutions, if they exist, and numerical solutions
To begin with , you need to know how to write a differential equation in Maple. 

The syntax is self-evident.  If you just write diff(y(x),x)=x*y^2 - Maple will not be able to solve the equation.  Use the full form: y(x).
The solution can be obtained analytically as:


The _C1 symbol is used by Maple to denote the constant that needs to be determined from the initial conditions. 
You can do this directly by using the following syntax:

Second or higher order differential equations can also be solved.  Note the "peculiar" syntax for the second derivative diff(y(x),x$2), as well as the way that the initial conditions neeed to be incorporated.  Recall that here since the order of this ODE is 2, two initial conditions are needed.   D(y)(0)=1 means that the 1st derivative of the unknown function y(x) at x=0 is equal to 1. 

Higher order equations are possible. please pay attention to the notation.


GENERAL HELP

Use the help button of Maple. It is helpful indeed under one condition.  Instead all the explanation for a command, scroll down - at the end of the page there are examples which are usually more helpful than anything else.