lec2.mws
L-2 MCS 320 Wednesday 24 August 2005
1. Getting Started
We will use Maple as a calculator
Notice the continuation symbol: \
| > |
b := %; # assigns the last result to the variable b |
| > |
a := %%%; # 3rd last result |
With % we get the last result, but this is the result of the last command that is executed, which is not necessarily the command just before the command which uses the %. As a rule, we will however, always run our worksheets from top to bottom.
The restart cleared the values associated to a, b, and c. In this worksheet, we can comment out the restart above, and execute the whole worksheet.
In Maple we can work with extended floating-point arithmetic, for example:
From the output of sin(%), we see that the default precision in Maple is 10 decimal places.
| > |
evalf(sin(Pi30),30); # evaluate sine with 30 decimal places |
Now we see that the result is much closer to zero, than with 10 decimal places.
2. Getting Help
| > |
?help; # launch the help browser |
To Launch the help browser, go to the Help menu, and select "Using Help".
Via the Help Browser, we can select the appropriate path from the left to the right, ending at the leaf, which corresponds to the help page for one command.
The shorter way to get to the help page for a command is
| > |
example(evalf); # collapses other sections than examples |
| > |
usage(evalf); # shows only the syntax of the command |
3. The Maple Library
Many commands are written as Maple procedures, which are collected into packages.
With the "with" we load the package into a Maple worksheet, which means we can use the functions in this package.
After loading the package orthopoly, the "T" stands for the Chebyshev polynomial.
Suppose we wanted to use T as a name for a variable, then we can use the long form
| > |
T(4,x); orthopoly[T](4,x); |
To create a better name, we may use an alias:
| > |
alias(cheby=orthopoly[T]); |
4 Assignments
7(a)
| > |
equ := ln(10^x) = x*ln(10); |