|
The Internet Economy
|
MTH 207 Lab Lesson 9Plotting Points and Limits
Plotting PointsOften data is given to us as a series of points rather than as a function. It would be useful to be able to plot sequences of points in Maple.Maple uses square brackets [ .. ] to represent ordered information. Thus an ordered pair (i.e a point in R2) in Maple is represented by a pair of numbers in square brackets. So [1, 2] represents the point with x coordinate 1 and y coordinate 2. We can plot a series of points by giving Maple and ordered set of
points. We can of can of course use any of the plot features discussed already, to specify an x or y plot range, a color, etc. By default plot joins the points up with straight lines. We can tell plot to
just plot the points with the optional style=point argument to
plot. The axes=box tells Maple to put the axes in a box on the
left hand side and bottom of the plot, this together with extending the range
makes the point at 0 easier to see. Plot the following sequence of points: SequencesWe have already seen how to use the sequence operator ($) to investigate the behviour of a function near a point. Note that in our previous investigation we only considered points approaching from the right. We can be a bit more creative in our definition of g and investigate both sides.> f := x -> x^2; > g := x -> ((-1)^x*10^(-x)); > evalf((f@g)(n)) $ n = 1..10; The (-1)^n alternates the sign of g. Another alternative is to run the original g twice, the second time with a minus sign. > f := x -> x^2; > g := x -> (1/x); > evalf((f@g)(n) $ n = 1..10); > evalf((f@(-g))(n) $ n = 1..10); It is useful to be able to plot these sequences, since this lets us see what
is going on more clearly. We can use the $ operator to generate a sequence of
ordered pairs: In fact this is more or less how Maple plots functions, in fact Maple avoids regularity in the space between points and peturbes each one by a random amount to avoid special 'bad' points. This seems to indicate that 1/x2 tends to infinity as x tends to 0 (i.e. 1/x2 has a vertical asymptote at 0). Of course no amount of plotting will ever allow us to be sure, to do that we must use conventional (algebraic) limit techniques. We can also use this type of technique to investigate what happens to a
function as x approaches infinity. Once again we must be careful, and not rely too heavily on these plots.
Consider the following:
LimitsMaple has the capability to evaluate simple limits using the limit function. The syntax islimit(expr, var = value) expr is the expression whose limit is to be evaluated. var = value is an equation, var is the variable whose limit is to be found. value is the value at which the limit is to be found. For example:
We also can tell Maple to take infinite limits We can also get Maple to compute left and right hand limits by using the
optional left or right arguments to
limit. Care must be taken when using the limit function in Maple as it often makes
mistakes. This is usually because Maple assumes that any variable may be complex
valued. Thus the following are incorrect: Why? Despite an amazing ability Maple cannot do everything. Try Maple tells us that this function must lie between -2 and 2 (the sum of two
sine functions). But now try This graph seems to indicate that f(x) is quite close to 0 at x = 0, despite
some serious wiggling! We could try to plot f on intervals closer and closer to
0. Notice how all of these plots look similar, even though each interval is contained in the previous one. In particular at the end points we seem to get f(x) = x. If this were true the squeeze theorem would tell us that the limit was zero, which is indeed the case.
Maintained by: P. Danziger, Febuary 1998 |