DOC PREVIEW
MSU PHY 102 - work sheet 02

This preview shows page 1 out of 3 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Worksheet #2 – PHY102 (Spring 2011)Formats and List operations (Vectors)FormatingFrom the Mathematica toolbar try the following: “format” followed by“style.” The dropdown menu offers you lots of options. The default is “in-put,” and that is format in which you do calculations. However Mathematicaalso allows various fonts and styles of text input. In this problem set, youshould include a text “cell” before each problem to identify the problem (e.g.Problem 1), and a text cell at the top of the page with your name and thenumber of the worksheet (e.g. “Worksheet 2”).Last week we did derivatives and integrals using the full Mathemat-ica commands. However many of these commands may be entered from“palettes”. To activate a palette, click on the Palettes menu on the toolbar,and choose one, e.g., Basic Math Assistant.When you get into troubleSometimes you will try to use a variable in more than one way. Thiscan confuse Mathematica. There are several ways to clear a variable a, forexamplea = . which clears a numerical assignment to a, andCl ear[a[x]] which clears a function assignment to a[x].If you want to remove all of your prior definitions you can use,Remove[“Global ‘ ∗ ”]At some point Mathematica will get really unhappy and start doing a reallylong-winded calculation which you did not think you asked it to do. Inthat case you can go to the “kernel” tab, and click on “abort evaluation”.Sometimes that does not work, in which case you can click on “quit kernel”.This stops the Mathematica kernel and you lose the evaluations you havealready carried out. (It may take a little time to die; you can use that timeto swear at it silently. If that doesn’t work, you can kill the Mathematicaprocess that is running — if necessary by opening a terminal and runningthe unix command “top” to find the number of the process, and then using1the unix command “kill n nnn ” where nnnn is the process number.)Lists and VectorsBy 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 secondlaw of motion~F = md2~rdt2(1)the quantity m (mass) is a scalar. But the force~F and the acceleration~a =d2~rdt2are vectors. As you can see in Eq. (1), and which is true in general,multiplying a vector ~a by a scalar m gives a vector~F . A vector is describedby its components in a chosen co ordinate system. For example a vector~A in cartesian coordinates is given by (or more precisely, represented by)~A = (Ax, Ay, Az).In Mathematica, vectors are represented in the same way. The object iscalled a list, because it can be used for more general objects such as matricesand tensors. In this worksheet we only work with vectors.Type “A = {Ax, Ay, Az}”. This means Mathematica associates theobject A with t he list {Ax, Ay, Az}. Now type “B = {Bx, By, Bz}”. Type“Dot[A,B]”. This will give the dot product~A·~B=AxBx+AyBy+AzBz. (Youcan also get this by just typing A · B.) As you know, this dot product isequal to |A||B| cos(θ), where θ is the angle between t he vectors~A and~B.Likewise, the cross product of two vectors (~A ×~B) yields another vec-tor~C = {AyBz-AzBy, AzBx-AxBz, AxBy-AyBx}. Type “Cross[A,B]” andverify that you indeed get the above expression in terms of the componentsof~A and~B. Unit vectors can be easily written with lists as: ˆx = {1,0,0},ˆy = {0,1,0}, ˆz = {0,0,1}. Check by using Mathematica that ˆx · ˆy = ˆy · ˆz =ˆz · ˆx = 0.You can see that the elements in the list {Ax, Ay, Az} of the vector~A = Axˆx + Ayˆy + Azˆz are its x, y, and z components. How do we accessthe individual components from A? Easy! – just type “A[[2]]” and checkthat this gives Ay. How would you get Mathematica to p rint out the secondelement of the cross product “Cross[A,B]”?2Assignment #2.Problem 1. Consider two vectors~A = (√32,12, 0), and~B = (12,√32, 0). UsingMathematica:(i) Check that they are both of unit magnitude.(ii) Find~A ·~B.(iii) Find the angle between these two vectors.(iv) Find the cross pr oduct of these two vectors.Problem 2. Consider the unit vectors along x, y, and z directions: ˆx ={1,0,0} ˆy = {0,1,0} ˆz = {0,0,1}. Verify that ˆx × ˆy = ˆz, ˆy × ˆz = ˆx, ˆz × ˆx = ˆy.Problem 3. Verify for any three vectors~A,~B, and~C, that~A × (~B ×~C) =~B(~A ·~C) −~C(~A ·~B).Problem 4. The motion of a particle is given by ~r(t)=A(ˆx cos(ωt) +ˆy sin(ωt)), where A and ω are constants. Find its velocity ~v. Calculate~Ω × ~r where~Ω = (0, 0, ω), and verify that ~v =~Ω × ~r. Do you recognise thismotion? Plot the motion to confirm your intuition (use the help menu tolook up how to use the command “ParametricPlot” for this problem—youwill need to choose values for a and


View Full Document

MSU PHY 102 - work sheet 02

Download work sheet 02
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view work sheet 02 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view work sheet 02 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?