Vector Fields

Spring 2017, Math 211, Multivariable Calculus, Carleton College, Prof. Joshua R. Davis

2D circular vortex

Here’s a basic example of a 2D vector field. Interpreted as a velocity field, it’s kind of like a whirlpool or vortex.

v = {-y / (x^2 + y^2), x / (x^2 + y^2)}
VectorPlot[v, {x, -1, 1}, {y, -1, 1}, VectorPoints->20]

You can imagine the trajectory of a particle as it circles that vortex. Here is a visualization, for many particles at once.

StreamPlot[v, {x, -1, 1}, {y, -1, 1}, VectorPoints->20]

Q1: Curl doesn’t make sense in this example. Why? Immediately below this text cell, type your answer in English.

Here’s the divergence. Nowhere in the velocity field are particles converging or diverging.

Simplify[Div[v, {x, y}]]

This vector field is not conservative, even though it passes the test suggested by Clairaut’s theorem. The “reason” is that it’s not defined at the origin. Your homework explores that phenomenon further.

Simplify[D[v[[1]], y]]
Simplify[D[v[[2]], x]]

3D gravitational field

Here’s a 3D gravity force field (from Fall 2014 Exam A, ignoring the physical constants). Unfortunately Mathematica doesn’t offer a StreamPlot3D function.

f = (x^2 + y^2 + z^2)^(-1 / 2)
v = Grad[f, {x, y, z}]
VectorPlot3D[v, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, VectorPoints->20]

Q2: Is this vector field conservative? Immediately below this text cell, type your answer in English.

Compute the curl of this vector field, using Mathematica’s Curl function. Does the answer make sense?

What is the divergence of this 3D vector field? (The answer is a little surprising.) Immediately below this text cell, make a code cell and an explanation cell.

2D spiralling vortex

Here we add two 2D vector fields together: the 2D vortex from above, and a 2D version of the attractor from above.

f = (x^2 + y^2)^(-1 / 2) / 10;
v = {-y / (x^2 + y^2), x / (x^2 + y^2)} + Grad[f, {x, y}];
VectorPlot[v, {x, -1, 1}, {y, -1, 1}, VectorPoints->20]

Q3: Make the corresponding stream plot, in a code cell immediately after this text cell.

Q4: Compute the divergence. Does the answer make sense? Answer these questions using a code cell and an explanation cell.

3D circular vortex

Here’s the 2D circular vortex, extruded trivially into the third dimension. Plot the vector field. You may want to decrease VectorPoints from 20 to 10.

v = {-y / (x^2 + y^2), x / (x^2 + y^2), 0}

Q5: What are the curl and divergence of this vector field? Do the answers make sense? Answer these questions using a code cell and an explanation cell.

This vector field is not conservative, for the same reason that the 2D version is not conservative.

Shear zone model in structural geology

Structural geology is the study of how rocks fracture, slip, fold, and otherwise deform when under the immense stresses found within the Earth. One important kind of rock deformation is called a shear zone. It can be found where two tectonic plates grind against each other, for example. A shear zone consists of a region of deforming rock trapped between two regions of non-deforming rock. The non-deforming regions move toward (or away from) each other at a constant velocity, and the deforming material between them gets smushed and sheared.

The entire system can be described as a velocity field. Although the problem is inherently 3D, we will stick to 2D simplifications, just because they are easier to see.

Here is a typical simple 2D shear zone model. Don’t worry about how the code works (it requires linear algebra), but do try adjusting the numbers L11, L12, and L21, to see how the velocity field changes. Where are the edges of the deforming region? Also try StreamPlot.

l11 = 2;
l12 = 3;
l21 = 0;
l = {{l11, l12}, {l21, -l11}};
eig = Eigensystem[l];
If[eig[[1, 1]] < eig[[1, 2]],
	u = eig[[2, 1]],
	u = eig[[2, 2]]];
u = l.{u[[1]] / u[[2]], 1};
v = If[y > 1, u,
	If[y < -1, -u,
		l.{x, y}]];
VectorPlot[v, {x, -1.5, 1.5}, {y, -1.5, 1.5}, VectorPoints->20]

When scientists fight, it is often because they disagree about whether a model is overly simplified (compared to reality, which is complex) or overly complicated (compared to their data, which are noisy and scant). Some structural geologists criticize models like the one above, because the velocity field is discontinuous at the edges of the deforming region.

So here is another kind of 2D shear zone model, which produces a continuous velocity field. The vector u is the velocity of the northern undeforming region. The velocity of the southern undeforming region is then -u. Try altering u, to see how the field changes.

u = {0.3, -0.1};
v = If[y > 1, u,
	If[y < -1, -u,
		{u[[1]] y, u[[2]] y (3 - y^2) / 2}]];
VectorPlot[v, {x, -1.5, 1.5}, {y, -1.5, 1.5}, VectorPoints->20]

Q6: In either code or English, demonstrate that the velocity field is continuous at the northern edge of the deforming region. Type your answer into a cell here.

Predator-prey model in ecology

The Lotka-Volterra model is a classic study of how predators and prey interact. Assume that an ecosystem consists of only two species: rabbits and foxes. Let x be the number of rabbits and y the number of foxes. Both of these quantities change over time, because of reproduction

The rabbits reproduce at a constant rate (and they have an unlimited food supply, which is not part of the model). However, they also get preyed upon. The rate of predation depends on how often foxes find rabbits, which depends on how many rabbits and foxes there are. So it is reasonable to declare that

dx / dt = A x - B x y

for some positive constants A, B. The foxes reproduce at a rate proportional to how much they’re eating, and they die off at a constant rate. So

dy / dt = D x y - C y

for some positive constants C, D. Notice that <dx / dt, dy / dt> is a 2D vector field. Intuitively, the x-y-plane is a “space” of population sizes, and the vector field is a velocity field in that space, describing how the population sizes move over time.

After examining the vector field plot, change it to a StreamPlot. Then change the values of the parameters A, B, C, D, to examine their effect on the system.

a = 1.5;
b = 1.0;
c = 3.0;
d = 1.0;
v = {a x - b x y, d x y - c y}
VectorPlot[v, {x, 0, 10}, {y,0, 10}, VectorPoints->20]

Q7: Can you change them to make the rabbit population crash? Can you make the rabbit population explode? Answer these questions using code cells and explanation cells.

Curl of gradient, divergence of curl

This section is optional. We haven’t covered this material thoroughly yet, but we will soon.

Make a scalar function. Compute the curl of its gradient. Does the answer make sense?

By trial and error, make a 3D vector field of non-zero curl. Compute the divergence of its curl. Does the answer make sense?