P2820 Midterm 2 - March 17, 2011

Name:
Student number:

There are 2 questions, each worth 10 marks.
Note: Do not worry about axes labels for plots, but do answer questions with sentences and include units for physical quantities when appropriate (give numerical answers to three significant figures).  All quantities are assumed to be given in MKS units.

Q1

The following command constructs a table of data representing the height of a bat as it flies through the air.  In this question you need to take derivatives and integrate this set of (discrete) data.

batheight=Table[{t,3+Exp[((-(t-5)^2)/3)]Sin[0.25 t]+Cos[2 t]},{t,0,10,0.1}];

a)

Plot the height of the bat as a fucntion of time.

b)

Use the centred difference scheme for the first derivative to find the (vertical component of the) velocity of the bat as a function of time, basing your result on the above data table.  Calculate the velocity for all points that the method allows.  Store your result in a table and plot it.

c)

What is the velocity at t=4.2s?

d)

The time average of a function is 

(1/(t2-t1))(∫_t1^t2)f(t)dt

Use the trapezoid rule to find the average height of the bat from 2.0s to 6.0s

Q2

An oscillator of mass m=1.2 and spring constant k=4.8, for which the damping force is proportional to the velocity, is governed by the following equation,

x'' + γ  x' |x'| + ((Subscript[ω, 0])^2)x=0, 

where x(t) is the displacment of the oscillator from equilibrium, (Subscript[ω, 0])= (Sqrt[k/m]) and γ=8.  Initially, the displacement is 0.5, and the velocity is 0.4.

a)

Write your own solver to find for x(t) and velocity u(t) using a 4th order Runge-Kutta scheme for 20s.  Use a time step of dt=0.1.  Interpolate your solutions and plot x(t) and u(t).

b)

Plot the energy (kinetic plus potential) of the oscillator from t=2 to t=10.  Does the energy decay exponentially?

c)

Use x(t) to find the period of the oscillator as a function of time.  Is the period constant? 

[One straightforward way to determine the period is to use the time interval between roots. Be creative in the way you solve this problem, for example, by writing a Do loop to find all the roots of your x(t).]