Maple Sessions and Saving Worksheets, Study notes of Machine Learning

Fundamental information about Maple sessions, saving worksheets, and how to avoid common issues. It also highlights the importance of the Maple Learning Guide. the difference between a Maple session and a worksheet, and how to save and reload worksheets. It also provides tips for troubleshooting common issues.

Typology: Study notes

2021/2022

Uploaded on 05/11/2023

houhou
houhou 🇺🇸

4

(7)

265 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Important getting-started information
In this section, we review some fundamental but crucial things about Maple sessions,
saving your work, and how to avoid those mysterious things that seem to happen the night
before the assignment is due.
One thing to remember is that a good source of information about how to use Maple is the
Maple Learning Guide (that comes in the boxes of Maple software) -- especially the
material at the beginning.
Maple sessions
A Maple session is the set of commands you type in, responses Maple gives, and the
values or expressions that are assigned to variables, in the order they are typed in.
You start a new session every time you quit and restart Maple. You can also start a new
session without quitting by entering the command restart;
Distinct from the Maple session is your worksheet, which is the set of typed commands
and responses, along with text and graphics that you insert, which you see on the screen.
The worksheet is what gets saved, and what gets printed out. The values of variables and
loaded packages ("with"s) are not saved in the worksheet!
When you reload a saved worksheet, Maple doesn't remember the variables you assigned or
the packages you loaded (even though all that information is in the worksheet). To get back
to where you were, simply hit the "Enter" key repeatedly until all the statements have
been executed again. Some statements don't need to be re-executed, like plots that already
appear in the worksheet. You can save time by skipping these.
During a Maple session, you can refer to the output of your last (chronological) command
with the percent sign %:
> x:=34/13;
x := 34
13
> evalf(%);
2.615384615
20
pf3

Partial preview of the text

Download Maple Sessions and Saving Worksheets and more Study notes Machine Learning in PDF only on Docsity!

Important getting-started information

In this section, we review some fundamental but crucial things about Maple sessions, saving your work, and how to avoid those mysterious things that seem to happen the night before the assignment is due. One thing to remember is that a good source of information about how to use Maple is the

Maple Learning Guide (that comes in the boxes of Maple software) -- especially the

material at the beginning.

Maple sessions

A Maple session is the set of commands you type in, responses Maple gives, and the

values or expressions that are assigned to variables, in the order they are typed in.

You start a new session every time you quit and restart Maple. You can also start a new session without quitting by entering the command restart; Distinct from the Maple session is your worksheet, which is the set of typed commands and responses, along with text and graphics that you insert, which you see on the screen. The worksheet is what gets saved, and what gets printed out. The values of variables and

loaded packages ("with"s) are not saved in the worksheet!

When you reload a saved worksheet, Maple doesn't remember the variables you assigned or the packages you loaded (even though all that information is in the worksheet). To get back to where you were, simply hit the "Enter" key repeatedly until all the statements have been executed again. Some statements don't need to be re-executed, like plots that already appear in the worksheet. You can save time by skipping these. During a Maple session, you can refer to the output of your last (chronological) command with the percent sign %: > x:=34/13; x :=

> evalf(%);

Saving Worksheets

The first time you save your worksheet, or any time you want to change its name, use "Save As..." from the File menu. You will notice that the default filename, before you type anything in, is "*.mw" and it is highlighted. It is crucial that you always save files with a name ending in ".mw", like "prob1.mw". If the ".mw" is left off, Maple will put it in for you. Later, you can save changes to the worksheet using "Save" from the File menu. To get back to an old worksheet, start Maple by clicking on the Maple icon, then choose "Open.." from the File menu or just double-click on the worksheet you want to use. To start a new worksheet and session, choose "New" from the File menu.

"Maple doesn't seem to work..."

Sometimes, it seems like Maple is not accepting your commands, or at least is not executing them. There are several things we know of that can cause this:

1. Don't forget the semicolon ... if you type 2+3 then enter, Maple will warn you that

your statement was missing its semicolon and put the semicolon in where Maple "thinks" it should be, not necessarily where you want it. > 2+ Warning, inserted missing semicolon at end of statement, 2+3; 5

2. Syntax snafus -- If you are using "for" statements to make lists, or some other kind

of programming construction, sometimes you may begin a set of statements (e.g., with a " do" statement) and forget to end it. The simplest, most direct way to get out of this is to type something that you know will cause a syntax error so Maple will clear its memory and let you start a new statement. The phrase: > ;;;od;; Error, reserved word od unexpected almost always works.

3. Find that library! -- Some of Maple's specialized commands (for instance, for fancy

plotting, statistics, etc) are stored in libraries, and you must tell Maple explicitly to bring these commands into to the memory by using a "with" statement. This is described in the section of this book concerning Maple syntax. If Maple is just parroting your commands,