DOC PREVIEW
MSU PHY 102 - worksheet04

This preview shows page 1 out of 2 pages.

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

Unformatted text preview:

Worksheet #4 – PHY102 (Spring 2011)Solving equationsSolving equations in MathematicaLook up how to solve algebraic equations exactly(Solve) and numerically(NSolve). If you have atranscendental equation (e.b. x = sin(x)) you need to use “FindRoot,” which will involve tellingMathematica where to begin looking for the root—since there may be more than one of them.In simple kinematics and simple applications of Newton’s second law, the physics is often describedby a second order linear differential equation. This may be solved analytically using DSolve, ornumerically using NDSolve. We shall consider initial value problems in which it is necessary tospecify the initial conditions. In Newton’s second law, this is the initial position and velocity. Anexample is:DSolve[{ x’’[t] + 0.05 x’[t] +x[t] == 1,x’[0]==0,x[0]==2},x[t],t]Note the double equals (“==”) occurs in all of the “Solve, DSolve ...” functions. It is Mathemat-ica’s way of expressing a “Truth” statement. Use the Mathematica help index to look up DSolveand see some other examples.Extracting what you wantThis is a pretty confusing, but essential, part of the Mathematica syntax. The solutions are givenas a list of substitution rules. First you have to choose the element of the output list that youwant. Then you have to correctly use the substitution rule. For example,s = Solve[x^2 == 16]will gives = {{-4},{4}}If you want the cube of the second of these solutions, you can usex^3 /. s[[2]]1ProblemsProblem 1.(i) Find and print the real root of the equation:x3+ 2x2+ x = 1 .Then print the cosine of that root. Also print the numerical value of that root, using the N[...]function.(ii) Plot the two functions, x and 2 tanh(x), on the same graph (use Plot). Then find and printthe largest real root of th e equation.x = 2 tanh(x) .(iii) Find the largest real solution to the equation sin(x) − x/100 = 0 . Hint: use the Plot functionto see what you’re up against, and to find an appropriate starting point.Problem 2.Set up the differential equation for the displacement x(t) of a simple harmonic oscillator withmass m = 1 and angular frequency ω = 2. Use Mathematica to solve this differential equation(DSolve) to find x as a function of t. Plot its kinetic energy as a function of time, given x(0) = 5,v(0) = x′[0] = 0. Now add damping to the equation, in the form 0.05x′(t). Repeat your calculationwith this damping term. Plot over a time that includes at least 10 periods of the motion. Is thisunderdamped or overdamped motion? Put your answer (including explanation!) in a text cell (Thedistinction b etween underdamped and overdamped is based on whether or not the displacement os-cillates. The borderline is called critically damped, which is the case where the system approachesequilibrium most rapidly.)Problem 3.A projectile is thrown from earth with initial speed u at an angle θ above the horizontal.(i) Program Mathematica functions describing its equations of motion along the x and the ydirections as a function of time.(ii) Program Mathematica to “Solve” for the range of this projectile motion using these functions.At what angle to the horizontal is the range


View Full Document

MSU PHY 102 - worksheet04

Download worksheet04
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 worksheet04 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 worksheet04 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?