Physics with Mathematica Fall 2013 Exercise #1 27 Aug 2012

Similar documents
Physics with Matlab and Mathematica Exercise #1 28 Aug 2012

Resonance and response

PH 120 Project # 2: Pendulum and chaos

Problem 1: Lagrangians and Conserved Quantities. Consider the following action for a particle of mass m moving in one dimension

Work sheet / Things to know. Chapter 3

PHYS2330 Intermediate Mechanics Fall Final Exam Tuesday, 21 Dec 2010

28. Pendulum phase portrait Draw the phase portrait for the pendulum (supported by an inextensible rod)

Grade 11/12 Math Circles Conics & Applications The Mathematics of Orbits Dr. Shahla Aliakbari November 18, 2015

Lecture 6, September 1, 2017

Chapter 1, Section 1.2, Example 9 (page 13) and Exercise 29 (page 15). Use the Uniqueness Tool. Select the option ẋ = x

Introductory Physics. Week 2015/05/29

Physics 351, Spring 2017, Homework #2. Due at start of class, Friday, January 27, 2017

Phys 243 Lab 7: Radioactive Half-life

Physics 115/242 Comparison of methods for integrating the simple harmonic oscillator.

2t t dt.. So the distance is (t2 +6) 3/2

FOUNDATION STUDIES EXAMINATIONS June PHYSICS Semester One February Main

Computational Physics (6810): Session 8

Section 3.7: Mechanical and Electrical Vibrations

4. Sinusoidal solutions

Physics 202 Laboratory 3. Root-Finding 1. Laboratory 3. Physics 202 Laboratory

Solutions for the Practice Final - Math 23B, 2016

Exam Question 10: Differential Equations. June 19, Applied Mathematics: Lecture 6. Brendan Williamson. Introduction.

Chapter 14 (Oscillations) Key concept: Downloaded from

Welcome. to Electrostatics

Distance travelled time taken and if the particle is a distance s(t) along the x-axis, then its instantaneous speed is:

Notes for Special Relativity, Quantum Mechanics, and Nuclear Physics

Symmetries 2 - Rotations in Space

Physics 200 Lecture 4. Integration. Lecture 4. Physics 200 Laboratory

Plane Curves and Parametric Equations

S12 PHY321: Practice Final

Notes on the Periodically Forced Harmonic Oscillator

Math 312 Lecture Notes Linear Two-dimensional Systems of Differential Equations

Lecture XXVI. Morris Swartz Dept. of Physics and Astronomy Johns Hopkins University November 5, 2003

Physics 105, Spring 2015, Reinsch. Homework Assignment 1 (This is a five page document. More hints added Feb. 2, 9pm. Problem statements unchanged.

Final 09/14/2017. Notes and electronic aids are not allowed. You must be seated in your assigned row for your exam to be valid.

PHYSICS 311: Classical Mechanics Final Exam Solution Key (2017)

AP Physics C 2015 Summer Assignment

Section 6.5 Modeling with Trigonometric Functions

2.3 Oscillation. The harmonic oscillator equation is the differential equation. d 2 y dt 2 r y (r > 0). Its solutions have the form

Lecture 15 - Orbit Problems

Contents. Contents. Contents

Physics 351 Monday, January 22, 2018

Lecture 41: Highlights

FOUNDATION STUDIES EXAMINATIONS September 2009

The object of this experiment is to study systems undergoing simple harmonic motion.

MATH Max-min Theory Fall 2016

Energy in Planetary Orbits

Vectors and Coordinate Systems

Massachusetts Institute of Technology Physics Department. Physics 8.20 IAP 2005 Special Relativity January 28, 2005 FINAL EXAM

Two-Body Problem. Central Potential. 1D Motion

Damped harmonic motion

Physics 9 Spring 2012 Midterm 1 Solutions

Massachusetts Institute of Technology Physics Department

Question: Total. Points:

The Schrödinger Equation

Solutions to the Homework Replaces Section 3.7, 3.8

4.1 KINEMATICS OF SIMPLE HARMONIC MOTION 4.2 ENERGY CHANGES DURING SIMPLE HARMONIC MOTION 4.3 FORCED OSCILLATIONS AND RESONANCE Notes

Physics 342 Lecture 17. Midterm I Recap. Lecture 17. Physics 342 Quantum Mechanics I

AP Physics 1 Summer Assignment-2018

Midterm 1 Review. Distance = (x 1 x 0 ) 2 + (y 1 y 0 ) 2.

Matlab Sheet 3. Plotting in Matlab

Analytical Mechanics - Extra Problems

UNIT 18 RADIOACTIVITY. Objectives. to be able to use knowledge of electric and magnetic fields to explore the nature of radiation

This is the number of cycles per unit time, and its units are, for example,

Double Spring Harmonic Oscillator Lab

Chapter 15 Periodic Motion

Physics III: Final Solutions (Individual and Group)

PHYSICS. Chapter 15 Lecture FOR SCIENTISTS AND ENGINEERS A STRATEGIC APPROACH 4/E RANDALL D. KNIGHT Pearson Education, Inc.

WEEK 7 NOTES AND EXERCISES

Laboratory handout 5 Mode shapes and resonance

Chapter 14. Oscillations. Oscillations Introductory Terminology Simple Harmonic Motion:

Sunrise, Sunset and Mathematical Functions

a. What is the angular frequency ω of the block in terms of k, l, and m?

21 Linear State-Space Representations

Springs: Part I Modeling the Action The Mass/Spring System

Ideas from Vector Calculus Kurt Bryan

[Disclaimer: This is not a complete list of everything you need to know, just some of the topics that gave people difficulty.]

USING THE EXCEL CHART WIZARD TO CREATE CURVE FITS (DATA ANALYSIS).

Chapter 14 Oscillations. Copyright 2009 Pearson Education, Inc.

AP Physics 1 Summer Assignment

Oscillatory Motion SHM

Numerical Methods for Inverse Kinematics

Physics 8, Fall 2011, equation sheet work in progress

2.1 Exponential Growth

Mechanics IV: Oscillations

Kinematics in Two-Dimensions

Planar Motion with Constant Acceleration

FOUNDATION STUDIES EXAMINATIONS June PHYSICS Semester One February Main

Pre-Calculus Honors Summer Assignment June 2016

Chapter 14 Oscillations

The Harmonic Oscillator

Graphical Analysis and Errors - MBL

Essential Mathematics for Computer Graphics

1. Introductory Examples

Solution Set Five. 2 Problem #2: The Pendulum of Doom Equation of Motion Simple Pendulum Limit Visualization...

Classical Mechanics Phys105A, Winter 2007

QUANTUM MECHANICS I PHYS 516. Solutions to Problem Set # 5

Lab 11. Spring-Mass Oscillations

Vibrations and Waves Physics Year 1. Handout 1: Course Details

not to be republished NCERT OSCILLATIONS Chapter Fourteen MCQ I π y = 3 cos 2ωt The displacement of a particle is represented by the equation

Transcription:

Physics with Mathematica Fall 2013 Exercise #1 27 Aug 2012 A Simple Introductory Exercise: Motion of a Harmonic Oscillator In general, you should be able to work the daily exercise using what we covered on mathematica in class, but you will also usually need to find some things yourself using the documentation in the program. A simple harmonic oscillator is constructed from a mass m and a spring with stiffness constant k. It moves in one dimension x(t) with velocity v(t) where x(t) = A cos(ωt + φ) and v(t) = ẋ(t) = ωa sin(ωt + φ) where ω = k/m. The kinetic energy of the mass is K = 1 2 mv2. At the initial time t = 0, the position and velocity are given by x 0 = x(0) = A cos φ and v 0 = v(0) = ωa sin φ so that A = x 2 0 + v2 0 ω ( 2 and φ = tan 1 v ) 0 ωx 0 Plot the kinetic energy as a function of time, from t = 0 to t = 10 sec, for an oscillator with m = 1.75 kg, k = 2 N/m, and which starts from x 0 = 0.25 m with velocity v 0 = 1.25 m/sec.

Physics with Mathematica Fall 2013 Exercise #2 3 Sep 2012 Plotting Orbits Orbits in a gravitational field are described in plane polar coordinates (r, φ) as r(φ) = r 0 1 + ɛ cos φ where r 0 is a scale parameter and ɛ is the eccentricity of the orbit. The orbit shape is named circle for ɛ = 0 ellipse for 0 < ɛ < 1 parabola for ɛ = 1 hyperbola for ɛ > 1 Write a Mathematica notebook that does the following: 1. Defines a function r of some angle to express and arbitrary orbit 2. Derives expressions x = x(φ) = r cos φ and y = y(φ) = r sin φ 3. For one choice of value for r 0, and appropriate choices for ɛ, derive expressions for the coordinate list {x, y} that describe a (a) circle, (b) ellipse, (c) parabola, and (d) hyperbola. 4. Produces a single plot showing each of the four orbit shapes, using ParametricPlot. You will have to use Show if you use more than one instance of ParametricPlot, in order to get all four curves on just one plot. For the hyperbola, plot only the one branch that extends to the same side of the focus (i.e. r = 0) as the parabola.

Physics with Mathematica Fall 2013 Exercise #3 10 Sep 2012 Projectile Motion and Range A projectile is fired with initial speed v 0 from the edge of a cliff, at an angle θ with respect to the horizontal (x) direction. The cliff is a height y = h above the ground. The equations describing the motion of the projectile are therefore, with (x, y) = (0, 0) being the edge of the cliff, x = v 0 t cos θ and y = h + v 0 t sin θ 1 2 gt2 Using g = 9.8 m/sec 2 and choosing some appropriate value for v 0, make a parametric plot of the trajectory, that is y versus x. Make it so that you can easily reproduce the plot for different values of h and θ. Try different values of h and θ and convince yourself that the trajectories look reasonable. Then, solve the equation y(t) = 0 for the time when the projectile hits the ground. Use this time to find the range x(t), and make a plot of the range versus either θ for a fixed h, or versus h for a fixed θ. In fact, it would be most slick if you used Manipulate to allow the fixed value to be easily changed.

Physics with Mathematica Fall 2013 Exercise #4 17 Sep 2012 Potential and Field from a Uniformly Charged Line Segment The electrostatic potential from a charge distribution is given, in CGS units, by V (x) = dq x x where dq = ρ(x )dv for a volume charge density ρ(x), dq = σ(x )da for a surface charge density σ(x), and dq = λ(x )ds for a line charge density λ(x). Given an electrostatic potential function V (x), the electric field from that charge distribution is E(x) = V (x). Consider a straight line segment of uniformly distributed charge Q and length L, lying along the x-axis and centered on the origin. The line charge density is then simply λ = Q/L. Find the electrostatic potential along the z-axis, that is V (x) = V (0, 0, z). Express your result in the simplest form that you can, perhaps using the Simplify function in Mathematica. Do the same for (the z-component of) the electric field along the z-axis. Test your results by considering the electric field in the limits z L and z L, in which case you ought to be able to use your Physics II knowledge to figure out what you expect. The best way to find these limits (I think) is to look for the appropriate series expansion in terms of z. (Use the Documentation Center!) Note that the integral form of Gauss Law is E da = 4πQ encl

Physics with Mathematica Fall 2013 Exercise #5 24 Sep 2012 Forced Damped Oscillations and Resonance The exercise is to plot the motion of a forced, damped harmonic oscillator including the initial conditions which shows the transient behavior. This is always avoided in classes because the math is onerous. It s a snap with mathematica, though, and the transient behavior can be interesting to observe. The equation of motion for the forced oscillator is ẍ + 2βẋ + ω 2 0x = A cos ωt It is convenient to express the motion in terms of the natural period τ 0 2π/ω 0 and the driving period τ 2π/ω. Solve this differential equation for the motion x(t) and plot for 0 t 10, using β = 0.1, and natural period τ 0 = 1, subject to the initial conditions x(0) = ẋ(0) = 0. Try plotting it first for a driving period τ = 2 and amplitude A = 1. Then, try it for some other choices of these parameters. Remember to keep β < ω 0 if you want to have an oscillating transient, but that is not necessary. Next, use manipulate to study the behavior of the forced oscillator. Probably the most dramatic parameter to manipulate is τ, and let it span over τ 0 so that you can observe resonance.

Physics with Mathematica Fall 2013 Exercise #6 1 Oct 2012 The Humped Potential Well An object of mass m moves in one dimension x according to Newton s Second Law F = mẍ with a force F (x) = ax 2 bx. Assume that a and b are positive constants. Numerically solve for x(t) with initial conditions ẋ(0) = 0 and x(0) = x 0, and plot the results. Solve and plot for 0 t t Max where t Max is large enough for you to see the behavior as t. Let x 0 takes on each of three values of your choosing, but with the constraints 1. x 0 b/2a 2. x 0 close to b/2a but a little larger (i.e. closer to zero) 3. x 0 close to b/2a but a little smaller (i.e. farther from zero) You ll need to put in numerical values for everything in order to solve Newton s Second Law numerically. You are welcome to choose whatever values you want for a, b, and m, but you may want to play around with them a little to make the plots look nice. What is so special about x = b/2a? You might try solving and plotting for x 0 = b/2a to get a big hint. You might also plot the potential energy U(x) = x 0 F (u)du for a bigger hint. The integral is simple, but you can ask mathematica to do it for you; no need for a numerical integral here, though. Note that at this point, you should be getting into the habit of putting appropriate comments into your code.

Physics with Mathematica Fall 2013 Exercise #7 8 Oct 2012 Basic Matrix Manipulation This exercise uses mathematica for some standard calculations with a Hermitian matrix. We will work with the spin-one y-matrix from quantum mechanics: M = 1 2 0 i 0 i 0 i 0 i 0 Define this matrix in mathematica and carry out the following operations. Note that, for a matrix A, the Hermitian transpose is designated as A. 1. Show that M is Hermitian, that is M M = 0. You might also, or instead, try using the function HermitianMatrixQ. 2. Find the eigenvalues and eigenvectors of M. Extract the eigenvectors v 1, v 2, and v 3. 3. The eigenvectors are not normalized. Find the normalization constants for each of the three eigenvectors v i by taking the square root of v i v i. 4. Form a matrix U using the normalized eigenvectors for columns. Show that U U = 1, that is the identity matrix. 5. Calculate the matrix U MU. Show that it is diagonal, with the diagonal elements equal to the eigenvalues of M.

Physics with Mathematica Fall 2013 Exercise #8 22 Oct 2012 Elementary Data Analysis: Gas Mileage in Winter vs Summer Download the file MPG.dat from the course website. This is a two-column data file. The first column is the day since 1 July 2008, and the second is the gas mileage (in miles per gallon) of a car, a routinely maintained 1994 Honda Accord, since the last time the tank was filled. The science goal of this exercise is for you to observe the change in gas mileage between summer and winter. Find the average gas mileage and its standard deviation. You might want to use the Documentation Center to identify the built-in functions that give you these answers. Make a plot of the gas mileage as a function of day. That is, plot a set of points with the first column as the x-axis and the second column as the y-axis. Set the axis limits from zero to 2000 for the days, and 20 to 40 for the mileage. Label the axes Day since July 1, 2008 and MPG. Now make two separate histograms of the gas mileage, each for certain periods of time. One histogram should be for the January and February months, and other for July and August. Find the average gas mileage and the standard deviation for each of these two sets of data, and make sure those answers look reasonable based on your histograms. Note: There are few ways to take the first column and figure out what month it implies. The simplest thing to do is to find the remainder when dividing by 365 - the Mod function - in which case a number less than 62 means July or August, or between 184 and 263, that is, January or February. A nicer way, which takes into account leap years, is to use the DatePlus function and work with the actual month as determined by Mathematica.

Physics with Mathematica Fall 2013 Exercise #9 29 Oct 2012 Fitting Data to a Curve: The Decay of 137 Cs This exercise is to fit some data for radioactive decay as a function of time, including a constant background term. The number of counts N > 0 detected in time t is called the decay rate R = N/ t dn/dt. Quantum mechanics tells us that R is proportional to N, the number of radioactive nuclei present at time t. That is dn/dt = λn for some positive constant λ = 1/τ, where τ is called the lifetime or mean life. Therefore N(t) = N 0 e λt and R = λn 0 e t/τ = λn 0 2 t/t 1/2 where, for convenience, we often use the half life t 1/2 instead of the lifetime. Download the file Cs137.dat. It has two columns, the first is time (in 20-second intervals) and the second is the number of detected decays during that time interval. The data was taken as part of an undergraduate physics laboratory experiment, where samples of radioactive, but very long lived, 137 Cs were used to separate out the radioactive daughter 137m Ba. This relatively short lived isomeric state in turn decays to the ground state by emitting a gamma ray. These gamma rays were detected by a Geiger counter as a function of time. You ll see from the data that a constant background level persists after the 137m Ba has decayed away. The goal of this exercise is for you to fit an appropriate functional form to this data and to determine the half life of the 137m Ba isomer. It should be easy enough for you to find the accepted value for the half life on the web, and compare it to your result. Your notebook should include the following: Importing the file Cs137.dat. Defining your fit function and fitting the data to it. A plot of the data as a function of time, with your fit function superimposed on it. A plot of the difference between your fit function and the data as a function of time. An appropriate time unit to use for the half life is minutes. I suggest you operate on the data file so that the 20-second time bins are in fact labeled as thirds of minutes.

Physics with Mathematica Fall 2013 Exercise #10 5 Nov 2012 Determining π from a Monte Carlo Calculation This conceptually simple exercise will give you some practice in numerical calculations in Mathematica, including some work with random numbers. Your goal is determine π from a Monte Carlo simulation. This is basically a cheap way to calculate an integral numerically, using random numbers. The technique is akin to throwing dice, hence the name. (If you ve never heard of Monte Carlo or the principality of Monaco, you should look it up!) Consider a square with side length two, and a circle of radius one, both centered at the origin. The area of the square is four and the area of the circle is π. So, you can write that π = 4 area of circle area of square Instead of calculating those areas analytically, though, you ll do it by throwing dice. Use the Documentation Center to learn how to generate an array of random number pairs (x, y), of arbitrary length npts, where both x and y are uniformly distributed between 1 and 1. You should plot the points you generate and confirm that they uniformly fill the square. Maybe you want to superimpose on top of that a plot of the unit circle. Now select the points for which x 2 +y 2 1. You should probably plot these as well, and make sure that they uniformly populate the unit circle. Use npts and the number of points you selected to calculate a value of π, and compare it to the precise value up to some number of significant figures. How large does npts need to be in order to get a decent value for π?

Physics with Mathematica Fall 2013 Exercise #11 12 Nov 2012 Animation of a Mass on a Spring Make an animation of a square block, connected to a spring, undergoing simple harmonic motion. The spring is connected to a fixed point at x = 0, compressing and expanding with the block. Draw the block with the Polygon graphic primitive function of Mathamatica. You can draw the spring as a sine function with some number of wavelengths. You should end up with something like the following, shown at some intermediate time: You ll have to make the center of the block, as well as the right endpoint and wavelength of the sine function, depend on time. Describe the motion of the block with something like x(t) = 0.5 + 2.5(1 + cos 2πt) which is what I used for the picture above, but by now you should be able to set this all up with parameters that you can vary. (If you d like to do this by solving some differential equation that includes damping, or anharmonic terms, or..., be my guest!) Use the correct AspectRatio to make sure the block is drawn as a square.

Physics with Mathematica Fall 2013 Exercise #12 19 Nov 2012 Plotting the Electric Potential and Electric Field from Two Point Charges This is really an exercise in some advanced plotting techniques. Consider two charges, one positive and one negative, at different points in the (x, y) plane. Calculate the electric potential V (x, y) from these charges, and make a 3D surface plot of the potential over some region of the plane. Choose whatever values you like for the charges, their positions, and the limits of your plot. Calculate the electric field E(x, y) = V (x, y) from your potential. Then make a single picture of some portion of the (x, y) plane that includes the following: A filled-in blue circle showing the position of the positive charge, and a filled-in red circle showing the position of the negative charge. A contour plot of the potential. Make the contour lines black, and put fixed labels on them. (You might want to notice that tooltip information is available; just move your cursor over a contour to see the value.) Plot the electric field lines in green. You ll need to spend some time in the Documentation Center in order to learn how to make these various specific features of the picture.