next up previous
Next: About this document ...

Worksheet #2 - PHY102 (Spr. 2005)
Due Thursday 27th January

Formats and List operations (Vectors)


From the toolbar do the following: ``format'' followed by ``style'', the dropdown menu offers you lots of options. ``input'' is the default, and is the ``format'' in which you do calculations. However Mathematica also allows various fonts and styles of text input. In this problem set you should include a text ``cell'' before each problem which identifies the problem (e.g. Problem 1), and a text cell at the top of the page with your name and the number of the worksheet (e.g. ``worksheet 2'').

Last week we did derivatives and integrals using the full Mathematica commands. However many of these commands may be entered from ``palettes''. To activate a palette, from the toolbar do the following: ``file'' followed by ``palettes''. You have several options: ``basic input'' is one I like.
The reference material for this worksheet is sections 1.2.1 - 1.2.6 of the practical introduction to mathematica. Your should read this material as you work through the excersizes below.

Lists and Vectors

By now you must have read about vectors. A vector is a quantity which, unlike a scalar, can have many components. For example in Newton's second law of motion

\end{displaymath} (1)

the quantity m (mass) is a scalar. But the force $\vec{F}$ and the acceleration $\vec{a}=\frac{d^2\vec{r}}{dt^2}$ are vectors. As you can see in Eq. (1), and which is true in general, multiplying a vector $\vec{a}$ with a scalar m, gives a vector $\vec{F}$. A vector is described by its components in a chosen co-ordinate system. For example a vector $\vec{A}$ in cartesion co-ordinates is given by, $\vec{A}=(A_x,A_y,A_z)$.

In Mathematica vectors are represented in the same way. In Mathematica this object is called a list, because it can be used for more general objects such as matrices and tensors. In this worksheet we just work with vectors. Type ``A = $\{$Ax, Ay, Az$\}$''. This means Mathematica associates the object A with the list $\{$Ax, Ay, Az$\}$. Now type ``B = $\{$Bx, By, Bz$\}$''. Type ``Dot[A,B]''. This will give the dot product $\vec{A}\cdot{\vec{B}}$=AxBx+AyBy+AzBz which is the same as $\vert A\vert\vert B\vert cos(\theta)$, where $\theta$ is the angle between the vectors $\vec{A}$ and $\vec{B}$.

Likewise, the cross product of two vectors ( $\vec{A}\times\vec{B}$) yields another vector $\vec{C} = \{$AyBz-AzBy, AzBx-AxBz, AxBy-AyBx$\}$. ``Type Cross[A,B]'' and verify that you indeed get the above expression in terms of the components of $\vec{A}$ and $\vec{B}$. Unit vectors can be easily written with lists as: $\hat{x} = \{$1,0,0$\}$, $\hat{y} = \{$0,1,0$\}$, $\hat{z} = \{$0,0,1$\}$. Check with Mathematica that $\hat{x}\cdot\hat{y} =
\hat{y}\cdot\hat{z} =
\hat{z}\cdot\hat{x}= 0$.

You can see that the elements in the list $\{$Ax, Ay, Az$\}$ of the vector $\vec{A} = \hat{x}A_x + \hat{y}A_y + \hat{z}A_z $ are its x, y, and z components. How do we access the individual components from A?.

Type ``A[[2]]'' and check that this gives Ay. How would you get Mathematica to print out the second element of the cross product ``Cross[A,B]''?

Assignment 2. - Hand in by Thursday Jan. 27
Problem 1. Consider two vectors
$\vec{A} = (\frac{\sqrt{3}}{2},\frac{1}{2},0)$, and $\vec{B}= (\frac{1}{2},\frac{\sqrt{3}}{2},0)$. Using Mathematica:
(i) Check that they are both of unit magnitude.
(ii) Find
(iii) Find the angle between these two vectors.
(iv) Find the cross pruduct of these two vectors.

Problem 2. Consider the unit vectors along x, y, and z directions: $\hat{x} = \{$1,0,0$\}$ $\hat{y} = \{$0,1,0$\}$ $\hat{z} = \{$0,0,1$\}$. Verify: $\hat{x}\times\hat{y}=\hat{z}$, $\hat{y}\times\hat{z}=\hat{x}$, $\hat{z}\times\hat{x}=\hat{y}$.

Problem 3. Verify that for any three vectors $\vec{A}$, $\vec{B}$, and $\vec{C}$ that $\vec{A}\times(\vec{B}\times\vec{C})=

Problem 4. The motion of a particle is given by $\vec{r}(t)$=a($\hat{x}$cos(${\omega}$t) + $\hat{y}$sin(${\omega}$t)) Find its velocity $\vec{v}$. Calculate ${\vec{\Omega}} \times \vec{r}$, where $\vec{\Omega}=(0,0,\omega)$, and and verify $\vec{v}={\vec{\Omega}} \times \vec{r} $. Do you recognise this motion? Plot the motion to confirm your intuition (use the help menu to look up how to use the command ``ParametricPlot'' for this problem - you will need to choose values for a and ${\omega}$.).

next up previous
Next: About this document ...
Phil Duxbury