ALA K+Kf+Bt, del a, ht 2002

Goal:

To understand vectors and fundamental vector algebra, including projection and matrix-vector multiplication, and the arithmetics for complex numbers.

Program:

1. Start matlab and run your matlab script setpath, which should add guis/ascii and guis/binaries to matlabs search path.

2. Give the command   open('RM+.fig')   to open the Road Map to the Mathematics Laboratory, and press the Vector C button to activate the Vector Calculator. Alternatively you may start the Vector Calculator directly from the matlab prompt by the command   open('V.fig'). 

3. To get familiar with the Vector Calulator, follow this tour:
Start by pressing clear.
Create a new vector by giving a return in the   new v =   edit box.
Press the edit button and change the vector by point-dragging the arrow of the vector. Notice the component representation of the vector and make sure you fully understand how it works.
Create another vector but this time by pressing the create button and then defining the vector simply by drawing it with the mouse with the (left) mouse button down, or just clicking at the desired point of the vector arrow. If you would like to define another vector, just release the mouse button and draw again.
To change to edit mode, press the edit button and you can edit any vector you like. The select button is for just selecting/highligting a vector without wanting to change it. Also, try the delete function.
Next try the scaling function by giving a scal factor in the scale by edit box (followed by a return), which scales the current vector by the given scale factor. The invert function is a special case corresponding to scaling by   -1.  Also the normalize function is a special case corresponding to scaling by   1 / ||v||,  where   ||v||   is the norm, or length of   v.  Try to normalize a given vector (  [.5 .5]   for example) manually trough the scale by function!
Next see to it that you have two vectors, one with the name   v   and another one by the name   u,  say. You name a vector by entering the desired name in the save as edit box (and giving a return). The default name at creation time is   v,  as you may have noticed.
Now add   u   and   v   by first highligting   u   (by the select function), then pressing the add button, and then clicking at the   v   vector. Note how the sum   u + v   of   u   and   v   is defined. To further explore how   u + v   depends on   u   and   v,  press the edit button and move around   u   and   v   by point-dragging. Repeat with the (minus) operation.
Next study the projection of   u   onto (the direction of)   v   by following the same scheme; first select   u,  then press the   -> proj ->   button, and then click at   v.  Again, study how the projection depends on   u   and   v   by pressing the edit button and then moving around   u   and   v.  Which three factors determine the length of the projection vector? What is its direction? When does the projection vector degenerate to length   0   ?
To study the transformation of a vector when multiplied by a matrix, press the   Au -> u   button. Seek matrices that a) does not change   u   at all (leaves   u   fixed/ for which   u   is a fixed point), b) rotates   u   half a turn (inverts   u  ), c) rotates   u   90   degrees in the counter-clockwise direction, d) rotates   u   45   degrees in the clockwise direction, e) projects   u   onto the   x -  axis.
What does the matrix   [cos(.1) -sin(.1); sin(.1) cos(.1)]   do to a vector   u  ?
What does the function   inv(A) u -> u   transformation do?
Are there matirces that leave some vectors   u   unchanged but change others? Hint: try   A = [ 1 0; 0 -1]. 
For the matrix   A = [ 1 0; 0 -.9],  find vectors which do not change direction while transformed by   A,  and vectors that flips to the opposite direction when transformed by   A
Now turn to complex multiplication. Define vectors   u   and   v.  Highlight   u   (by the select button and clicking at   u  ), then press the   compl*   button and then click at   v.  Then study how   u * v   depends on   u   and   v   by pressing the edit button and moving   u   and   v   around. Make sure you get to understand what you see!
Then repeat with the   compl/   operation.

4. Now answer the following questions: a) Which vector should be added to   [1 1]   to give   [0 .5].  Draw your answer and name it MyAnswer. To check your answer, define vectors   u = [0 .5]   and   v = [1 1]   (using   new=   and save as) and then compute   u - v
b) What is the projection of   u = [-1 .5]   onto   v = [1 0],  [0 1]   and   [1 1],  respectively. Again, check your answer by defining   u   and   v   as stated, and computing the projection of   u   onto   v
c) Which complex number should be multiplied by   (1+i)   to give   -1.  Check your answer by defining   u = [-1 0]   and   v = [1 1]   (corresponding to   -1   and   1 + i,  respectively), and then computing   u / v
d) How does the matrix   [1 -1; -2 0]   transform the vector   [.5 .5]  ? Check your answer by defining corresponding   A's   and   u's   and pressing   Au - > u

/Kenneth


Last modified: Tue Aug 15 15:18:36 MET DST 2000