Assignment 7

Name:
Student number:

Q1	[10 marks]

Download the file vfall.dat from the course website.  It contains two columns of data: time (s) in the first, velocity (m/s) in the second (positive is upwards).  The data represent a projectile fired nearly straight up.

a) 2 marks

Import and plot the data.  Include axes labels.

b) 4 marks

Determine the accelation of the projectile as a function of time using the (discrete form of) the forward difference approximation for the first derivative of a function.  Plot the acceleration as a function of time.

c) 4 marks

Assume that the drag force on the projectile can be approximated with -b v, where v is the velocity and b is the drag coefficient.  Report the drag coefficient b and an error estimate by appropriately plotting the data and determining the slope through a linear least-squares fit.  The mass of the projectile is 2kg.  Assume a gravitational acceleration of g=9.8 m/s/s.

Q2	[10 marks]

Consider a vibrating string modeled with the damped wave equation

		(((∂^2) η)/(∂ (t^2)))=(c^2)(((∂^2) η)/(∂ (x^2)))-0.1((∂ η)/(∂ t))

on x ϵ [0, L], t ϵ [0, 15], with c=2, L=30 and initial and boundary conditions given by

	η(x,t=0)=0
	
	(∂_t)η(x,t=0)=0
	
	η(x=0,t)=0.1 (e^(-(((((t-7)/2)))^2)))
	
	η(x=L,t)=0

(That is, a pulse is sent starting from the left end point is sent down the string.)

a) 5 marks

Use NDSolve to solve for the displacement of the string as a function of position and time.  Plot the string’s displacement at t=10s and t=15s.

Remove["Global`*"]

c=2;
L=30;
T=30;

b) 2 marks

From the position of the travelling peak at t=10 and 15s, confirm that the speed at which the peak travels is c.

c) 3 marks

The frequency f and wavelength λ of a wave are related through f λ = c.  Provide evidence based on the numerical solution that this is the case for the pulse considered here.  To do this, first find the duration of the pulse, which you can get by plotting the pulse (the displacement of the left end point) as a function of time and find for how long the displacement is above half of its maximum value (i.e., the width at half-maximum of the plot).  Take this duration to be the period.  Second, take the width at half-maximum of the plot of the string’s displacement as a function of x at t=15.  Take this width to be the wavelength.

Q3 [10 marks]

The file xosc.dat contains the displacement of damped harmonic oscillator as a function of time.  The mass of the oscillator is 1 kg, and the spring constant is 1.28 N/m.

(a)  1 mark

Import the data and plot them.

m=1.;
w02=1.28;

(b) 5 marks

Using the centred difference scheme for the second derivative to get the acceleration and the centred difference scheme for the first derivative to find the velocity of the oscillator, manipulate the data (create a new data table) in order to produce a plot for which velocity (or its negative) is on the horizontal axis and the slope of the straight line shown in the plot has a slope equal to +/- γ, the damping constant (damping frequency) of the oscillating system.  Use a linear fit to find γ and report an uncertainty.  Plot the fitted line overtop of the data-derived plot.

(c) 4 marks

Confirm your result from part b by using a nonlinear fit of the original x(t) data.  The expected analytic form is in the notes, and the parameters are A, γ, (Subscript[ω, 1]) and ϕ.  What is γ as obtained from this fit?  What is the natural frequency of the oscillator according to the model and fit?