ROV19_6.MWS

Part 4. Surfaces with MAPLE

Chapter 19. Surfaces in Space

Rovenski Vladimir, Haifa

> restart:

19.2 Regular Parametrized Surface

Exercise s.

1. Prove that the vector-valued function

(a) r = [Maple Math] is the [Maple Math] -regular parametrization of the paraboloid [Maple Math] ,

What are the coordinate curves of these parametrizations? Solution . (a) First check the regularity condition (b)

> r:=[u+v, u-v, u^2+v^2]:

> ru:=diff(r,u): rv:=diff(r,v): linalg[crossprod](ru,rv); # we obtain a nonzero vector.

[Maple Math]

Then substitute the vector-valued function in the explicit equation:

> r1:=simplify(subs({x=u+v, y=u-v, z=u^2+v^2},z-(x^2+y^2)/2));

[Maple Math]

2. Find which of the following surfaces are compact, and plot them using the command implicitplot3d

(see Section 19.3.2) (a) x^2-y^4+z^6= 1, (b) x^2-2x+y^2+z^4= 1, (c) x^2+y^2z^2= 1, (d) x^2+y^4+z^6= 1.

> plots[implicitplot3d](x^2+y^4+z^6=1, x=-2..2, y=-2..2, z=-2..2, axes=boxed); # etc.

[Maple Plot]

>

19.3 Methods of Generating Surfaces

19.3.2 Methods of Generating Surfaces

The coordinate systems

> plots[coordplot3d](cylindrical, style=`PATCH`);

[Maple Plot]

> plots[coordplot3d](spherical, style=`PATCH`); # etc.

[Maple Plot]

>

Plot graphs of functions in two variables using the command plot3d .

> plot3d(sin(x)*cos(y), x=-Pi..Pi, y=-Pi..Pi, axes=boxed);

[Maple Plot]

> plot3d(x^2+y^2, x=-3..3, y=-sqrt(9-x^2)..sqrt(9-x^2), axes=boxed);

[Maple Plot]

> plot3d(x^2-y^2, x=-3..3, y=-3..3, axes=boxed);

[Maple Plot]

Plot level curves of these functions using the command contourplot

> plots[contourplot](x^2+y^2, x=-3..3, y=-3..3);

[Maple Plot]

> plots[contourplot](sin(x)*cos(y), x=-Pi..Pi, y=-Pi..Pi);

[Maple Plot]

> plots[contourplot](x^2-y^2, x=-3..3, y=-3..3);

[Maple Plot]

>

An implicitly given surface can be visualized using the command implicitplot3d , but this method is coarse,

as can be seen from the example of the cone x^2+y^2-z^2= 0.

> plots[implicitplot3d](x^2+y^2-z^2=0, x=-3..3, y=-3..3,z=-5..5, style=patchcontour, orientation=[40,80], axes=boxed);

[Maple Plot]

Starting with parametric equations, we plot both (up and down) sheets of a cone using plot3d and display3d .

> r:=[u*cos(v), u*sin(v), u]:

> P1:=plot3d(r, u=0..3, v=0..2*Pi, axes=framed): %;

[Maple Plot]

> P2:=plot3d(r, u=-3..0, v=0..2*Pi, axes=framed): %;

[Maple Plot]

> plots[display3d]({P1, P2}, style=patchcontour, orientation=[45,75], axes=framed);

[Maple Plot]

>

Plot the hyperboloid of one sheet using the above program with

> S := signum(u)*sqrt(u^2+1): r := [S*cos(v), S*sin(v), u]:

> P1:=plot3d(r, u=0..3, v=0..2*Pi): P2:=plot3d(r, u=-3..0, v=0..2*Pi): plots[display3d]({P1, P2}, style=patchcontour, orientation=[45,75], axes=framed);

[Maple Plot]

Plot graphs for complex expressions using the command complexplot3d

> plots[complexplot3d](GAMMA(z), z= -Pi-Pi*I..Pi+Pi*I,view=0..5, grid=[30,30], orientation=[-120,45],axes=frame, style=patchcontour, thickness=2);

[Maple Plot]

Example 1 . For the function [Maple Math] the gradient nabla F= [Maple Math] is zero only at the point O(0,0,0),

> linalg[grad](x^2+y^2+z^2, [x,y,z]);

[Maple Math]

>

The function wind chill factor }

> restart: with(plots):

Warning, existing definition for changecoords has been overwritten

> L := [[[5,35,32],[10,35,22],[15,35,16],[20,35,12],[25,35,8],
[30,35,6],[35,35,4],[40,35,3],[45,35,2]],[[5,30,27],[10,30,16],
[15,30,9],[20,30,4],[25,30,1],[30,30,-2],[35,30,-4],[40,30,-5], [45,30,-6]],
[[5,25,22],[10,25,10], [15,25,2], [20,25,-3],[25,25,-7],[30,25,-10],
[35,25,-12],[40,25,-13],[45,25,-14]],[[5,20,16],[10,20,3],[15,20,-5],
[20,10,-24],[25,10,-29],[30,10,-33],[35,10,-35],[40,10,-37],[45,10,-38]],
[[5,15,11],[10,15,-3],[15,15,-11], [20,15,-17],[25,15,-22],[30,15,-25],
[35,15,-27],[40,15,-29],[45,15,-30]],[[5,10,6],[10,10,-9],[15,10,-18],
[20,10,-24],[25,10,-29],[30,10,-33],[35,10,-35],[40,10,-37],[45,10,-38]],
[[5,5,0],[10,5,-15],[15,5,-25],[20,5,-31],[25,5,-36],[30,5,-41],[35,5,-43],
[40,5,-45],[45,5,-46]],[[5,0,-5],[10,0,-22],[15,0,-31],[20,0,-39],
[25,0,-44],[30,0,-49],[35,0,-52],[40,0,-53] ,[45,0,-54]],[[5,-5,-10],
[10,-5,-27],[15,-5,-38],[20,-5,-46],[25,-5,-51], [30,-5,-56],[35,-5,-58],
[40,-5,-60], [45,-5,-62]],[[5,-10,-15],[10,-10,-34],[15,-10,-45],[20,-10,-53],
[25,-10,-59],[30,-10,-64],[35,-10,-67],[40,-10,-69],[45,-10,-70]]]:

> P1:=surfdata(L): P2:=plot3d(-20, x=5..45, y=-10..35):

> display3d({P1,P2} ,style=PATCHCONTOUR,labels=[W,T,WC], axes=boxed);

[Maple Plot]

>

The commands listplot3d and matrixplot

> listplot3d([seq([seq(sin((i-15)*(j-10)/Pi/20), i=1..30)], j=1..20)], axes=framed);

[Maple Plot]

>

> with(linalg): A:=hilbert(6): B:=toeplitz([1,2,3,-3,-2,-1]):

Warning, protected name norm has been changed and unprotected

Warning, protected name trace has been changed and unprotected

> matrixplot(A+B, heights=histogram, gap=0.25, style=patch,axes=framed);

[Maple Plot]

>

19.4 Tangent Planes and Normal Vectors

19.4.1 Main Equations and Properties

Plot the tangent plane to the surface graph using the following program:

> f:=x^2+y^2: # use any function f(x,y)

> fx:=diff(f,x); fy:=diff(f,y);

[Maple Math]

[Maple Math]

> TM:=f+fx*(u-x)+fy*(v-y); # any tangent plane

[Maple Math]

> TMP:=subs({x=1, y=2}, TM); # tangent plane at P

[Maple Math]

> p1:=plot3d(f, x=-sqrt(16-y^2)..sqrt(16-y^2), y=-4..4): p2:=plot3d(TMP, u=-1..4, v=-1..3,color=green):

> plots[display3d]({p1, p2}, axes=framed);

[Maple Plot]

>

5. Prove that the tangent planes of the surface xyz= [Maple Math] form tetrahedra of constant volume

with the three coordinate planes.

Solution . Denote by TM the tangent plane at the point (x,y,z) on the surface.

Let [Maple Math] be the segments of the intersection of TM with the coordinate axes:

> F:=x*y*z-a^3; gr:=linalg[grad](F, [x,y,z]);

[Maple Math]

[Maple Math]

> TM:=linalg[dotprod](gr, [xx-x, yy-y, zz-z], 'orthogonal');

[Maple Math]

> x1:=solve(subs({yy=0, zz=0}, TM), xx);

[Maple Math]

> y1:=solve(subs({xx=0, zz=0} ,TM), yy);

[Maple Math]

> z1:=solve(subs({yy=0, xx=0}, TM), zz);

[Maple Math]

> V:=subs(z=a^3/(x*y), x1*y1*z1);

[Maple Math]

>

The volume V= 27 [Maple Math] does not depend on the point on the surface.

19.4.2 Extrema of Functions Defined on Surfaces

Problem 1. Find the local extrema of the function [Maple Math] .

Solution . First plot the graph and the chart of level curves of f:

> f:=(x,y) -> 3*x^2*y-x^3-y^4;

[Maple Math]

> plot3d(f(x,y), x=-6..10, y=-4..5, axes=framed);

[Maple Plot]

> plots[contourplot](f(x,y), x=-6..10, y=-4..5, contours=35);

[Maple Plot]

Then calculate the partial derivatives f'_x, f'_y

> fx:=diff(f(x,y), x); fy:=diff(f(x,y), y);

[Maple Math]

[Maple Math]

and finally solve the system f'_x= 0, f'_y= 0

> sol:=solve({fx=0, fy=0}, {x, y});

[Maple Math]

Two points are possible extrema: P_1(0,0) and P_2(6,3).

Calculate second partial derivatives of the given function and the term D

> fxx:=diff(fx, x); fxy:=diff(fx, y); fyy:=diff(fy, y); Delta:=fxx*fyy-fxy^2;

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

At the point P_1 we have

> subs({x=0, y=0}, [fxx, fxy, fyy, Delta]);

[Maple Math]

>

Since a_{11}=0, a_{12}=0, a_{22}=0 hold, then D=0 and the point P_1 requires additional investigation.

Problem 2 . Find the dimensions of the cuboid of largest volume that can be fitted inside the ellipsoid

[Maple Math] assuming that each edge is parallel to a coordinate axis.

Solution .

> restart: with(linalg): V:=8*x*y*z: F:=x^2/a^2+y^2/b^2+z^2/c^2:

Warning, protected name norm has been changed and unprotected

Warning, protected name trace has been changed and unprotected

> GradV:=grad(V, [x,y,z]); GradF:=grad(F, [x,y,z]);

[Maple Math]

[Maple Math]

> sol:=solve({F=1, seq(GradV[i]=lambda*GradF[i], i=1..3)}, {x,y,z,lambda});

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

> allvalues(RootOf(3*_Z^2-1));

[Maple Math]

> x0:=allvalues(RootOf(3*_Z^2- 1))[1]*a; y0:=allvalues(RootOf(3*_Z^2-1))[1]*b; z0:=allvalues(RootOf(3*_Z^2- 1))[1]*c;

[Maple Math]

[Maple Math]

[Maple Math]

> V0:=subs({x=x0, y=y0, z=z0}, V); subs({x=x0, y=y0, z=z0}, F);

[Maple Math]

[Maple Math]

>

Conclusion : The maximal cuboid has edges x_0= y_0= z_0= 1/ [Maple Math] and the volume V_0= 8 [Maple Math] /9 abc.

Exercises .

1. Find local extrema of the function [Maple Math] .

Solution .

> f:=(x,y) -> x^3/3+9*y^3-4*x*y;

[Maple Math]

> plot3d(f(x,y), x=-1..2, y=-0.5..1, axes=boxed);

[Maple Plot]

> plots[contourplot](f(x,y), x=-1..2, y=-0.5..1, contours=35);

[Maple Plot]

> fx:=diff(f(x,y), x); fy:=diff(f(x,y), y);

[Maple Math]

[Maple Math]

> sol:=solve({fx=0, fy=0}, {x, y});

[Maple Math]

> fxx:=diff(fx,x); fyy:=diff(fy,y); fxy:=diff(fx,y); Delta:=fxx*fyy-fxy^2;

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

> subs(sol[1], [fxx,Delta,f(x,y)]);

[Maple Math]

> subs(sol[2], [fxx,Delta,f(x,y)]);

[Maple Math]

>

Conclusion : The function has the minimum f_{min= -{64}/{81} at P_1(4/3, 4/9); the point P_2(0,0) is a saddle.

19.5 Osculating Paraboloid and Type of a Smooth Point

19.5.1 Properties of the Osculating Paraboloid

Find k_1 and k_2 as roots of the characteristic polynomial:

> sol:=solve((a11-t)*(a22-t)-a12*a12, t):

> k1:=sol[1]; k2:=sol[2];

[Maple Math]

[Maple Math]

>

The first three cases are general. In the last two cases F is a paraboloid of revolution or a plane.

Plot examples of surfaces with P=O of the above types:

> plot3d(x^2+9*y^2, x=-.1...1, y=-.1...1, axes=boxed);

[Maple Plot]

> plot3d(x^2-y^2, x=-1..1, y=-1..1, axes=boxed);

[Maple Plot]

> plot3d(-x^2+y^7, x=-1..1, y=-1..1, axes=boxed);

[Maple Plot]

> plot3d(x^2+y^2, x=-1..1, y=-1..1, axes=boxed);

[Maple Plot]

> plot3d(-x^7-y^6, x=-1..1, y=-1..1, axes=boxed);

[Maple Plot]

>

19.5.2 Program for Plotting an Osculating Paraboloid

(1) Parallel translation along the vector PO congruently moves the surface M and the paraboloid S into a surface

M_1; with osculating paraboloid S_1 at the origin.

> restart: with(linalg): f:=a*x^2+b*y^2; a:=1; b:=2; # assume(a>0,b>0):

Warning, protected name norm has been changed and unprotected

Warning, protected name trace has been changed and unprotected

[Maple Math]

[Maple Math]

[Maple Math]

> x0:=1: y0:=0: z0:=subs({x=x0, y=y0}, f); f1:=simplify(subs({x=x+x0, y=y+y0}, f)-z0); # point on the surface

[Maple Math]

[Maple Math]

(2)

> n:=[subs({x=0, y=0}, -diff(f1, x)), subs({x=0, y=0}, -diff(f1,y)), 1]; # normal vector

[Maple Math]

> d1:=sqrt(n[2]^2+n[3]^2); d:=sqrt(n[1]^2+n[2]^2+n[3]^2);

[Maple Math]

[Maple Math]

> Rx:= matrix([[1,0,0], [0,n[3]/d1, n[2]/d1], [0,-n[2]/d1, n[3]/d1]]);

[Maple Math]

(b)

> Ry:=matrix([[d1/d,0,n[1]/d], [0,1,0], [-n[1]/d,0,d1/d]]);

[Maple Math]

> R:=multiply(Rx, Ry); n3:=multiply(n, R); # checking n_3 || OZ

[Maple Math]

[Maple Math]

> coor:=multiply([x1, y1, z1], transpose(R));

[Maple Math]

> g:=collect(coor[3]-(subs({x=coor[1], y=coor[2]}, f1)), [x1,y1,z1]); subs({x1=0, y1=0, z1=0}, grad(g, [x1,y1,z1])); # new equation # checking n_3 || OZ

[Maple Math]

[Maple Math]

> # readlib(coeftayl): readlib(mtaylor):

> mtaylor(g, [x1=0, y1=0, z1=0], 3);

[Maple Math]

> gz:= coeftayl(g, [x1,y1,z1]=[0,0,0], [0,0,1]); gxx:=coeftayl(g, [x1,y1,z1]=[0,0,0], [2,0,0]); gyy:=coeftayl(g, [x1,y1,z1]=[0,0,0], [0,2,0]); gxy:=coeftayl(g, [x1,y1,z1]=[0,0,0], [1,1,0]);

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

> a11:=evalf(-gxx/(2*gz)); a12:=evalf(-gxy/(2*gz)); a22:=evalf(-gyy/(2*gz));

[Maple Math]

[Maple Math]

[Maple Math]

The equation (19.7) of S_3

> S3:=a11*x1^2+2*a12*x1*y1+a22*y1^2;

[Maple Math]

Coefficients k_1 and k_2

> sol:=solve((a11-t)*(a22-t)-a12*a12,t): k1:=sol[1]; k2:=sol[2];

[Maple Math]

[Maple Math]

> Scan:=k1*x^2+k2*y^2; # canonical equation of S

[Maple Math]

Plot M_3 and S_3 (in new coordinates),

> plots[implicitplot3d]({g=0, S3=z1}, x1=-2..1.4, y1=-1..1, z1=-0.2..1, axes=boxed, grid=[20,20,20]);

[Maple Plot]

(4)

> co1:=multiply([x,y,z], R);

[Maple Math]

> S1:=simplify(subs({x1=co1[1], y1=co1[2], z1=co1[3]}, z1-S3));

[Maple Math]

Plot M_1 and S_1 (in old coordinates),

> plots[implicitplot3d]({z=f1, S1=0}, x=-2..1, y=-1..1, z=-1..2, axes=boxed, grid=[20,20,20]);

[Maple Plot]

> S:=simplify(subs({x=x-x0, y=y-y0, z=z-z0}, S1+z0));

[Maple Math]

>

19.6 Singular Points on Surfaces

Example 1 . The surface r = [Maple Math] .

> restart: r:=[u^2, u*v, v^2]; ru:=diff(r,u); rv:=diff(r,v);

[Maple Math]

[Maple Math]

[Maple Math]

> with(linalg): subs({u=0, v=0}, crossprod(ru, rv));

Warning, protected name norm has been changed and unprotected

Warning, protected name trace has been changed and unprotected

[Maple Math]

> ruu:=diff(r, u$2); ruv:=diff(r,u,v); rvv:=diff(r, v$2); det([ruu, ruv, rvv]);

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

(3)

> r:=[u*v, u, v^2]; ru:=diff(r,u); rv:=diff(r,v); rvv:=diff(r,v$2);

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

> subs({u=0, v=0}, crossprod(ru, rvv));

[Maple Math]

>

Example 5 . The surface [Maple Math] . We plot it by gluing together six pieces (graphs):

> p11:=plot3d(sqrt(y^3-x^2*y), x=0..2, y=-x..0): p12:=plot3d(-sqrt(y^3-x^2*y), x=0..2, y=-x..0): p21:=plot3d(sqrt(y^3-x^2*y), x=-2..0, y=x..0): p22:=plot3d(-sqrt(y^3-x^2*y),x=-2..0, y=x..0): p31:=plot3d(sqrt(y^3-x^2*y), x=-2..2, y=abs(x)..2): p32:=plot3d(-sqrt(y^3-x^2*y), x=-2..2, y=abs(x)..2):

> plots[display]({p11, p12, p21, p22, p31, p32}, axes=boxed);

[Maple Plot]

Exercises .

1. Prove that the surface [Maple Math] , is a singular point:

> plot3d([rho*cos(phi), rho*sin(phi), rho^(2/3)], rho=0..1, phi=-Pi..Pi, grid=[15,30], axes=boxed);

[Maple Plot]

>

Solution :

> r:=[u, v, root(u^2+v^2, 3)]; ru:=diff(r,u); rv:=diff(r,v);

[Maple Math]

[Maple Math]

[Maple Math]

> crossprod(ru,rv): n1:=evalm(%/norm(%, 2)):

> [limit(limit(n1[1], u=0), v=0), limit(limit(n1[2],u=0),v=0), limit(limit(n1[3],u=0),v=0)];

[Maple Math]

2. Prove that points on the cylindrical surface [Maple Math] that lie on the axis OZ (u= 0) form the cuspidal edge ,

> plot3d([u^2, u^3, v], u=-1..1, v=0..2, grid=[25,15],axes=framed);

[Maple Plot]

>

3. Prove that O(0,0) is a singular point of the surface: [Maple Math] .

> plot3d([rho^2*cos(2*phi), rho^2*sin(2*phi), (rho*sin(phi))^5],rho=0..1, phi=-Pi..Pi, grid=[15,30],axes=boxed,grid=[35,35]);

[Maple Plot]