COMP203: Lecture 18


Syllabus | Homework and Assignments | Grading Rubric | Midterm Exam | Final Project

Range of Values

In Maple, the range of values between two numbers x and y is indicated by x..y. Ranges occur in many contexts in Maple; to know exactly how Maple will interpret the range you must study the context. Here are a few examples:

The instruction seq(n, n=2..4); produces the sequence 2, 3, 4.

If the list [2, 4, 6, 8, 10] is stored in variable A, then A[2..4] indicates the list [4, 6, 8].

The command plot(x2 - 4*x + 4, x=2..4); displays the graph of the function x2 - 4*x + 4 over the interval [2, 4].

"Silent Running"

For implicit and three dimensional plots (and for the packages you'll be presenting during the final exam period), we must load a package into Maple. This is a little bit like installing a plugin in a web browser, except that you must load the package every time you wish to use those functions. To load the plots package you can use the command with(plots) or you can use the Load Package option in the Tools menu.

If you enter with(plots) or with(plots); at the Maple prompt you will see a list of all the functions loaded by that instruction. If you instead enter with(plots): or use the Tools menu you will be spared the list. This is one reason why you would want to end a command with a : to suppress its output.

Range in implicitplot

You have seen that (when the plots package is loaded into Maple) the command implicitplot(x2 + y2 = 1, x=-2..2, y=-2..2); displays a circle. Suppose you wanted to "zoom out" from this circle. The obvious thing to try is: implicitplot(x2 + y2 = 1, x=0..4, y=0..4); but that doesn't help.

Maple uses the range given to the implicitplot function to determine where to search for the graph of the function. Once it has "found" the graph it ignores the range it was given and chooses a range that fits the points it found. See me if you want to display an implicit plot using some range other than Maple's default.