skip to content

Frequently Asked Questions: Calculus with Maple at NCSU

The colon and semi-colon

Does each Maple command line need to end with a colon or semi-colon?

The restart command

What does the restart command do in a Maple worksheet?

Can I use the restart command anywhere within a problem?

Adding packages

Do I need to load the plots package with "with(plots):" in each problem, or is it sufficient to just enter the command once in the worksheet?

I am having problems with MA 241/MA 242 Maple Homework #1. Is eGrader broken?

Adding Sections to a Worksheet

Can I add new sections to a Maple homework worksheet?

Assigning answers in a worksheet

The homework says to "assign my answer to the name ans1". How do I do this?

If I have assigned A to the number 5 and B to the number 6 and the worksheet instructs me to assign the value A + B to the name TheSum, do I assign TheSum to 11 or to A + B ?

Active memory in Maple

If I open a Maple worksheet that I have been working on, will the answers in the worksheet be in active memory immediately upon opening the worksheet?

The symbols for Pi

A Maple homework problem instructed me to compute the value of cos(p) and I entered cos(pi), but eGrader counted this as incorrect. What did I do wrong?

The symbol e

A Maple homework problem instructed me to compute the value of e^3 and I entered e^3, but eGrader counted this as incorrect. What did I do wrong?

Maple's Scientific Notation

What does the notation .17e-6 mean in a Maple worksheet?


Q: Does each Maple command line need to end with a colon or semi-colon?

A: Yes! When you press the enter key with the cursor anywhere in a command line in a Maple worksheet, Maple will issue the error message "Warning, premature end of input" if the line does not end in a colon or semi-colon. You should think of the colon or semi-colon as your way of telling Maple to ' go ahead and compute'. The only exception to this rule is that a line that begins with a question mark "?" need not end with a colon or semi-colon.

If you do not end a command line with a colon or semi-colon then the commands in that line DO NOT get executed. Hence if you do not end a command line containing an answer assignment with a colon or semi-colon then your answer will be counted wrong. For example if your worksheet contains the lines

|> answer1:= 256

Warning, premature end of input

then answer1 will be counted wrong. This is because eGrader will execute your worksheet and then look to compare the value of your answer1 with the correct value of answer1. If your worksheet contains the above lines then eGrader will find that answer1 is NOT assigned to anything in your worksheet for this problem, and thus your grade will be zero for answer1.

ˆtop

Q: What does the restart command do in a Maple worksheet?

A: When you enter and execute commands in a Maple worksheet, that information is stored in active memory as long as two things do NOT happen. When you close a Maple worksheet all information in RAM and swap memory is lost, but of course the material remains encoded in your worksheet. Similarly, when you issue the restart command in a Maple worksheet, Maple restarts the Maple session, and in particular removes all assignments from active memory. It it a good idea to put the restart command as the first line in each of your problems. In this way if you are working on problem 3, say, then the assignments you made in problems 1 and 2 will not interfere with your work.

ˆtop

Q: Can I use the restart command anywhere within a problem?

A: A definite NO to this question! You may only use the restart command in the first line of each problem. The reason for this is simple. When you issue a restart, all assignments in the worksheet are removed from active memory. Thus if you assign answer1 to the value 5 and then execute a restart command, then answer1 will no longer be assigned to the value 5, as indicated below by the return of the name answer1 instead of the value 5 after the restart command has been executed:

|> answer1:= 5;

5

|> answer1;

5

|> restart;

|> answer1;

answer1

When eGrader grades your worksheet, it first executes your work, and then compares the names in the worksheet with the correct values. For our hypothetical problem here, eGrader would check to see if the name answer1 has been assigned to the number 5. In this case eGrader would mark a zero for the grade because answer1 is not assigned to anything when eGrader executes its grading code at the end of the student's work on the problem.

ˆtop

Q: Do I need to load the plots package with "with(plots):" in each problem, or is it sufficient to just enter the command once in the worksheet?

A: Yes again, to the first part of your question! eGrader grades each problem separately, and it accomplishes this by issuing a restart command just prior to executing the student's work in each problem. This restart command is used to separate the problems into stand alone pieces. So if you need plots in both problems 2 and 4, you'll need to issue the "with(plots):" command at the beginning of each problem.

ˆtop

Q: I am having problems with MA 241/MA 242 Maple Homework #1. Is eGrader broken?

Many students have written to MapleGrader and Mr. Maple about problems they have had with MA 241/MA 242 Maple Homework #1. Unfortunately almost all of those problems could have been avoided if the students had read the instructions at the top of the Homework worksheet. In particular I want to draw your attention to the last bulleted item in the instructions at the top of the worksheet. It tells you that you must:

Load all the packages you need for each and every problem in the worksheet!

Specifically, you cannot expect eGrader to look at your work in problem 2 for the plots package when eGrader is grading problem 7. If you need the plots package in Problems 2 and 7, then load plots at the beginning of each of those problems.

Each problem is considered by eGrader to be completely independent of the other problems in the worksheet, so load the packages you need for each problem using Maple's "with" command.

ˆtop

Q: Can I add new sections to a Maple homework worksheet?

A: A definite NO to this question. eGrader knows precisely how many problems there should be in your homework worksheet when it is ready to grade your paper. Each problem is contained within a Maple "section", which is a text unit that is contained within an area marked with a box that shows either a + or - sign. The section is closed, with the text invisible, if the + sign appears in the box. Selecting the box with the cursor and a click will unfold the section and a - sign will appear in the box. If you add more sections to your worksheet, eGrader will assume that there are more problems than there should be, and therefore cannot grade your paper. So, do NOT add, or subtract, sections from the preformatted worksheet.

ˆtop

Q: The homework says to "assign my answer to the name ans1". How do I do this?

A: eGrader needs to know what your answers are, so in the statement of each problem you will be told to "assign your answer to" appropriate names. One does this with Maple's assignment operator, which is a colon followed by the equality symbol =. Thus, for example, to assign the number 5 to the name ans1 one would enter the following in the Maple worksheet:

|> ans1:= 5;

5

Once you have entered this into a Maple worksheet Maple will understand that ans1 now represents 5. If you enter ans1 in a command line and press Enter, Maple will reply with 5 rather than ans1 because you have "assigned ans1 to the number 5".

|> ans1:

5

The only ways to remove this assignment are to enter a restart command, use Maple’s unassign command, or close the Maple worksheet.

ˆtop

Q: If I have assigned A to the number 5 and B to the number 6 and the worksheet instructs me to assign the value A + B to the name TheSum, do I assign TheSum to 11 or to A + B?

A: The answer is that you can use either of the two forms of the answer that you have suggested. The reason is that once you have assigned A and B, then A + B is assigned to the sum of A + B, which is 11. Thus a correct set of responses would be

|> A:= 5;

5

|> B:= 6;

6

|> TheSum:= 11;

11

or you may enter

|> A:= 5;

5

|> B:= 6;

6

|> TheSum:= A + B;

11

eGrader will consider both answers as correct.

ˆtop

Q: If I open a Maple worksheet that I have been working on, will the answers in the worksheet be in active memory immediately upon opening the worksheet?

A: The answer here is NO. You'll need to execute the commands in the material that you have already worked on if you want the assignments you have made to be in active memory. So if you stopped working halfway through problem 5, when you start working again after opening the worksheet you'll need to execute the commands you have already entered for problem 5. Once you've executed those commands, any assignments you have made will again be available for the rest of the work on problem 5.

ˆtop

Q: A Maple homework problem instructed me to compute the value of cos(p) and I entered cos(pi), but eGrader counted this as incorrect. What did I do wrong?

A: Maple is very particular about a few symbols and you have encountered one of them. You must use Pi for p and not pi. Both symbols, when executed in a Maple worksheet command line, will produce the "symbol" p, but only Pi will evaluate to the correct number. The notation pi will only evaluate to a symbol and not a number, so always be careful which symbol you use.

Similarly you must use exp(1) for the number e that satisfies ln(e) = 1. Thus in a Maple worksheet you would see

|>ln(exp(1));

1

which is correct. However notice that by using e^1 does not evaluate correctly.

|>ln(e^1));

ln(e);

Thus DO NOT use e^1 if you want the number e, but DO use exp(1), the value of the exponential function x --> exp(x) at x = 1.

ˆtop

Q: A Maple homework problem instructed me to compute the value of e^3 and I entered e^3, but eGrader counted this as incorrect. What did I do wrong?

A: Maple is very particular about a few symbols and you have encountered one of them. You must use exp(1) for the number e that satisfies ln(e) = 1. Thus in a Maple worksheet you would see

|>ln(exp(1));

1

which is correct. However notice that e^1 does not evaluate correctly.

|>ln(e^1));

ln(e);

Similarly you must use Pi for the number p and not pi. Thus in a Maple worksheet you would see

|>sin(Pi/2);

1

which is correct. However notice that pi does not evaluate correctly:

|>sin(pi/2);

sin(pi/2)

because pi only evaluates to the "symbol" p.

ˆtop

Q: What does the notation .17e-6 mean in a Maple worksheet?

A: This is Maple's "standard math input" notation. The symbol .17e-6 is the same as .17*10^(-6). The lower case letter e in the symbol .17e-6 stands for "exponent" and denotes the exponential function base 10. A large number, for example 145*10^9 can be written in Maple's standard math input in the form .145e12.

ˆtop