Introduction
This is a transcript of the material produced on the instructor's console in the meeting of 640:251:H1 in the IML on April 6, 2004.
Setup
The plots library is needed for all but the simplest plots. The VectorCalculus library gives direct access to some of the operations used in this course. The latter library made its first appearance in Maple 8, so it has not yet been made part of the Lab projects for this course. A side effect of the studies done in the extra lab meetings for this section is the exploration of the VectorCalculus library in front of a live audience.
| > | with(plots):with(VectorCalculus): |
Warning, the name changecoords has been redefined
Warning, the assigned names `<,>` and `<|>` now have a global binding
Warning, these protected names have been redefined and unprotected: *, +, ., D, Vector, diff, int, limit, series
Note the use of a colon rather than a semicolon to end the "with" commands. This prevents the display of a full list of new functions. As you can see, warning messages are not blocked, but these warnings do not restrict any of the other operations that we will be performing.
| > | SetCoordinates('cartesian'[x,y,z]); |
The vector operations work in a wide variety of coordinate systems, with no default choice. To allow the conventions of this course, the standard rectangular (here called 'cartesian') xyz system is fixed by this instruction.
Section 16.8, Problem 8
First, we view the domain of integration. No fancy limits are given in the statement of the problem: only from zero until the plane leaves the first octant. The following values are good enough.
| > | implicitplot3d(2*x+y+2*z=2,x=0..2,y=0..2,z=0..2); |
![[Plot]](images/Apr06_04_2.gif)
We now need the ingredients of the integrals. F is the given vector field whose integral over the boundary of the triangle is one side of Stokes' theorem. G is the curl of F, which is the integrand in the flux integral through the surface. To describe the surface, we need a vector perpendicular to the surface. We get on by taking the gradient of a function that is constant on the surface. Since the surface lies in a plane, that vector is constant.
| > | F:=VectorField(<exp(-x),exp(x),exp(z)>); |
| > | G:=Curl(F); |
| > | NorVec:=Gradient(2*x+y+2*z); |
The given "upward" orientation requires that the third component of the normal vector be positive. In this case, that says that all components are positive. To evaluate the integral directly, we need to: (1) identify the projection into one of the coordinate planes; (2) scale the normal vector to have coordinate 1 in the direction perpendicular to that plane; (3) integrate the dot product of this normal vector with G over the projected region. The first instinct is to use the xy-plane, but our NorVec already has 1 as its second component, so its dot product with G can be integrated over the xz-plane with no further scaling. The following instruction shows how Maple can find the equation of the oblique side of the triangle in this plane.
| > | eval(solve(2*x+y+2*z=2,z),y=0); |
| > | int(int(G.NorVec,z=0..1-x),x=0..1);#direct description of region in xz-plane |
Note that the result is positive in agreement with the fact that we are integrating a positive quantity and the direction of the normal tells us to treat all areas in coordinate planes as positive. It is also possible to use VectorCalculus functions to evaluate the integral using a direct description of the surface. We will again use x and z to parameterize the surface, so we solve for y on the surface.
| > | ytop:=solve(2*x+y+2*z=2,y); |
| > | Flux(G,Surface(<x,ytop,z>,[x,z]=Triangle(<0,0>,<1,0>,<0,1>)));#opposite orientation |
| > | Flux(G,Surface(<x,ytop,z>,[z,x]=Triangle(<0,0>,<1,0>,<0,1>)));#correct orientation |
The orientation problem results from the fact that we gave our coordinates as x, y, and z -- in that order. If you look at the xz plane from the positive y-axis, you get the standard (right-handed) coordinates if the positive z-axis is horizontal. This pair of instructions shows that the Flux command in the VectorCalculus package always calculates an oriented integral, and that orientation is determined by the names given in the original SetCoordinates instruction. For the other side of Stokes' theorem, the LineInt command allows a simple way to describe a broken-line path.
| > | LineInt(F,LineSegments(<1,0,0>,<0,2,0>,<0,0,1>,<1,0,0>)); |
This was too easy! For analysis of the operation, it is useful to get "inert" forms of the integral that show the integrals over the individual segments using the standard P0+t(P1-P0) parameterization.
| > | LineInt(F,LineSegments(<1,0,0>,<0,2,0>,<0,0,1>,<1,0,0>),'inert'); |
To break the integral apart, the "op" instruction gives the parts of an expression as an "expression sequence". Since the whole expression is a sum, the parts are the terms in that sum.
| > | op(%); |
| > | parts:=%; |
| > | value(parts[1]); |
| > | value(parts[2]); |
| > | value(parts[3]); |
| > | %+%%+%%%; |
The "value" expression produces the value of an inert expression. In this case, we get the individual integrals, and are then able to add these values.
Section 16.5, Problem 8a.
| > | V5_8:=VectorField(<x*exp(y*z),y*exp(x*z),z*exp(x*y)>); |
| > | Curl(V5_8); |
The problem only asked to compute the curl. Most of the work involved describing the vector field to Maple. Note that vectors in this package have their components enclosed in angle-brackets.
Section 16.8, Problem 2.
The surface is described as the part of one surface lying on one side of another. In this case, the surfaces are familiar, so a plot of both surfaces will show what we need. The quantities in the first argument of the "plot3d" instruction are the values of z in terms of x and y on the two surfaces. The intersection of those surfaces will be the boundary curve.
| > | plot3d({9-x^2-y^2,5},x=-3..3,y=-3..3); |
![[Plot]](images/Apr06_04_21.gif)
Here is the given vector field and its curl. Integrating the curl over a surface clearly gives zero -- no matter what the surface is. If we needed to continue, the intersection would need to identified as a circle of radius 2 in the plane z=5.
| > | F2:=VectorField(<y*z,x*z,x*y>); |
| > | Curl(F2); |
Here is a description of the boundary r(t), and a tangent vector r1(t).
| > | r:=<2*cos(t),2*sin(t),5>; |
| > | r1:=diff(r,t); |
Note that the tangent vector has third component zero, so that it always lies in a horizontal plane. Next, we build the integrand and integrate it once around the circle. The "convert" step is taken because Vector Fields don't live in the same universe as ordinary Vectors, so the dot product cannot be found without an additional step.
| > | eval(F2,{x=r[1],y=r[2],z=r[3]}); |
| > | F2V:=convert(%,Vector); |
| > | F2V.r1; |
| > | int(%,t=0..2*Pi); |
There is also a direct way to describe this using the Vector Calculus package. Certain curves are automatically parameterized from a geometric description. Again, we use the "inert" option to see the integral produced.
| > | LineInt(F2,Circle3D(<0,0,5>,2,<0,0,1>),'inert'); |
Ooops! It looks like Maple automatically used Stokes' theorem to produce an integral over the inside of the circle in its plane. Note that Stokes' theorem allows you to pick the most convenient surface bounded by the given curve. It is not necessary to take a surface that may have been given in the initial statement of the problem.
| > | LineInt(F2,Path(r,t=0..2*Pi),'inert'); |
| > | value(%); |
Here, we have forced a line integral. If we wanted to force a flux integral over the paraboloid, the best way would be to find a way to parameterize it and use the "Surface" option. Here is a check of the surface description, based on polar coordinates in the xy-plane, using a graph. We need to avoid 'r' as a name since we have used it for something else, and we also want to use a parametric description instead of polar coordinates, so we choose some odd names for our parameters.
| > | plot3d([rad*cos(ang),rad*sin(ang),9-rad^2],rad=0..2,ang=0..2*Pi); |
![[Plot]](images/Apr06_04_33.gif)
The end.