Application Center - Maplesoft

# Vectors in Maple

You can switch back to the summary page by clicking here.

vectors.mws

Vectors in Maple

By: Alejandra Folguera

Laguna Blanca School

This worksheet is used in a program called MAPLE MATH.  I have the students meet at the computer lab once a week to work through problems written as a Maple worksheet.  They need to provide (sentence) answers and explanations and write (or copy/paste) code to solve problems.  The topics were chosen to fit my curriculum needs of the moment, either to review or expand the exposure time for a topic.

Problem 1

Part a)

See the two vectors below.  They live in a 2D space.

 > restart:with(plots): arrow({[3,5],[-1,2.5]}, width=[0.01, relative], head_length=[0.05, relative], color=red);

Warning, the name changecoords has been redefined

Your turn now.  Draw two different vectors in 2D. (Use copy-paste...do not re-write the Maple code).

Look carefully at the next Maple input.  What are each of the arrows that appears when you execute the cell?

 > v1 := arrow([3,5], shape = arrow, color = blue): v2:= arrow( [-1,2.5], shape = arrow, color = red): sumvectors := arrow([3,5]+[-1,2.5], shape = arrow, color = green): display({v1,v2,sumvectors});

Here is the same plot as before, but two of the arrows have been labeled.

What should be the label of the third arrow?  Type it were the question mark is now.

 > restart: with(plots): v1 := arrow([3,5], shape = arrow, color = blue): v2:= arrow( [-1,2.5], shape = arrow, color = red): sumvectors := arrow([3,5]+[-1,2.5], shape = arrow, color = green): t1:=textplot([1.5,2,`vector WHO? `]): t2:=textplot([-0.5,1,`vector WHO? `]): t3:=textplot([0.8,4,`WHO AM I?`]): display(v1,v2,sumvectors,t1,t2,t3);

Warning, the name changecoords has been redefined

Here are the same three vectors, almost.  What is the same?  What is new?  Type the labels for the vectors

 > v1 := arrow([3,5], shape = arrow, color = blue): v2:= arrow({[[3,5], [-1,2.5]]}, shape = arrow, color = red): sumvectors := arrow([3,5]+[-1,2.5], shape = arrow, color = green): t1:=textplot([1.5,2,` vector WHO? `]): t2:=textplot([3,6.5,` vector WHO? `]): t3:=textplot([0.8,4,`WHO AM I?`]): display(v1,v2,sumvectors,t1,t2,t3);

Now copy-paste the instructions in the last two groups of cells for your two vectors.  Does it work the same way as in the notebook's example?

Write a rule on that explains how to add vectors.

Part b)

See the vector below.

 > restart: with(plots): v := arrow([3,5], shape = arrow, color = blue): t1:=textplot([3,5,` my vector `], align=ABOVE): display(v,t1);

Warning, the name changecoords has been redefined

See the what happens if we multiply the vector times a constant:

 > restart: with(plots): k:=2: x:=3: y:=5: v := arrow([x,y], shape = arrow, color = blue): v_times_k := arrow([x*k,y*k], shape = arrow, color = blue): t1:=textplot([x,y,` my vector `], align=ABOVE): t2:=textplot([x*k,y*k,` my vector times k`], align=ABOVE): display(v,v_times_k,t1,t2);

Warning, the name changecoords has been redefined

Try with several values of k and different vectors.  Describe the effect of multiplying a vector by a number.  Make sure you include the cases , and .

Part c)  Tutorial problem

Suppose a heavy chandellier, say which weighs 100lbs was hanging from the ceiling from two chords that make an angle of 60 degrees with the ceiling.

What would be the tension in each of the chords?  Assume that they support the same amount of weight.

The first thing to do, is to draw a figure representing the forces in the problem.  Notice how clever we have to be to make the angles of the chords with the ceiling come out just right! (By the way...the chandelier was sooo lovely...but you will have to imagine it, sitting there, at the origin).

Since we do not know the magnitude of the force exerted by the chords at the moment, we will create a variable, called chord_force and just guess an initial value for it.  Since the weight is 100 lbs, and the chords are equal, why don't we go 50-50?

 > restart; with(plots): chord_force:=50; weight:= arrow([0,-100], width=[0.01, relative], head_length=[0.05, relative], color= blue): t1:=textplot([1, -chord_force, `weigth`]): chord1:= arrow([chord_force*cos(Pi/3), chord_force*sin(Pi/3)], width=[0.01, relative], head_length=[0.05, relative], color= red): t2:=textplot([15, 20, `chord`]): chord2:= arrow([-chord_force*cos(Pi/3), chord_force*sin(Pi/3)], width=[0.01, relative], head_length=[0.05, relative], color= red): t3:=textplot([-15, 20, `chord`]): display(weight, t1, chord1, t2,chord2, t3);

Warning, the name changecoords has been redefined

Let's replace the two chords by their combined effect:

 > restart; with(plots): chord_force:=50; weight:= arrow([0,-100], width=[0.0001, relative], head_length=[0.05, relative], color= blue): t1:=textplot([1, -50, `weigth`]): chords:= arrow([chord_force*cos(Pi/3), chord_force*sin(Pi/3)]+[-chord_force*cos(Pi/3), chord_force*sin(Pi/3)], width=[0.0001, relative], head_length=[0.05, relative], color= red): t2:=textplot([1, 20, ` sum of the chords`]): display(weight, t1, chords, t2);

Warning, the name changecoords has been redefined

The value that we have originally guessed for the force that each chord is putting out, 50 lbs, is clearly not right!

The way things are looking right now, that chandelier is falling.

Play with the value of chord_force in the code above, until the red arrow exaclty balances the blue one.

What is that value?

That was fun...but there must be a way to do this "mathematically"...

Sure there is, you say:  "Looking at the second coordinates of the blue and the red arrow and setting them equal to the negative of each other should do the trick", you say.

How did you get so smart?

 > restart; solve( chord_force*sin(Pi/3)+ chord_force*sin(Pi/3)=100,chord_force);

To convert that answer to a decimal that you can compare with your own guess we use the evalf command:

 > restart; evalf(solve( chord_force*sin(Pi/3)+ chord_force*sin(Pi/3)=100,chord_force));

 >

Were you close to this answer in your guess?

Part d)  Your turn

There is this monkey, you see.  He likes to hang from two bars at the top of his cage (oh yes, he lives in a cage).

He weighs 60 lbs.  He is a good monkey, but very curious.  He would like to know how much force are each of his arms doing when he hangs like that.

If he could talk, he would tell you that his two long arms make an angle of alpha with the ceiling of his cage.

Using the code from the previous part, suitably addapted for this problem, draw a diagram that represents the forces in this problem for alpha = 30, 45 and 60 degrees.  Find the force that each arm must excert in order for the monkey to stay up there, hanging.  When does he have to excert more force?  What would be the force in each arm if he hanged with his two arms together over his head?  What does your model tell you for the case in which he hangs on to two bars directly to the side of his body.  What would be the force then?