Download mathematics 201-nya-05

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
Transcript
MATHEMATICS 201-BNK-05
Advanced Calculus
Martin Huard
Winter 2007
Graphing with Maple
Curves in \ 2
To graph curves given by a vector function in \ 2 with Maple, we use the command plot([ x(t),
G
y(t), t=a..b],options). For example, the curve r ( t ) = ( t 2 − 1, t 3 ) is plotted with.
> plot( [ t^2-1,t^3, t=-2..2 ]);
To graph a curve given as a relation, we have the command implicitplot(equation, domain,
range, options) from the plots library (which must be loaded fist). In the options you may want
to ask Maple to use more points with numpoints=1000, for example, if the picture of the graph
2
is not very good. For example, plotting the ellipse x 2 + y4 = 1 ;
> with(plots):
> implicitplot( x^2+y^2/4=1, x=-1..1, y=-2..2,scaling=constrained);
Note that the option scaling=constrained was used so that the x- and y-axis have the same scale.
Curves in \ 3
For curves in \3 , we use command spacecurve( [ x(t), y(t), z(t)], t=a...b, options) from the plots
library. You may want to add the option axes=normal to see the coordinate axes. For example,
G
to plot the helix r ( t ) = ( cos t ,sin t , t ) , we have
> with(plots);
> spacecurve([cos(t),sin(t),t],t=-Pi..5*Pi, axes=normal);
You can rotate the picture with your mouse to obtain different views.
For more than one plot, start by entering each curve individually (using “:” at the end not to have
the output) and then use the command display (from the plots library). For example, plotting the
helix with its tangent line at t = 34π .
> curve:=spacecurve( [cos(t), sin(t), t], t=-Pi..5*Pi, axes=normal):
tangent:=spacecurve([ -sqrt(2)/2-t*sqrt(2), sqrt(2)/2-t*sqrt(2), 3*Pi/4+2*t], t=-1..1):
> display( curve, tangent);
To graph some vectors along a curve, we use the command arrow( u, v, options): where u is the
base point of the vector, and v the direction. For example, graphing the tangent vector to the
helix at t = π2 ,
> curve:=spacecurve([cos(t),sin(t),t],t=-Pi..5*Pi, axes=normal):
tangentvect:=arrow(<0,1,Pi/2>, <-1,0,1>, color=blue):
> display(curve,tangentvect);
Math BNK
Maple Graphing
Surfaces in \ 3
If a surface is given as a function z = f ( x, y ) , then you can use the command plot3d(function,
x-domain, y-domain, options). For example, to plot the elliptic parabloid z = x 2 + y 2 ,
> plot3d( x^2+y^2, x=-2..2, y=-2..2 ,axes=normal);
If the curve is given implicitely, then use the command implicitplot3d(equation, x-domain, ydomain, z-domain, options) from the plots library. For example, the hyperbloid of one sheet
x2 + y 2 − z 2 = 1
> implicitplot3d( x^2+y^2-z^2=1,x=-2..2,y=-2..2,z=-2..2,axes=normal);
To plot level curves, we use the options style=contour and orientation=[-90,0] in the 3-d
graphing. For example, the level curves for the hyperbolid parabloid z = x 2 − y 2 , we have
> plot3d(x^2-y^2, x=-2..2, y=-2..2, style=contour, orientation=[-90,0]);
We can also use the command contourplot(function, x-doamin, y-domain, options) from the
plots library.
> contourplot(x^2-y^2, x=-2..2, y=-2..2);
For surfaces that are defined parametrically, we use the command plot3d([ x(t,s), y(t,s), z(t,s)], sdomain, t-domain, options). For example, plotting the doughnut given by
⎧ x = cos ( t ) ( 3 + cos ( s ) )
⎪⎪
⎨ y = sin ( t ) ( 2 + cos ( s ) )
⎪
⎪⎩ z = sin ( s )
> plot3d([cos(t)*(3+cos(s)),sin(t)*(3+cos(s)),sin(s)], s=-Pi..Pi, t=-Pi..Pi, scaling=constrained);
Curves with Surfaces
To sketch a curve on a surface, this can be done in the usual way for multiplots. To make it
more readable, you might use the options color=blue and thickness=2, for example, to make the
curve more explicit. For example, plotting the surface z = x 2 + y 2 with the curve (on the
G
surface) r ( t ) = ( cos t , 2sin t + 1, 4sin t + 5) ,
> surface:=plot3d(x^2+y^2,x=-3..3,y=-3..3):
curve:=spacecurve([2*cos(t), 2*sin(t)+1, 4*sin(t)+5], t=0..2*Pi, color=blue, thickness=2):
> display(surface,curve);
Alternatively, you can use the option style=wireframe for the surface. This is quite useful if
you are plotting more than one surface.
Winter 2007
Martin Huard
2