Mutivariate Calculus with Matrices, Math 2720
Warm-Up to Maple
The purpose of this notebook is to meet Maple for the first time and try to get a little acquainted with its graphing capabilities.
This notebook has a number of sections. The last section contains a quiz. The main purpose is to learn the most useful graphing commands and their syntax. Thus, you should be able to work the quiz by studying the examples in the preceeding sections. This is an open-communication quiz, meaning that you may ask anyone (including your instructor, but especially your partner) for help at any time. Doing some simple computations.Here is how one does addition. Enter "3+4;" and hit the enter key. LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYoLUkjbW5HRiQ2KVEiM0YnLyUnZmFtaWx5R1ErTW9ub3NwYWNlZEYnLyUlYm9sZEdRJXRydWVGJy8lK2ZvcmVncm91bmRHUSpbMjU1LDAsMF1GJy8lMGZvbnRfc3R5bGVfbmFtZUdRLE1hcGxlfklucHV0RicvJSxtYXRodmFyaWFudEdRJWJvbGRGJy8lK2ZvbnR3ZWlnaHRHRj0tSSNtb0dGJDYvUScmcGx1cztGJ0Y1RjgvRjxRJ25vcm1hbEYnLyUmZmVuY2VHUSZmYWxzZUYnLyUqc2VwYXJhdG9yR0ZILyUpc3RyZXRjaHlHRkgvJSpzeW1tZXRyaWNHRkgvJShsYXJnZW9wR0ZILyUubW92YWJsZWxpbWl0c0dGSC8lJ2FjY2VudEdGSC8lJ2xzcGFjZUdRLDAuMjIyMjIyMmVtRicvJSdyc3BhY2VHRlctRiw2KVEiNEYnRi9GMkY1RjhGO0Y+LUZBNi9RIjtGJ0Y1RjhGREZGL0ZKRjRGS0ZNRk9GUUZTL0ZWUSYwLjBlbUYnL0ZZUSwwLjI3Nzc3NzhlbUYnLyUrZXhlY3V0YWJsZUdGSEZEIf you want to suppress output, use a colon instead of a semicolon.To store a quantity in a named location use ":=". Here 10! is stored in LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYkLUkjbWlHRiQ2JVEiYUYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy9GM1Enbm9ybWFsRic=.a := 10!;It is best to write out multiplication explicitly.a := 3;
b := 4;
5*a;
a*b;Note that the semicolon is required in multiline computations. Most of the standard functions are accessed in the same manner as on a calculator.Here are sin and cos of 1.1. (In this case a <shift><enter> was used to put theexpressions on different lines.)LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYrLUkjbWlHRiQ2KlEkc2luRicvJSdmYW1pbHlHUStNb25vc3BhY2VkRicvJSVib2xkR1EldHJ1ZUYnLyUnaXRhbGljR1EmZmFsc2VGJy8lK2ZvcmVncm91bmRHUSpbMjU1LDAsMF1GJy8lMGZvbnRfc3R5bGVfbmFtZUdRLE1hcGxlfklucHV0RicvJSxtYXRodmFyaWFudEdRJWJvbGRGJy8lK2ZvbnR3ZWlnaHRHRkAtSShtZmVuY2VkR0YkNictRiM2JS1JI21uR0YkNilRJDEuMUYnRi9GMkY4RjtGPkZBLyUrZXhlY3V0YWJsZUdGNy9GP1Enbm9ybWFsRidGL0Y4RjtGTi1JI21vR0YkNjJRIjtGJ0YvRjJGOEY7Rj5GQS8lJmZlbmNlR0Y3LyUqc2VwYXJhdG9yR0Y0LyUpc3RyZXRjaHlHRjcvJSpzeW1tZXRyaWNHRjcvJShsYXJnZW9wR0Y3LyUubW92YWJsZWxpbWl0c0dGNy8lJ2FjY2VudEdGNy8lJ2xzcGFjZUdRJjAuMGVtRicvJSdyc3BhY2VHUSwwLjI3Nzc3NzhlbUYnLUknbXNwYWNlR0YkNiYvJSdoZWlnaHRHUSYwLjBleEYnLyUmd2lkdGhHRl5vLyUmZGVwdGhHRmdvLyUqbGluZWJyZWFrR1EobmV3bGluZUYnLUYsNipRJGNvc0YnRi9GMkY1RjhGO0Y+RkFGQy1GUTYwRlNGL0Y4RjtGTkZURlZGWEZaRmZuRmhuRmpuRlxvRl9vRkxGTg==The exponential function is exp(x) and the constant pi is in Pi.Warning! You cannot use "e^x" for the exponential function or "pi" for the value of pi.sin(pi);
sin(Pi);
e^2.;
exp(2.);One can use the evalf command to evaluation an expression numerically. Here are a couple examples. a := cos(2);
evalf(a);
evalf(a,5);
b := exp(2);
evalf(b);Plots of single-valued functionsHere are some standard plots of single-variable functions.
Notice how the function and domain are specified.
plot(sin(x),x=-Pi..3*Pi);
There are many different options for plotting. In this case, "constrained" means that both the x- and y-axes have the same scaling factor.
plot(sin(x),x=-Pi..3*Pi,scaling=constrained);
One may plot functions simultaneously. Here, three colors are used to distinguish between the three graphs.
plot([sin(x),x-x^3/6,x-x^3/6+x^5/120],x=-Pi..Pi,color=[red,blue,green]);Single-valued functions of two variables (surfaces)Here are some examples of 3-dimensional graphs of functions of two variables. The two commands featured here are "plot3d" and "contourplot3d". They both generate 3-dimensional models of graphs of functions, but they differ in that plot3d gives vertical cross-sections whereas countourplot3d gives horizontal cross sections. Notice that the use of these commands requires the package "plots".
For each of these, try to imagine what shape the command will generate before you execute:
with(plots):
plot3d(x^2+y^2,x=-5..5,y=-5..5);
contourplot3d(x^2-y^2,x=-5..5,y=-5..5,
contours=20,filled=true,coloring=[blue,green]);plot3d([x^2+y^2,20],x=-5..5,y=-5..5,color=[red,blue]);plot3d(1/(x^2+y^2+1),x=-5..5,y=-5..5);plot3d(sin(x)+sin(y),x=-7..7,y=-7..7,numpoints=1000);contourplot3d(sin(x)+sin(y),x=-7..7,y=-7..7,
numpoints=1000,color=blue,thickness=2,contours=15);plot3d(cos(x*y),x=-4..4,y=-4..4,numpoints=1000);
Here is an example of a plot in cylindrical coordinates.
plot3d(z,theta=0..2*Pi,z=-2..2,
coords=cylindrical,axes=normal,style=patch);The QuizFor each of the following, write a single-line command which will generate the specified shape. The answers are not unique. (You can check your command by executing it!) Write your answers in a new file and include the name(s) of your team-mates. You may print your quiz if it will fit on a single page.
(a) A parabola (in two dimensions).(b) A hyperbola (in two dimensions).
(c) 3-dimensional plot ("plot3d") of a union of two planes which intersect in a line.
(d) 3-dimensional plot ("plot3d") of a hyperboloid of one sheet. (This requires a plot of two functions simultaneously.)