Vector Fields
Introduction
Maybe you've seen diagrams like the ones below.
Meteorology: Wind Map | Fluid Dynamics |
---|---|
Many applications can be modeled by vector fields, which describe a vector at each point in the plane.
More precisely:
If is a set of points in , then a vector field in is a function that assigns to each point in a two-dimensional vector:
The functions and define the components of .
In three dimensions, a vector field can be defined similarly:
Examples
Draw a graph for the vector field .
Solution
To graph this, pick a point and find the vector located at that point, then repeat.
The graph, with a few representative vectors drawn, is shown below.
To draw this graph in Matlab, follow these steps:
>> [x,y]=meshgrid(-1:0.2:1,-1:0.2:1);
>> u=-y;
>> v=x;
>> quiver(x,y,u,v)
This is an example of a rotational vector field.
Draw a graph for the vector field for .
Solution
To draw this graph in Matlab, follow these steps:
>> [x,y]=meshgrid(-1:0.2:1,-1:0.2:1);
>> u=1-y.^2;
>> v=0.*x;
>> quiver(x,y,u,v)
The resulting graph is shown below.
This is an example of channel flow. Notice how near the "walls," the flow is reduced. When water flows through a channel, the walls slow the water down; in fact, in most studies of fluid dynamics, the flow is assumed to be zero at the wall (called the "no-slip condition").
We can also draw a three-dimensional version of this (although the picture is much harder to read).
>> [x,y,z]=meshgrid(-1:0.2:1,-1:0.2:1,-1:0.2:1);
>> u=1-y.^2-z.^2;
>> v=0.*x;
>> w=0.*x;
>> quiver3(x,y,z,u,v,w)
Draw a graph for the vector field .
Solution
Once again, using Matlab:
>> [x,y]=meshgrid(-2:0.5:2,-2:0.5:2);
>> u=2.*x;
>> v=2.*y;
>> quiver(x,y,u,v)
The resulting graph is shown below.
This is an example of a radial vector field.
Draw a graph for the vector field
Solution
In Matlab:
>> [x,y]=meshgrid(-2:0.5:2,-2:0.5:2);
>> u=0.*x;
>> v=x;
>> quiver(x,y,u,v)
The resulting graph is shown below.
Draw a graph for the vector field
Solution
In Matlab:
>> [x,y]=meshgrid(-2:0.5:2,-2:0.5:2);
>> u=0.*x;
>> v=y;
>> quiver(x,y,u,v)
The resulting graph is shown below.
Sketch the vector field
Potential Functions and Gradient Fields
Here's one way to generate a vector field: start with a scalar function (as opposed to a vector function). For example, start with . The gradient of this function is a vector field:
The scalar function is called a potential function, and is called the gradient field in this context.
Consider the potential function . Find the gradient field for this function.
Solution
We can graph this vector field, as we did with the others, in Matlab, by defining it using the gradient function:
>> [x,y]=meshgrid(-2:0.2:2,-2:0.2:2);
>> z=x.*exp(-x.^2-y.^2);
>> [u,v]=gradient(z);
>> quiver(x,y,u,v)
The resulting graph is shown below.
Find the gradient field for the potential function .
Find the gradient field for the potential function .
Find the gradient field for the potential function .
Find the gradient field for the potential function .
Gradient Fields and Level Curves
Recall that the gradient points in the direction of steepest ascent along a function, and if we travel orthogonally to the gradient, the elevation doesn't change. Therefore, the gradient is orthogonal to the level curves of the function. We can observe this graphically by graphing the gradient field and the level curves (using the contour command in Matlab) on the same plot.
Consider the potential function . Plot the gradient field and level curves on the same plot.
Solution
In Matlab:
>> [x,y]=meshgrid(-2:0.2:2,-2:0.2:2);
>> z=x.^2+y.^2;
>> [u,v]=gradient(z);
>> quiver(x,y,u,v)
>> hold on
>> contour(x,y,z)
>> axis equal
The graph is shown below.
Note how you can see that the vectors are orthogonal to the level curves.
Consider the potential function . Plot the gradient field and level curves on the same plot.
Solution
In Matlab:
>> [x,y]=meshgrid(-2:0.2:2,-2:0.2:2);
>> z=x.*exp(-x.^2-y.^2);
>> [u,v]=gradient(z);
>> quiver(x,y,u,v)
>> hold on
>> contour(x,y,z)
>> axis equal
The graph is shown below.
This one is similar to a magnetic field that results from two point charges, one positive and one negative, where the vector at each point represents the magnetic force felt by a test charge at that point. The level curves represent lines of equal magnetic potential energy.