Mathematics 241 – Multivariable Calculus Lab Day 2 – Vector Fields and Flow Lines September 25, 2013

Background and Goals

A vector field is a vector-valued function on (a subset of) R^{2} or R^{3}:

\begin{aligned}F : X ⊆ R^{2} & → R^{2} or \\ F : X ⊆ R^{3} & → R^{3}. \end{aligned}

We can visualize a vector field in the plane, for instance, by drawing the vector F (x, y) placing its tail at the point (x, y) for all (x, y) ∈ X, or perhaps for the points in some finite subset of X such as points on a rectangular grid (this will help produce a more understandable picture!) Something similar can be done in R^{3} as well. We will use Maple today to see what a few more of these look like and then investigate what are called flow lines of vector fields.

A worked example

We will be using two new Maple commands today that are contained in external packages. You will need to begin by entering the following commands to load these packages:

                               with(plots):
                              with(DEtools):

(The colon at the end suppresses the output from the command, which is a list of all the procedures in the packages. There are quite a few(!))

The command for plotting a vector field in the plane is called fieldplot. To generate a plot of F (x, y) = (x − 2y, 2x + y) we will use the following:

         fieldplot([x - 2*y, 2*x + y],x=-3..3,y=-3..3,arrows=SLIM,
                 color=red,axes=boxed,fieldstrength=log);

(this should all be entered on one input line in Maple; it’s broken over two lines here for typographical reasons). Notes: The x- and y- ranges specify the portion of the plane that will be plotted. The stuff after that specifies how the vectors in the vector field will be drawn, their color, the placement of the axes in the plot, and how the lengths of the arrows will be shown. Type in the command and examine the plot that is produced. Vector fields are used to represent things like:

• the velocity vectors at each point in a fluid flow, or

• the force vectors at each point due to some force (e.g. gravitational force exerted by a mass placed somewhere in space).

Imagine a fluid flowing in the plane with velocity at each point given by the vector field you just plotted. If we dropped a small, light object into the fluid at a particular point, where would the fluid carry it? For instance, try to visualize what would happen if the object started at the location (−0.2, −0.2) and it “goes with the flow” described by the vector field.

The path followed here would be an example of what is called a flow line for the vector field. By definition, a flow line of a vector field F is a parametric curve α(t) = (x(t), y(t)) such that at each point on the curve, the tangent vector to the curve is the vector from the vector field F at that point. In equations, this says:

α′(t) = (x′(t), y′(t)) = F (x(t), y(t)) = (x(t) − 2y(t), 2x(t) + y(t))

for all t in some interval in R. This vector equation is equivalent to the following system of differential equations for the x- and y-components of the flow line:

\begin{aligned}x′(t) & = x(t) − 2y(t) \\ y′(t) & = 2x(t) + y(t) \end{aligned}

We will use Maple now to see more precisely what the flow line starting at (−0.2, −0.2) looks like. First enter the specification for the differential equations as above in Maple format:

    des := [diff(x(t),t) = x(t) - 2*y(t),diff(y(t),t) = 2*x(t) + y(t)];

Then the following command (from the DEtools package loaded above) will draw the flowline (superimposed on another picture of the vector field, for comparison):

          DEplot(des,[x(t),y(t)],t=0..4,[[x(0)=-0.2,y(0)=-0.2]],
                     x=-3..3,y=-3..3,linecolor=black);

(Again, type this all in one one input line). Note the format of the command: First the differential equations, then [x(t),y(t)], then the range of t values that will be plotted on the flow line, then the “initial conditions” – the starting point of the flow line, then the ranges of x- and y-values, then options to control the plotting. You can also plot several flow lines together if you want by including several initial conditions. For instance, try changing that part of the command above to:

              [[x(0)=-0.2,y(0)=-0.2],[x(0) = -1, y(0) = -2]]

to plot two flow lines together with the vector field.

Lab Questions

A.

1) Following the worked example above, using the fieldplot command, plot the vector field F (x, y) = (sin(x+y), cos(x−y)) on the rectangle with x = 0..2π (2*Pi in Maple), and y = 0..2π.

2) Examine your plot, and describe in words what the flow lines starting from the points (1, 1), (1, 6), and (4, 3) appear to be doing.

3) Then, use the DEplot command to check your intuition about the flow lines. Did they do what you expected?

B. Repeat part A, but using the vector field G(x, y) = (x − 3y, 3x − y) on the rectangle with x = −3..3, y = −3..3. In part 2, use the points (1, 0), (−1, −1), (0, 1).

Maple can also plot 3D vector fields using another command called fieldplot3d. The format is similar to the fieldplot command used above, but now you must specify three component functions in the vector field, and give x-, y-, and z-ranges for the plotting.

C.

1) Generate a 3D plot of the vector field K(x, y, z) = (−y, x, 1) in the rectangular solid x = −2..2, y = −2..2, z = −5..5. Use the same options as in question C. What would the flow lines for this vector field look like? Careful: there are two different cases depending on the initial point – see the next part!

2) Find a explicit parametrizations of the flow lines starting from (1, 0, 0) and from (0, 0, 1).