Homework 6: (Optional. Due Monday, 12/17)

Last week in recitation, we learned about the MATLAB ODE suite - a set of tools provided by MATLAB to faciliate solving Ordinary Differential Equations. We discussed some advantages and shortcomings of the ODE suite, and solved a couple of differential equations using the MATLAB ODE tools, including the Newton's motion equation for a simple harmonic oscillator.

  1. Recall that the motion equation for a simple harmonic oscillator is M d2x/dt2 = -kx. In class, we stated that for an oscillator starting from rest at position x0, the analytical solution for the motion equation is x(t) = x0cos(wt), where w = sqrt(k/m). Prove that this is the case.
    ( Hint: First show that for x(t) = Ax0cos(wt+Z) , the Newton's equation of motion for a simple harmonic oscillator holds for any parameters A and Z. Then, solve for A and Z given that the starting position is x0 and the starting velocity is 0.)

  2. The simple harmonic oscillator is not a very realistic entity, since it exhibits perpetual oscillatory motion. In reality, an oscillating object would tend to settle into the equilibrium position (x = 0) as time goes by. This type of motion is exhibited by a damped harmonic oscillator. Under damped harmonic motion, the oscillating mass is acted upon by an additional dissipative (or damping) force that is proportional to the velocity of the object, but acts in the opposite direction. Due to the influence of this force, the object settles into an equilibrium position over time. In fact, the damping force can be so large as to prevent the object from oscillating altogether.

    The Newton's equation of motion for the damped harmonic oscillator is as follows:

    M(d2x/dt2) = -b(dx/dt) - kx
    Here b is the coefficient of drag: the higher the value of b, the greater the dissipative force. Note that for b = 0, the motion equation is simply that of a simple harmonic oscillator.

    As in the case of the simple harmonic oscillator, the motion equation for the damped harmonic oscillator can be solved analytically. However, we will not do so here. Instead, we will use Matlab's ODE tools to find numerical solutions to this motion equation.

    1. Write a MATLAB function that computes d2x/dt2 given the time t and the set of conditions at that time. This function must be usable by MATLAB's ode23() and ode45() routines.

    2. For m = 1, x(0) = 1, v(0) = -5, k = 10, and b = 10, solve the motion equation on the interval T = [0,1]. Use ode45(), since it produces more accurate results. What trajectory do you observe? What can you say about the motion of a mass following this trajectory? A damped harmonic oscillator that follows this kind of path is said to be overdamped.

    3. Keep all the parameters as above, except set k = 500. Describe the trajectory that is generated. What kind of motion will the oscillator exhibit? In this case, the oscillator is said to be underdamped.

    4. Keeping all other paramters the same, vary k until you find a trajectory such that x(t) converges to 0 as quickly as possible without starting to oscillate. In this case, the oscillator is said to be under critical damping. For what value of k does this occur?

    Submit your code for parts a-d, and the trajectory plots for parts b-d.