+ All Categories
Home > Documents > Vector Valued Functions - Salisbury...

Vector Valued Functions - Salisbury...

Date post: 09-Sep-2021
Category:
Upload: others
View: 3 times
Download: 0 times
Share this document with a friend
26
Vector Valued Functions Introduction and Goals: The main goal of this lab will help you visualize the graphs of vector-valued functions and their tangent vectors. Moreover, we want you to begin to view tangent vectors as the three-dimensional equivalent to the slope of the tangent line from Calculus I. Recall that the slope of a tangent line told us the rate of change of one variable with respect to another. Specifically, if we were examining a distance verses time graph then the slope of the tangent line gives us the instantaneous rate of change of distance with respect to time, that is, velocity. In three dimensions, if we are a particle moving along a curve then the tangent vector gives us the direction we are moving in and the length of that tangent vector gives us our speed in which we are moving along the curve. This lab also investigates the Maple commands needed to perform some of the calculations that we would do by hand, in class. Furthermore, we continue to build an arsenal of special commands to make using Maple a little easier. Before You Start: Make sure that you read and understand the mathematics from the corresponding sections in your textbook. It would also help if you looked over the lab on Lines and Planes. Textbook Correspondence: Stewart 5 th Edition: 14.1 – 14.2. Stewart 5 th Edition Early Transcendentals: 13.1 – 13.2. Thomas’ Calculus 10 th Edition Early Transcendentals: 10.5. Johnston & Mathews Calculus: 8.7. Maple Commands and Packages Used: Packages: plots, linalg, VectorCalculus. Commands: spacecurve, plot3d, display, solve, limit, diff, unapply, arrow, int, solve, fsolve, evalf, seq. User Defined Commands: plotvvf, plotvvf2, plotvvftv, normplot, normplotresy, plotvvftv2, curveint. History & Biographies: Maple Commands:
Transcript
Page 1: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

Vector Valued Functions Introduction and Goals:

The main goal of this lab will help you visualize the graphs of vector-valued functions and their tangent vectors. Moreover, we want you to begin to view tangent vectors as the three-dimensional equivalent to the slope of the tangent line from Calculus I. Recall that the slope of a tangent line told us the rate of change of one variable with respect to another. Specifically, if we were examining a distance verses time graph then the slope of the tangent line gives us the instantaneous rate of change of distance with respect to time, that is, velocity. In three dimensions, if we are a particle moving along a curve then the tangent vector gives us the direction we are moving in and the length of that tangent vector gives us our speed in which we are moving along the curve. This lab also investigates the Maple commands needed to perform some of the calculations that we would do by hand, in class. Furthermore, we continue to build an arsenal of special commands to make using Maple a little easier. Before You Start:

Make sure that you read and understand the mathematics from the corresponding sections in your textbook. It would also help if you looked over the lab on Lines and Planes. Textbook Correspondence: Stewart 5th Edition: 14.1 – 14.2. Stewart 5th Edition Early Transcendentals: 13.1 – 13.2. Thomas’ Calculus 10th Edition Early Transcendentals: 10.5. Johnston & Mathews Calculus: 8.7. Maple Commands and Packages Used: Packages: plots, linalg, VectorCalculus. Commands: spacecurve, plot3d, display, solve, limit, diff, unapply, arrow, int, solve, fsolve, evalf, seq. User Defined Commands: plotvvf, plotvvf2, plotvvftv, normplot, normplotresy, plotvvftv2, curveint. History & Biographies: Maple Commands:

Page 2: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

Defining and Plotting Space Curves:

As usual, we will need the plots package and there are a few commands we are using that require the linalg package, so load them in with the with command. > with(plots): > with(linalg): We are also going to take a more sophisticated look at vectors. In previous labs we were using matrices to denote vectors. We mainly used single row matrices to denote the vector but we also looked at a single column matrix representation of the vector. Using matrices for vectors is very natural since this is the way we represent them mathematically and it is a good way to get your feet wet with vectors and Maple but in general we want to do many things with vectors that we would not necessarily want to do with a matrix. For example, differentiate and integrate them componentwise as well as create vector-valued functions from them. Although you can do most vector manipulations with the matrix representation some of the Maple commands we would need are a bit cumbersome. To make our Maple commands a little easier and load in several interesting function we will add the VectorCalculus package. > with(VectorCalculus): Warning, the assigned names <,> and <|> now have a global binding Warning, these protected names have been redefined and unprotected: *, +, ., Vector, diff, int, limit, series

As you know from the text, a space curve is given either parametrically as

( )( )( )thz

tgy

tfx

===

where ( )tf , ( )tg and ( )th are functions of a single variable t, or in vector form as

( ) ( ) ( )thtgtft ,,)( =r . When the VectorCalculus package is loaded we define a vector as

a component list, as usual, but this time we use angled brackets. For example, say we

wanted to input the vector ( ) ( ) ttt ,cos,sin , the Maple syntax would be,

> <sin(t),cos(t),sqrt(t)>;

+ + ( )sin t eexx

( )cos t eeyy

t eezz

Note that the output is different than the angled bracket output from previous labs. When the VectorCalculus package is not loaded the angled brackets gave us a column vector, actually a single column matrix. With the VectorCalculus package loaded the angled

Page 3: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

brackets automatically see the expression as a vector, i.e. a vector data type in Maple. The ex, ey and ez stand for the vectors i, j and k respectively, that is 0,0,1 , 0,1,0 and

1,0,0 . We can define this as the vector valued function ( ) ( ) tttt ,cos,sin)( =r simply

by placing the function definition syntax at the beginning. That is, > r:=t-><sin(t),cos(t),sqrt(t)>;

:= r → t ( ):-VectorCalculus `<,>` , ,( )sin t ( )cos t t

Note that the output is a bit strange. Maple seems to be calling a special function from the VectorCalculus package. If we evaluate )(tr we see that all is well. > r(t);

+ + ( )sin t eexx

( )cos t eeyy

t eezz

Similarly, we can evaluate the vector-valued function using standard function notation. > r(Pi);

+ eeyy

π eezz

> r(Pi/2);

+ eexx

2 π2

eezz

> r(0); eeyy

Let’s define three more vector functions so that we have something to work with for the remainder of the lab. Define ( ) ( ) ( ) ( )ttttt 22 cossin,sin,cos)( −=s ,

( ) ( ) tttttt ,sin,cos)( =q and 32 ,,)( tttt =p ,

> s:=t-><cos(t),sin(t),sin(t)^2-cos(t)^2>;

s t :-VectorCalculus `<,>` ( )cos t ( )sin t, ,( → :=

( ):-VectorCalculus `+` ,( )sin t 2 ( ):-VectorCalculus `*` ,( )cos t 2 -1 )

> s(t); + + ( )cos t ee

xx( )sin t ee

yy( ) − ( )sin t 2 ( )cos t 2 ee

zz

> q:=t-><t*cos(t),t*sin(t),t>;

Page 4: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

q t :-VectorCalculus `<,>` ( ):-VectorCalculus `*` ,t ( )cos t ,( → := ( ):-VectorCalculus `*` ,t ( )sin t t, )

> q(t); + + t ( )cos t ee

xxt ( )sin t ee

yyt ee

zz

> p:=t-><t,t^2,t^3>; := p → t ( ):-VectorCalculus `<,>` , ,t t2 t3

> p(t); + + t ee

xxt2 ee

yyt3 ee

zz

The standard way to plot a vector-valued function is with the spacecurve command. Unfortunately, using the spacecurve command directly does not work because the spacecurve command is expecting a different form for the function. > spacecurve(r(t),t=0..10*Pi,numpoints=500); Error, (in spacecurve) first argument must be array, list or set

To appease the spacecurve command we need to strip the components from r and place them in matrix form. This can be done with the seq command, as follows, > spacecurve([seq(r(t)[n],n=1..3)],t=0..10*Pi,numpoints=500, axes=BOXED);

Note that one option we included in this command was numpoints, recall that numpoints is the number of points plotted to draw the graph. It is common with space curves that the default number of points is too small and the curve looks polygonal. Now this command is quite long and we really don’t want to type it in repeatedly, of even copy and past it repeatedly, so we are going to define a function that will make graphing space curves quick and easy. In the command above there are four things of interest, the

Page 5: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

function )(tr , the lower bound for t, the upper bound for t and the number of points. When we create the new function these four items will be represented by variables. > plotvvf:=(r,lb,ub,pts)->spacecurve([seq(r(t)[n],n=1..3)], t=lb..ub,numpoints=pts); plotvvf :=

→ ( ), , ,r lb ub pts ( )spacecurve , ,[ ]( )seq ,( )r tn

= n .. 1 3 = t .. lb ub = numpoints pts

> plotvvf(r,0,10*Pi,500);

which is the same image as above. The nifty thing with the command we just defined is that we can substitute any vector-valued function into the command and get a graph. > plotvvf(s,0,2*Pi,500);

> plotvvf(q,-10*Pi,10*Pi,500);

Page 6: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

> plotvvf(p,0,1,500);

We can also combine the space curve images together using the display command. > display(plotvvf(s,0,2*Pi,500),plotvvf(q,-Pi,Pi,500));

Page 7: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

Note that in the above image we selected 1:1 and the boxed axes options from the toolbar after the graph was drawn. If you want to add more options to your plotting command simply place a variable name in the list of variables and place the corresponding options in the spacecurve command. For example, the following adds color and axes type to the list of parameters. > plotvvf2:=(r,lb,ub,pts,col,axs)->spacecurve([seq(r(t)[n], n=1..3)],t=lb..ub,numpoints=pts,color=col,axes=axs); plotvvf2 ( ), , , , ,r lb ub pts col axs spacecurve [ ]( )seq ,( )r t

n = n .. 1 3 = t .. lb ub, ,( → :=

= numpoints pts = color col = axes axs, , )

> plotvvf2(s,-Pi,Pi,500,black,BOXED);

> plotvvf2(s,-Pi,Pi,100,red,NORMAL);

Page 8: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

Limits of Vector Valued Functions: Finding limits of vector-valued functions in Maple is as easy as finding limits of real valued function in Maple. Use the limit command and give the command the vector-valued function, the limit point and an optional direction. To see some of the interesting types of output let’s use a slightly nastier function. Define ( ) ( )ttt t ln,tan,)( 1=h ,

> h:=t-><1/t,tan(t),ln(t)>;

:= h → t

:-VectorCalculus `<,>` , ,

:-VectorCalculus `*` ,1

1t

( )tan t ( )ln t

> h(t);

+ + 1t

eexx

( )tan t eeyy

( )ln t eezz

If we evaluate the limit of this function at a point where the function is continuous we see that Maple simply evaluates the function at the limit point, as it should. > limit(h(t),t=5);

+ + 15

eexx

( )tan 5 eeyy

( )ln 5 eezz

> limit(h(t),t=Pi);

+ 1π

eexx

( )ln π eezz

If we evaluate the limit at 0 we see that the x component is undefined, the y component is 0 and the z component is negative infinity, as we would expect. Although the limit vector

Page 9: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

itself is of little use it does inform us to the limit of each of the components of the function, which is really all we can expect. > limit(h(t),t=0);

− undefined eexx

∞ eezz

If we further find the left and right hand limits of the function we get the corresponding outputs. > limit(h(t),t=0,left);

− −∞ eexx

∞ eezz

> limit(h(t),t=0,right); − ∞ ee

xx∞ ee

zz

The limits at 2

π give similar output. > limit(h(t),t=Pi/2);

+ + 2π

eexx

undefined eeyy

( )− + ( )ln 2 ( )ln π eezz

> limit(h(t),t=Pi/2,left);

+ + 2π

eexx

∞ eeyy

( )− + ( )ln 2 ( )ln π eezz

> limit(h(t),t=Pi/2,right);

− + 2π ee

xx∞ ee

yy( )− + ( )ln 2 ( )ln π ee

zz

Finally, as with real valued functions we can also find limits at infinity. > limit(h(t),t=infinity);

+ undefined eeyy

∞ eezz

Derivatives of Vector Valued Functions and Tangent Vectors: Differentiation of vector-valued functions can be done with the diff command just like real valued functions. In fact, the same options apply; the only difference is that the output is in vector form. > diff(r(t),t);

Page 10: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

− + ( )cos t eexx

( )sin t eeyy

12 t

eezz

> diff(s(t),t); + + − ( )sin t ee

xx( )cos t ee

yy4 ( )sin t ( )cos t ee

zz

> diff(p(t),t); + + ee

xx2 t ee

yy3 t2 ee

zz

> diff(p(t),t,t); + 2 ee

yy6 t ee

zz

> diff(p(t),t,t,t); 6 ee

zz

> diff(p(t),t,t,t,t); 0 ee

xx

> diff(p(t),t$3); 6 ee

zz

> diff(p(t),t$4); 0 ee

xx

Frequently we wish to define a function that is the derivative of another function. To do this we invoke the unapply command on the derivative. For example, to define the function dr as the first derivative of r we use the command, > dr:=unapply(diff(r(t),t),t);

dr t rtable .. 1 3 { }, , = ( )1 ( )cos t = ( )2 − ( )sin t = ( )312

1t

= datatype anything, , , → :=

= subtype Vectorcolumn

= storage rectangular = order Fortran_order, , ,

= attributes [ ] = coords cartesian

> dr(t);

− + ( )cos t eexx

( )sin t eeyy

12 t

eezz

Now to find the derivative, which is the tangent vector, at any value of the parameter t we simply evaluate the derivative function at the desired value. For example, the following are the tangent vectors to r at 1, π and 0 respectively.

Page 11: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

> dr(1);

− + ( )cos 1 eexx

( )sin 1 eeyy

12

eezz

> dr(Pi);

− + eexx

12 π

eezz

> dr(0); Error, (in dr) numeric exception: division by zero

With the plotvvf2 command we created above and the arrow command we can create some very informative graphs of space curves. Recall that the command

arrow(u,v); draws the vector v beginning at the point u. So if we let u be the point on the curve corresponding to a particular parameter value and v be the tangent vector at the same value for the parameter we can graph the tangent vector directly on the curve. For example, to plot the curve r along with its tangent vector at π=t we would use the command, > display(plotvvf2(r,0,10*Pi,500,black,boxed), arrow(r(Pi),dr(Pi),shape=arrow,color=black));

Similarly, to plot the curve r along with its tangent vector at 2

3π=t we would use the command, > display(plotvvf2(r,0,10*Pi,500,black,boxed), arrow(r(3*Pi/2),dr(3*Pi/2),shape=arrow,color=black));

Page 12: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

If we go a little further and use the seq function on the arrow command we can plot a series of tangent vectors along the curve. For example, consider the following command, > display(plotvvf2(r,0,10*Pi,500,black,boxed), seq(arrow(r(10*Pi/40*n),dr(10*Pi/40*n),shape=arrow, color=black),n=1..40));

This is a long command but it is actually easy to understand if we break it down into manageable chunks. First the plotvvf2 portion

plotvvf2(r,0,10*Pi,500,black,boxed) simply plots the curve r from 0 to π10 using 500 points in the plot, drawing the curve in black and putting boxed axes around it. The seq portion is a little more involved,

seq(arrow(r(10*Pi/40*n),dr(10*Pi/40*n), shape=arrow,color=black),n=1..40)

Page 13: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

In the arrow portion, the part

r(10*Pi/40*n),dr(10*Pi/40*n) plots the tangent vector at 10*Pi/40*n for each n from 1 to 40 starting at the point r(10*Pi/40*n). That is, we are drawing 40 tangent vectors on the curve at t values of π4

π2

3 π4

π5 π4

3 π2

7 π4

2 π9 π4

5 π2

11 π4

3 π13 π

47 π2

15 π4

4 π17 π

49 π2

, , , , , , , , , , , , , , , , , ,

19 π4

5 π21 π

411 π

223 π

46 π

25 π4

13 π2

27 π4

7 π29 π

415 π

231 π

48 π, , , , , , , , , , , , , ,

33 π4

17 π2

35 π4

9 π37 π

419 π

239 π

410 π, , , , , , ,

As you can see from the above image this plot shows us the tangent vector structure along the curve. Hence it tells us the direction and magnitude of the rate of change, with respect to t, along the curve. So if we think about t as time these vectors are showing us the direction and speed of a particle that is traveling along the curve. Since this type of graph can be really useful we would like to streamline the command a little. It would be nice if we could create a command like plotvvf where we simply put in the vector-valued function and some other options and Maple would create the image. We will do this in two steps. First note that we can replace dr by unapply(diff(r(t),t),t), this will relieve us from having to find the derivative before we do the plot. Note that the following command produces the same image but dr is never used. > display(plotvvf2(r,0,10*Pi,500,black,boxed), seq(arrow(r(10*Pi/40*n),unapply(diff(r(t),t),t)(10*Pi/40*n) ,shape=arrow,color=black),n=1..40));

Page 14: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

Now we are ready to create the command, we will call it plotvvftv for “plot vector-valued function and tangent vectors”. In the definition below note that r, lb, ub, pts, col and axs are the same as in the plotvvf2 command we created earlier. We have added the parameters evf, nlb, nub, shp and vcol. Parameter Purpose

evf This is the point evaluation function. That is, it is the formula, in terms of n, that is used to find the values of t where the tangent vector will be drawn. The formula must be in terms of n. The values that n takes on are all the integer values between nlb and nub.

nlb The lower bound for the integer range of n. The value must be an integer. nub The upper bound for the integer range of n. The value must be an integer. shp The shape of the arrows, harpoon, arrow, double_arrow, or

cylindrical_arrow

vcol The color of the vectors. In the actual command you will notice that we have replaced plotvvf2 with the definition of plotvvf2. This is so that we do not need to define the command plotvvf2 before defining this one. We also replaced all of the option values with their respective parameter names. Take some time to read through this command definition and really understand it. Maple is a system where if you take the time to create specialized functions like plotvvf2 and plotvvftv you can save yourself much more time in editing previous commands. > plotvvftv:=(r,lb,ub,pts,col,axs,evf,nlb,nub,shp,vcol)-> display(spacecurve([seq(r(t)[n],n=1..3)],t=lb..ub, numpoints=pts,color=col,axes=axs),seq(arrow(r(evf), unapply(diff(r(t),t),t)(evf),shape=shp,color=vcol), n=nlb..nub)); plotvvftv ( ), , , , , , , , , ,r lb ub pts col axs evf nlb nub shp vcol display spacecurve(( → :=

, , , ,[ ]( )seq ,( )r tn

= n .. 1 3 = t .. lb ub = numpoints pts = color col = axes axs ) seq(,

arrow ( )r evf ( )( )unapply ,( ):-VectorCalculus diff ,( )r t t t evf = shape shp, , ,( = color vcol ) = n .. nlb nub, ) )

Now to create the sane plot as before we only need to input the following command. Take the time to match up the inputs below with the command definition and the last display command that produced this graph. > plotvvftv(r,0,10*Pi,100,black,boxed,10*Pi/40*n,1,40, arrow,black);

Page 15: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

A few quick alterations to the calling command allow us to generate similar graphs of the other functions. > plotvvftv(s,0,2*Pi,100,black,boxed,2*Pi/40*n,1,40,arrow, black);

> plotvvftv(q,-10*Pi,10*Pi,500,red,boxed,-10*Pi+20*Pi/100*n, 0,100,arrow,black);

Page 16: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

Zooming in on the previous image gives. > plotvvftv(q,0,3,50,blue,normal,3/20*n,0,20,arrow,black);

> plotvvftv(p,0,3,50,blue,normal,3/20*n,0,20,arrow,black);

Page 17: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

Integrating Vector Valued Functions: As with differentiation, integration of vector-valued functions is the same as with real valued functions. You can do both definite and indefinite integrals using the int command. For example, the indefinite integral of p is, > int(p(t),t);

+ + t2

2eexx

t3

3eeyy

t4

4eezz

and the definite integral from 0 to 1 of p is, > int(p(t),t=0..1);

+ + 12

eexx

13

eeyy

14

eezz

Similarly, > int(q(t),t);

+ + ( ) + ( )cos t t ( )sin t eexx

( ) − ( )sin t t ( )cos t eeyy

t2

2eezz

> int(r(t),t);

+ + − ( )cos t eexx

( )sin t eeyy

2 t( )/3 2

3eezz

Page 18: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

Also, as with differentiation, we can create functions of both definite and indefinite integrals by using the unapply command. For example, the following command takes the indefinite integral of r and sets it to the function name ir. > ir:=unapply(int(r(t),t),t);

ir t rtable .. 1 3 { }, , = ( )1 − ( )cos t = ( )2 ( )sin t = ( )323

t( )/3 2

= datatype anything, , , → :=

= subtype Vectorcolumn

= storage rectangular = order Fortran_order, , ,

= attributes [ ] = coords cartesian

> ir(t);

+ + − ( )cos t eexx

( )sin t eeyy

2 t( )/3 2

3eezz

Similarly, the following command takes the definite integral of r from a to b and sets it to the function name ir. > ir:=unapply(int(r(t),t=a..b),a,b);

ir ( ),a b rtable .. 1 3, → :=

{ }, , = ( )1 − + ( )cos b ( )cos a = ( )2 − ( )sin b ( )sin a = ( )3 − 23

b( )/3 2 2

3a

( )/3 2,

= datatype anything = subtype Vectorcolumn

= storage rectangular, , ,

= order Fortran_order = attributes [ ] = coords cartesian,

> ir(a,b);

+ + ( )− + ( )cos b ( )cos a eexx

( ) − ( )sin b ( )sin a eeyy

2 b( )/3 2

32 a

( )/3 2

3eezz

So finding the definite integral of r from 0 to 1 can be done by, > ir(0,1);

+ + ( )− + ( )cos 1 1 eexx

( )sin 1 eeyy

23

eezz

Solving Equations & Finding Curve Intersections: Finding the point or points of intersection of two vector-valued functions can be difficult to do by hand and in fact even when using Maple the process can be less than straightforward. We will look at three examples of increasing degrees of difficulty. An

Page 19: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

easy example is to find the points of intersection between the curves tttttt −−= 432 ,,)(k and tttttt −−= 32 ,,)(j . If we define and plot both of these

curves together we see that there appears to be two points of intersection. > k:=t-><t^2,t^3-t,t^4-t>; k t :-VectorCalculus `<,>` t2 ( ):-VectorCalculus `+` ,t3 ( ):-VectorCalculus `*` ,t -1, ,( → :=

( ):-VectorCalculus `+` ,t4 ( ):-VectorCalculus `*` ,t -1 )

> j:=t-><t,t^2-t,t^3-t>; j t :-VectorCalculus `<,>` t ( ):-VectorCalculus `+` ,t2 ( ):-VectorCalculus `*` ,t -1, ,( → :=

( ):-VectorCalculus `+` ,t3 ( ):-VectorCalculus `*` ,t -1 )

> display(plotvvf2(k,-.5,1.1,100,red,boxed),plotvvf2(j,-.5,1.1,100,black,boxed));

To find the values of t that correspond to the points of intersection we need to set the two curves, component by component, equal to each other and solve the resulting system of equations. To put the system in the correct format for the solve command we need to extract the first component of the first curve and set it equal to the first component of the second curve and then do the same for the other two components. Recall that to extract a component from a vector we simply need to place [n] after the vector, where n is the component to be extracted. So the solve command we need is > solve({k(t)[1]=j(u)[1],k(t)[2]=j(u)[2],k(t)[3]=j(u)[3]}, {t,u});

,{ }, = u 0 = t 0 { }, = t 1 = u 1

which can be streamlined by using the seq function to generate the list of equations. That is, > solve({seq(k(t)[n]=j(u)[n],n=1..3)},{t,u});

,{ }, = u 0 = t 0 { }, = t 1 = u 1

Page 20: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

Checking the solutions shows that Maple has found the two points of intersection. > k(0);

0 eexx

> j(0); 0 ee

xx

> k(1); eexx

> j(1); eexx

Let’s move to a moderately more difficult problem. Find the points of intersection between the curves ( ) ( ) ( ) ( )ttttt 22 cossin,sin,cos)( −=s (defined before) and

( ) ( ) 21,cos,sin)( ttt =h . If we plot both of these curves together we see that there appears

to be four points of intersection. > h:=t-><sin(t),cos(t),1/2>;

:= h → t

:-VectorCalculus `<,>` , ,( )sin t ( )cos t

:-VectorCalculus `*` ,1

12

> display(plotvvf2(h,0,2*Pi,500,black,boxed), plotvvf2(s,0,2*Pi,500,black,boxed));

Setting up and evaluating the solve command for these curves gives a long and incomprehensible answer. Applying the evalf function to this result gives two solutions (note that the parameter values between the two curves is different.). Checking these

Page 21: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

shows that that are legitimate solutions, with a minor bit of round-off error, which we will ignore. > solve({seq(h(t)[n]=s(u)[n],n=1..3)},{t,u});

, = t ( )arctan ,1 ( )RootOf , − _Z2 3 = label _L1 = u ( )arctan ( )RootOf , − _Z2 3 = label _L1{

} t ( )arctan ( )RootOf , − _Z2 3 = label _L1 = {,

( )signum ( )RootOf , − _Z2 3 = label _L1 ππ2

− + u = ,

− + ( )arctan ( )RootOf , − _Z2 3 = label _L1 ( )signum ( )RootOf , − _Z2 3 = label _L1 π}

> evalf(%); ,{ }, = t 0.5235987755 = u 1.047197551 { }, = u 2.094395103 = t -0.523598776

> h(.5235987755);

+ + 0.4999999999 eexx

0.8660254038 eeyy

12

eezz

> s(1.047197551); + + 0.5000000002 ee

xx0.8660254037 ee

yy0.4999999997 ee

zz

> h(-.523598776);

+ + ( )-0.5000000003 eexx

0.8660254036 eeyy

12

eezz

> s(2.094395103); + + ( )-0.5000000005 ee

xx0.8660254035 ee

yy0.4999999990 ee

zz

So what has happened to the other two points of intersection? Note that the points of intersection that Maple found are those that have a positive y component. From our knowledge of symmetry we know that the other two points of intersection will be when the y component is negative. Fortunately, we can use Maple’s solve command on one of the equations to find the other two solutions. If we solve the z component equation we get, > solve(sin(t)^2-cos(t)^2=1/2);

, , ,π3

−π3

2 π3

−2 π3

Note that the two numeric values for the parameter of the s curve that Maple gave us were the 3

π and 32π . If we evaluate s at the other two values we get

> s(-1/3*Pi);

− + 12

eexx

32

eeyy

12

eezz

Page 22: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

> s(-2/3*Pi);

− +

-12

eexx

32

eeyy

12

eezz

which have the same x and z coordinates as the first two points but the y coordinate is negative. The only remaining question is what are the corresponding values for the parameter for the h curve? If we set the x components equal to each other while substituting the 3

π− and 32π− in for the s curve we obtain the two values that Maple

found. > solve(sin(u)=cos(-Pi/3));

π6

> solve(sin(u)=cos(-2*Pi/3));

−π6

If we set the y components equal to each other while substituting the 3

π− and 32π− in for

the s curve we get the value 35π , which checks.

> solve(cos(u)=sin(-Pi/3));

5 π6

> solve(cos(u)=sin(-2*Pi/3)); 5 π6

> h(5/6*Pi);

− + 12

eexx

32

eeyy

12

eezz

From the graph and our knowledge of symmetry we know that the remaining parameter value is 3

7π > h(7/6*Pi);

− +

-12

eexx

32

eeyy

12

eezz

Although Maple was a powerful tool in aiding the solution to this last problem it did not just hand us the solution. Recall the adage that says not only do you need the right tool for the right job but you also need to know how to use it.

Page 23: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

We will do one final example of solving for space curve intersections. Consider the two

curves ( ) ( ) tttt ,cos,sin)( =r and ( ) ( ) ( ) ( )ttttt 22 cossin,sin,cos)( −=s , both previously

defined. If we graph them we get the following image. > display(plotvvf2(r,0,2*Pi,500,black,boxed), plotvvf2(s,0,2*Pi,500,black,boxed));

If we rotate the image around we see that there appears to be only one point of intersection between the two curves. You may want to increase the range of the parameter bounds in order to convince yourself that there will be only one point of intersection. Using the solve and evalf commands we get the following result. > solve({seq(r(t)[n]=s(u)[n],n=1..3)},{t,u});

= t ( )RootOf − − + _Z 1 4 ( )sin ( )arccos ( )sin _Z 4 4 ( )sin ( )arccos ( )sin _Z 2 ,{

= u ( )arccos ( )RootOf − − + _Z 1 4 ( )sin ( )arccos ( )sin _Z 4 4 ( )sin ( )arccos ( )sin _Z 2 }

> evalf(%); { }, = u − 0.2966037421 0.9999261483 I = t + 1.475618467 0.3434473762 I

As you can see, the numeric approximations to the parameter values have a substantial I component, one that cannot be ignored because of round-off error. Now if we did not see the image we would be inclined to think that the two curves did not intersect. Since we know that they do we need to use another method to find the point of intersection. Recall that the fsolve command finds real solutions to equations and systems of equations using numeric methods but simply changing solve to fsolve gives us an error since the fsolve command needs to have the same number of variables as it does equations. When solving for the parameters of two curves in three dimensions we have three equations and only two variables.

Page 24: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

> fsolve({seq(r(t)[n]=s(u)[n],n=1..3)},{t,u}); Error, (in fsolve) number of equations, 3, does not match number of variables, 2

One trick to get around this is to add a third, bogus, variable to the list of variables. Be careful that the variable you add has not already been defined as some value or expression. We will add a z to the list. > fsolve({seq(r(t)[n]=s(u)[n],n=1..3)},{t,u,z});

{ }, , = z 3.997794044 = t 0.4285478735 = u 1.142248453

Checking the t and u values, ignoring z, gives us the same point with a little round-off error. > r(.4285478735);

+ + 0.4155504301 eexx

0.9095701402 eeyy

0.6546356800 eezz

> s(1.142248453); + + 0.4155504304 ee

xx0.9095701401 ee

yy0.6546356796 ee

zz

Exercises: 1. The following exercises concern the vector-valued function ( ) 3

21 ,tan,)( −−−= t

tt tetb .

a. Define the vector-valued function ( ) 321 ,tan,)( −

−−= ttt tetb .

b. Find the tangent vector function of b and define it as tb. c. Find the limit of the norm of the tangent vector function as t approaches infinity. d. If t represents time what does the answer in part c represent? e. If you are a bug that is walking along the curve, in step with t, describe your

journey from 5=t to ∞=t . f. Plot the curve from 5=t to 10=t and on another graph plot the norm of the

tangent vector function also from 5=t to 10=t . Again, thinking of t as time relate the norm graph to the curve’s graph in terms of position, direction and speed.

2. The following exercises deal with plots of the norm of the tangent vector function. a. Create a command called normplot that takes thee inputs, the curve, a lower

bound for t and an upper bound for t and constructs the graph of the norm of the tangent vector function. That is, to plot the norm of the tangent vector function of a vector-valued function r from 5=t to 10=t the command would be,

> normplot(r,5,10);

Page 25: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

b. Create a command called normplotresy that takes 5 inputs, the curve, a lower bound for t and an upper bound for t, the lower bound for y and the upper bound for y and constructs the graph of the norm of the tangent vector function with the range restricted to the lower and upper bounds for y. That is, to plot the norm of the tangent vector function of a vector-valued function r from 5=t to 10=t and a restricted range from 2 to 7 the command would be,

> normplotresy(r,5,10,2,7);

c. Use these new commands to graph the tangent vector norm plots of the following functions. In each case give a detailed description the motion of a bug along each of the curves.

i. ( ) ( ) tttt ,cos,sin)( =r

ii. ( ) ( ) ( ) ( )ttttt 22 cossin,sin,cos)( −=s

iii. tttttt −−= 432 ,,)(k

iv. ( ) ( )ttt t ln,tan,)( 1=h

v. ( ) ( ) tttttt ,sin,cos)( =q

vi. 32 ,,)( tttt =p

3. Find the angle of intersection (smallest angle) between the curves tttttt −−= 432 ,,)(k and tttttt −−= 32 ,,)(j at each of the intersections points.

Plot an image of the curves and tangent vectors used to determine the intersection angle for each point of intersection.

4. Find the angle of intersection (smallest angle) between the curves

( ) ( ) tttt ,cos,sin)( =r and ( ) ( ) ( ) ( )ttttt 22 cossin,sin,cos)( −=s at each of the

intersections points. Plot an image of the curves and tangent vectors used to determine the intersection angle for each point of intersection.

5. Finding the points of intersection. a. Define and plot the following two curves, plot them in different colors.

( ) ( ) ( )tttt 3cos,5cos,sin)( =c and ( ) ( ) ( )tttt 5sin,3sin,cos)( =d

b. From the graph, how many point of intersection are there? c. Define a command curveint that takes two vector-valued functions as input and

does the solve command on them. So to find the points of intersection of the two curves above you simply need to type,

> curveint(c,d);

d. Use this new command to help find all the points of intersection between c and d. 6. Find all of the points of intersection between the two curves,

Page 26: Vector Valued Functions - Salisbury Universityfaculty.salisbury.edu/~despickler/personal/Resources/... · 2003. 8. 18. · Vector Valued Functions Introduction and Goals: The main

( )( ) ( ) ( )( ) ( ) ( )tttttt 20cos,sin20sin4,cos20sin4)( ++=f

and ( ) ( ) ( )tttt 5sin,cos4,sin4)( =g

7. Consider the two curves ( ) ( ) ( )ntttt sin,cos,sin)(

1=r and

( ) ( ) ( )ntttt cos,sin,cos)(2

=r , where n is a positive integer. Is there a relationship

between the number of points of intersection of the curves and the value of n? If so, what is it?

8. Consider the two curves ( ) ( ) ( )ntttt sin,cos,sin)(1

=r and

( ) ( ) ( )mtttt cos,sin,cos)(2

=r , where n and m are positive integers. Is there a

relationship between the number of points of intersection of the curves and the values of n and m? If so, what is it?

9. Create a new command called plotvvftv2 that does the same thing as plotvvftv except that instead of inputting evf, nlb, and nub you simply input a single number nv. The command should place nv evenly spaced tangent vectors along the plot of the curve starting at the beginning point of the curve and ending at the last point on the curve. So the beginning of the plotvvftv2 command should be,

> plotvvftv2:=(r,lb,ub,pts,col,axs,nv,shp,vcol)->

10. Use the command in the last exercise to plot the following curves along with a set of

30 evenly spaced tangent vectors along the portion of the curve that is being plotted. In each case, describe the motion of a particle moving along the curve considering t as time. Note that you may also need the normplot command to help describe the motion. a. tttttt −−= 432 ,,)(k

b. ( ) ( )ttt t ln,tan,)( 1=h

c. ( ) ( ) ( )tttt 3cos,5cos,sin)( =c

d. ( ) ( ) ( )tttt 5sin,3sin,cos)( =d

e. ( )( ) ( ) ( )( ) ( ) ( )tttttt 20cos,sin20sin4,cos20sin4)( ++=f

f. ( ) ( ) ( )tttt 5sin,cos4,sin4)( =g


Recommended