Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168695
Image: ubuntu2004

 Vector field

Definition: A vector field on two (or three) dimensional space is function F that assigns to each point (x,y) (or x,y,z) a two  (or three dimensional) vector given by F (x, y) (or F(x,y,z)).

That may not make a lot of sense, but most people do know what a vector field is, or at least they've seen a sketch of a vector field. If you've seen a current sketch giving the direction and magnitude of a flow of a fluid or the direction and magnitude of the winds then you've seen a sketch of a vector field.

The standard notation for the function F is,

F(x,y )= P(x,y)i + Q(x,y)j

F(x,y,z) = P(x,y,z)i + Q(x,y,z)j + R(x,y,z)k

depending on whether or not  we're in two or three dimensions. the function P,Q,R(if it is present) are sometimes called scalar functions.

 

Let's take a look at a couple of examples.
Example 1. Sketch each of the following direction fields.

                a) F(x,y) = -yi + xj

                

var('x y') plot_vector_field((x, y), (x,-1,0), (y,0,1))

         Okay, the graph the vector field we need to get some "values" of the function. This means plugging in some points into   the function. Here are a couple of evaluations.

 F(1/2, 1/2) = -1/2i + 1/2j

 F(1/2, -1/2) = -(-1/2)i + 1/2j = 1/2i + 1/2j

 F(3/2, 1/4) = -1/4i + 3/2j

So, just what do these evaluations tell us? Well the first one tell us that at the point (1/2, 1/2) we will plot the vector -1/2i + 1/2j. Likewise the third evaluation tells us that at the point (3/2, 1/4) we will plot the vector -1/4i + 3/2j

We can continue in this fashion plotting vectors for several points we'll get the following sketch of the vector field.

   

                 b) F(x,y,z) = 2xi -2yj - 2xk

 

In the case of three dimensional vector fields it is almost always better to use Maple, Mathematica, or some other such tool. Despite that let's go ahead and do a couple of evaluations anyway.

F(1, -3, 2) = 2i + 6j - 2k

F(0, 5, 3) =  -10j

Notice that z only affect the placement of the vector in this case and dose not affect the direction or the magnitude of the vector. Sometimes this will happen so don't get excited about it when it does.

Here is a couple of sketches generated by Mathematica. The sketch on the left is from the 'front' and the sketch on the right is from 'above'.

 

x,y,z = var('x y z') plot_vector_field((x, y, z), (x, 2, 0, 0), (y, 0, -2, 0), (z, 0, 0, -2))
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_3.py", line 9, in <module> exec compile(ur'open("___code___.py","w").write("# -*- coding: utf-8 -*-\n" + _support_.preparse_worksheet_cell(base64.b64decode("eCx5LHogPSB2YXIoJ3ggeSB6JykgCnBsb3RfdmVjdG9yX2ZpZWxkKCh4LCB5LCB6KSwgKHgsIDIsIDAsIDApLCAoeSwgMCwgLTIsIDApLCAoeiwgMCwgMCwgLTIpKQ=="),globals())+"\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpKJhO51/___code___.py", line 4, in <module> exec compile(ur'plot_vector_field((x, y, z), (x, _sage_const_2 , _sage_const_0 , _sage_const_0 ), (y, _sage_const_0 , -_sage_const_2 , _sage_const_0 ), (z, _sage_const_0 , _sage_const_0 , -_sage_const_2 ))' + '\n', '', 'single') File "", line 1, in <module> File "/usr/local/sage/local/lib/python2.6/site-packages/sage/plot/misc.py", line 138, in wrapper return func(*args, **options) TypeError: plot_vector_field() takes exactly 3 non-keyword arguments (4 given)

 Now that we've seen a couple of vector fields let's notice that we've already seen a vector field function. In the second chapter we looked at the gradient vector. Recall that given a function f(x, y, z) the gradient vector is defind by,

             f = <fx, fy, fz> -------------------------> This is vector field and is often called a gradient vector field.

 In these cases the function f(x, y, z) is often called a scalar function to differentiate it from the vector field.

 Example 2. Find the gradient vector field of the following functions.

(a) f(x,y) = x^2sin(5y)

Solution

Note that we only gave the gradient vector definition for a three dimensional function, but don't forget that there is also a two dimension definition. All that we need to drop off the third compornent of the vector.

Here is the gradient vector field for this function.

f = <2xsin(5y), 5x^2cos(5y)>

 

(b)f(x, y, z) = ze^-xy

Solution

There isn't much to do here other than take the gradient.

f = <-yze^-xy, -xze^-xy, e^-xy>