Assignment 5

Name:
Number:

Q1

a)

Download the file dampedosc.dat from the course website.  The file contains 201 date points in two columns: the first is time in seconds, the second is the velocity of a damped harmonic oscillator in m/s.  Plot the data.

b)

Using the centred scheme to differentiate the velocity data, find and plot the acceleration of the oscillator as a function of time.

c)

Using the trapezoid rule to integrate the data, find and plot the position of the oscillator as a function of time.  The oscillator was released from rest with an initial displacement from equilibrium of 1m.

d

The mass of the oscillator is m=2.013 kg, and the spring constant k=0.2820 N/m.  Assuming that the force on the mass is

F=m a =-k x - b v

where v is the velocity, use your above results for displacement and acceleration to plot an appropriate quantity as a function of velocity such that the slope yields the drag coefficient b.

e)

Using a linear fit, find the drag coefficient b to 3 significant figures.

Q2

A group of martian students are out on a field trip to the planet Bortax and want to measure the gravitational constant g near their landing site.  To do this they shoot a projectile up into the air and measure its velocity with a radar gun.  Their results are in a file called martian_vel.dat.

a) Download this file from the course website and plot the velocity data.  The first column is time in seconds, the second column is velocity in m/s.  Positive is up.  Label your axes.

b)  Write a function that uses the forward difference scheme to calculate the time derivative at a given data point in a list of data, assuming as we have here that the first column is time.  Use this function to calculate the acceleration of the projectile at all times that you can.  Plot the acceleration as a function of time.

c)  In order to be able to extract g, the students decide to model the projectile motion by including two forces: 1) gravity Fg = -m g, and 2) viscous drag Fd = - b v.  They use Newton's 2nd Law to write m a = -m g - b v, i.e. "m a" plotted as a function of velocity should be a straight line the slope and intercept of which are determined by m, g and the drag coefficient b.  Construct an appropriate table in order to plot the force ("m a") as a function of velocity.  The mass of the projectile is 0.5 kg.

d)  Use Mathematica's built-in linear fitting function to find the slope and coefficient of the line of best fit through your plot in c).  Determine g (in m/s/s) and b (in kg/s) .

e)  One of the students argues that taking the derivative introduces noise and therefore it would be better to fit the original velocity data, using a nonlinear fitting procedure and an analytic expression for the velocity as a function of time.  To do this, first solve the force equation analytically using Mathematica's built-in ODE solver, leaving g and b as unkown coefficients.  The students are pretty sure the initial velocity should be 20 m/s.

f)  Now use your solution and Mathematica's built-in nonlinear fitting routine to find b and g.

Q3 One-dimensional wave equation without damping

Consider the wave equation,
	(((∂^2) η)/(∂ (t^2)))=(c^2)(((∂^2) η)/(∂ (x^2))) ,
on the domain x ϵ [0,6], t ϵ [0,4] where c=2.  The initial conditions and boundary conditions are as follows
η(x,t=0)=sin(2.5π x)exp(-2(((x-2))^2))
(∂_t)η(x,t=0)=0
η(0,t)=0
(∂_x)η(6,t)=0

a) Solve the problem using NDSolve.  Use the Manipulate function to visualize the solution.

b) Write your own numerical solver for the same probelm.  Use Δx=0.04 and Δt=0.01.  Plot η(x,t=4).

Q4  Jiggling a string at one end

The left end of a string is jiggled in order to send a wave pulse along the string.  The displacement of the left end as a function of time for the first 20s is given by f(t) defined below

Remove["Global`*"]

T=20;
f[t_]:=If[t≤6&& t≥1, 0.5Exp[-(t-3.5)^2](Cos[4π (t-1)/5]),0]
Plot[f[t],{t,0,T},PlotRange->All]

a)

The tension in the string is 6.4N, and the linear mass density is a function distance x from the left end point: ρ(x) = 6 - 4 Tanh( 4 x- 2 L ), where L=10 is the length of the string.  Find and plot the square of the wave speed as a function of x [recall c=sqrt(T/ρ); also, you should see a fairly rapid changeover from lower to higher speed halfway along the string].

b)

The wave travelling along the string is damped, and is governed by the equation

(∂_(t,t))u=(c^2)(∂_(x,x))u-0.4 (∂_t)u

The right end point is fixed at zero displacement, and the string is initially at rest with no displacement along its length.  Use an appropriate built-in Mathematica function to solve the wave equation numerically in order to find the displacement of the string from t=0 to 20s.  Use Manipulate to animate the solution.  To reduce spurious artefacts in the solution, you will need to include the option MaxStepSize -> 0.1 when using NDSolve.

c)

Based on your animation, describe in qualitative terms what happens when the wave front passes from the slow to fast region (mention at least 2 features other than the wave moving faster).

d)

Plot the displacement of the string as a function of x, at time t=11s.

Plot the velocity of the string as a function of x, at time t=11s.  (You will need to use the Derivative function.)

e)

The energy density (energy per unit length) of the wave at a particular time is given by

	Ed(x,t)=(1/2)ρ(x) (((((∂U(x,t))/(∂t))))^2)+(1/2)F (((((∂U(x,t))/(∂x))))^2),
	
where F is the tension.  The first term is the kinetic energy of the string near the point x, while the second term is a potential energy stored in the small stretching of the (elastic) string near x. 

Plot the energy density of the string as a function of x at t=11s

To get the energy stored in the wave at a particular time, one must integrate Ed(x), over x from 0 to L.

Find the energy of the string at t=11s.

Q5  Global warming and sunspots?  (BONUS)

Two more sets of data are provided for this assignment. 
	- The file 'sunspots.dat' contains the daily number of sunspots from 1850 up to 2001. This file contains roughly 55000 data points.
	- The file 'global_temp.dat' contains the anomaly of the annual mean global atmospheric temperature from 1850 up to  2005. This file contains 156 data points.  The temperature anomaly is the deviation from the mean temperature. 

(a) Make a nice graph of the number of sunspots from 1850 to 2001;

Remove["Global`*"]

(b) Describe this set of data with some standard statistics. That is, i) on average how many sunspots are there per day, ii) what is the standard deviation of the daily number of sunspots, iii) what are the maximum and minimum number of sunspot ever recorded?

(c) On average, has the number of sunspots increased from 1850 to 2001? Answer this question by computing the linear trend of the measurements. Show the trend on top of the original data. Spend time making this graph very clear and nice. For this you will probably need to use colors or modify the line thickness or the point size.

(d) Filter the daily sunspot data using a 1-year-long moving average filter. Clearly show the filtered data on top of the original dataset and on top of the linear trend. (Note: Computing the moving average can take several minutes.)

(e) Make a nice graph of the anomaly of global annual mean temperature from 1850 to 2005;

(f) Describe this set of data with some standard statistics as in b) (i.e. mean, standard deviation, maximum and minimum anomalies).

(g) What is the correlation between the annual mean temperature and the annual mean number of sunspots in the period between 1850 and 2001 (i.e. the overlapping period between the two data sets)? In answering this question you will have to decimate the sunspots data in order to get exactly the same number of data points in the two series. This you can do either by finding the average number of daily sunspots for each year (by the way the time is specified you can identify the year the data was taken), or approximately by simply dividing up the data into 152 blocks and finding the average for each block.  Then, make a graph of the temperature anomaly as a function of the sunspots number, find and plot the linear relationship on top of the cloud of data and find the correlation coefficient.

(h) What is the correlation between the decadal mean temperature and the decadal mean number of sunspots in the period between 1850 and 2001. This is the same question as in (g) except that you will examine the correlation by first averaging the data in both series into decades (10 years), e.g. by dividing each data set into 15 blocks.

(i) Draw a brief conclusion from the results of your analysis. Is the climate driven by the number of sunspots?  If you like, search the web for more information on this subject.