Formating
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
![]() |
(1) |
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
=AxBx+AyBy+AzBz which
is the same as
, where
is the angle between
the vectors
and
.
Likewise, the cross product of two vectors (
) yields
another vector
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
and
.
Unit vectors can be easily written with lists as:
1,0,0
,
0,1,0
,
0,0,1
.
Check with Mathematica that
.
You can see that the elements in the list Ax, Ay, Az
of the
vector
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
, and
. 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:
1,0,0
0,1,0
0,0,1
.
Verify:
,
,
.
Problem 3.
Verify that for any three vectors ,
, and
that
.
Problem 4.
The motion of a particle is given by
=a(
cos(
t) +
sin(
t))
Find its velocity
. Calculate
,
where
, and and verify
. 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
.).