DOC PREVIEW
MSU PHY 102 - Worksheet 1

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 #1 - PHY102 (Spr. 2009)This worksheet introduces you to the use of Mathematica. Mathematica is aprogramming language developed by Stephen Wolfram which has many appli-cations,e.g., solving algebraic equations, differentiation, integration, makingplots in two and three dimensions, etc.. You will also solve a couple of simpleproblems in mechanics using Mathematica.Getting Started1. Logging in. A computer account has been set up on the linux computersin the computer lab in BPS1240. You will be handed a sheet of paperwith your login instructions by the instructor along with this worksheet.Sitting at a computer you should be faced with a login prompt. Enteryour username and password to log in.2. Start mozilla (click on the “earth” icon on the toolbar at the bottomof the screen) and access the group web-pagehttp://www.pa.msu.edu/ duxbury/courses/phy102/spring2009/PHY102.html3. Get to know the linux operating system and basic commands and ac-tions you will need to know to be able to do to carry out the assignmentsin this course. Download the “Introduction to linux computing” helpfrom the course home-page. You can print it out (print → print. Itwill come out on the printer in BPS1240) or read it online.4. To start a command window, “rightclick” on the mouse, then “click”on the “new terminal” option. Now follow the instructions on the handout page to change your password to one you will remember (but whichis still secure)5. To start Mathematica enter “Mathematica &” on a command line andthen press “enter” on your keyboard.6. From the courses www page, download and save the “getting started”mathematica notebook. Save it as yournameofchoice.nb This is a Math-ematica notebook and mathematica recognizes the “.nb” extension.1Open the notebook (file → open). Glance through the notebook andtry out some of the exercises. This is a handy reference which you willfind useful later when you get into difficulties. It introduces some fairlyadvanced stuff which you don’t need right now so don’t spend too muchtime in it, just glance through, play a bit, see what’s there, and go onto the exercises below:7. Exercises. Do not overwrite these exercises as you are doing them aspart of the assignment is to hand them in.(a) open a new notebook and save it to a new name (e.g., week01.nb)(b) Type your name in the top. Make sure that it is typed in a “text”group and not a “command group” (see the “getting started” note-book). Save the notebook again (develop good habits!)(c) Type “2+4” (now you do want to be in a “command group”...format→ Style → Input). Hold down the “shift” button in the key boardand push “enter” (each time you want to get the result for whatyou have typed, you have to type “shift+enter”). In the outputthe screen will give you back the result.(d) Type “10/2” to check that you’ll get 5 in the output.(e) To find the roots of an equation (e.g. x2− 1), type “Solve[x∧2-1== 0,x]”. In the output you’ll get +1 and -1 as the two roots.(f) Copying: using the mouse, highlight “Solve[x∧2-1 == 0,x]” thatyou typed above. Let go of the mouse button. Move the mousedown the page to a region below where you have typed. Click themiddle mouse button if you have a three button mouse, click theleft and right mouse buttons together (this takes some dexterity!)if you have a two-button mouse. This pastes the highlighted text.Alternatively, highlight then use edit → copy and edit → paste asfamiliar to microsoft windows users.(g) Deleting: to edit and delete text you have typed, use the mouseand arrow and delete keys in the usual way. To delete a wholegroup (including that pesky output you generated when you madea syntax error) highlight the group by clicking on the blue bracketat the right-hand side of the notebook. When the bracket is high-lighted hit delete.2(h) Factorize the expression x2− 1 to get the roots. In order to dothat type “Factor[x∧2-1]”, and check if you get (x+1)(x-1).(i) Mathematica has extensive plotting tools. For example plot thefunction sin(x). To do this type “Plot[Sin[x],{x,0,6.28}]”.(j) Help??? Mathematica has an extensive online help library. Trylooking up the sin(x) function to make sure you have the rightformat.(k) Here is an example how you can perform differentiation usingmathematica: suppose f(x) = xn; thendfdx= nxn−1. To checkit type “D[x∧n, x]” and see the output.(l) Likewise, you can perform integration on f(x) = xn. Type “In-tegrate [x∧n, x]” and assure yourself that you indeed get backxn+11+n.Assignment 1. - Deadline Thursday Jan. 22nd1. Examples. Hand in the results of the mathematica operations youexperimented with above.2. Problem 1. The displacement of a particle undergoing one dimen-sional motion under constant acceleration is given by the equationx(t) = ut +12at2. Choose values of u and a that you think are physi-cally reasonable. Find and plot x(t) and v(t) over a reasonable rangeof time (this depends on your choice of u and a). Note: In plotting,you can use “Plot[x[t],{t,0,5}]” or “Plot[Evaluate[x[t]],{t,0,5}]” afterdefining x[t]. Try both. What is the difference (look up Evaluate inhelp to find out)? Type a brief answer into your notebook (don’t forgetto set the


View Full Document

MSU PHY 102 - Worksheet 1

Download Worksheet 1
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 Worksheet 1 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 Worksheet 1 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?