DOC PREVIEW
CSBSJU PHYS 370 - Mathematica Assignment

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:

Mathematica AssignmentAnyone who cannot cope with mathematics is not fullyhuman. At best he is a tolerable subhuman who haslearned to wear shoes, bathe and not make messes in thehouse.Time Enough for LoveRobert Heinlein1 IntroductionComputational tools beyond handled calculators are now a necessary part of any physicistsrepertoire. There are a wide variety of available tools including computer codes that arewritten to solve specific problems, mainstream software tools (such as spreadsheets anddatabases) which can be applied to physics problems and finally mathematical tools (suchas Mathematica, Matlab, Maple, Mathcad, et cetera). We will make use of tools of all ofthese types in this course. The purpose of this exercise is to introduce you to one of thesemathematical tools, Mathematica. Mathematica distinguishes itself from its competitorswith its abilities to do exact symbolic, as well as numerical, calculations. These abilitiesallow Mathematica to, for example, give the solution ofZcos(x)dx = sin(x),while most other programs would only be able to solve problems such asZπ/20cos(x)dx = 1.0.In this exercise, you will first work through a Mathematica tutorial to get an ideaof Mathematics’s abilities. Then you will use Mathematica to work a more complicatedphysics problems.2 TutorialStart up Mathematica (this tutorial can be run on any OS that Mathematica works on).For this tutorial you will have two choice. You can you the old-fashioned text-basedtutorial or a video screencast. It is up to you which one to try — you should get similarinformation from each.If you want to use the text based tutorial, find and open up the “Ten Minute Tutorial”– there should be a link to it off of this lab (or the lab web site). Do not let the namefool you — it should take you much more than 10 minutes.1If you want to use the screencast, go to the “Hands on Start to Mathematica”http://www.wolfram.com/broadcast/screencasts/handsonstart/. If you do thescreencast when other people are around, please make sure that you use headphones. Iwill not be responsible for any violence inflicted on you by other people if you blast thisscreencast in a public lab.As you are working through the tutorial feel free to change things in the examples.Try out different numbers, functions, et cetera so that you have a better idea of howMathematica works. Save a copy of the the tutorial in your home directory so that youcan keep track of the changes you make while working through the tutorial.Complete the following exercises based on the tutorial. Where appropriate print outplots and segments of Mathematica code showing your answers and tape them into yourlab notebooks. Also answer the questions in your lab notebook.The easiest way to answer the following questions is probably to have two Mathematicawindows open. Keep the tutorial open in one window, and do your calculations in separatewindow. In your calculations window you can copy and paste all of the questions below.Then you complete each calculation under the corresponding question. When you aredone you can just print the results from your window. Also, do not forget to include awritten answer where one is requested.The page numbers below refer to where you will find similar calculations in the texttutorial.1. (p. 3) Calculate 2131to the 31 power and 21.31power. What is the differencebetween these results? Why are they different? Which answer would most othermathematical tools give? Why?2. (p. 5) Get a numerical expression for the first 40 digits of eπ.3. (p. 6) Expand and simplify (a + b)(a − c)(b − d) + (d − c)(b − a)(c + a).4. (p. 8) Plot sin x, sinh x, and sin (sinh (x)) from 0 to 5 on the same plot. Also plotin three dimensions the functionarctan x ln yover the range from 0 to 5 for x and over the range from 1 to 3 for y.5. (p. 9) Calculateddxarcsinh (ax) arcsinh (bx).The computeZarctan (ax).Integrate the result. Finally, numerically integrateZ∞−∞e−2x2.6. (p. 11) Solve the system of equations x2− y2= a and x + 3y = b.7. (p. 13) Solve and plot the solution to the differential equationd2ydx2+ y + 10 = 0,where y(0) = 0 and y0(0) = 0.23 Nonlinear PendulumIn this part you will put to use some of the Mathematicacommands that you learned above. In deriving the motionof a simple pendulum (as seen on the right), using torques(or forces) leads to the equation of motion:d2θdt2+glsin θ = 0 (1)lmθIn order to get this equation in the form of the simple harmonic oscillator equation,we typically assume that the angle θ is small so that sin θ ≈ θ, which results in:d2θdt2+glθ = 0 (2)In this exercise you will explore how justified this approximation is. In some parts ofthis exercise you may have to force Mathematica to make more precise calculations.You may have to use the Accuracy, WorkingPrecision, AccuracyGoal, and PrecisionGoalstatements to get useful results. For the purposes of this exercise we will set g/l = 1to simplify the math. We will also assume that the pendulum always starts out at rest(dθdt(t = 0) = 0).1. Find how varying the starting angle alters the angular frequency of the pendulumwhen you don’t make the small angle approximation. Use Mathematica to solvethe pendulum differential equation above for the case where the initial pendulumamplitude (angle) is 1 radian. From this solution, find the pendulum frequency(1/period) for this case. You will probably want to use the NDSolve and FindRootfunctions to do this.Next, solve this equation for initial amplitudes from 0 to π/2 radians and then plotthe pendulum frequency versus pendulum (angle) amplitude for your results. Also,on the same figure include a plot of what the angular frequency versus amplitudeis assuming the pendulum is a simple harmonic oscillator. Take enough points sothat you get a fairly smooth curve. You don’t have to use Mathematica to plot yourresults — any plotting program is fine.2. Calculate at what amplitude the angular frequency differs from the ideal angularfrequency by 10 % ? By 1 % ? By 0.01 % ? By 0.0001 % ? What does this tellyou about the accuracy of the small angle approximation? Under what conditionsis this approximation valid?3. One of the applications of pendulums is in clocks. Calculate how long it would takefor a clock using this pendulum to be displaying a time that is off by a minute ifthe amplitude of the pendulum is 0.1◦? 1◦? 10◦? 30◦?


View Full Document

CSBSJU PHYS 370 - Mathematica Assignment

Download Mathematica Assignment
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 Mathematica Assignment 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 Mathematica Assignment 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?