3.8 Mechanical Vibrations (an example from class)

The equation governing the motion of a mass m attached to the end of a spring with spring constant k and subject to a damping force of γ times velocity 
    is       m u''  +  γu'  +  k u  =  0. For the sake of concreteness, let' s assume m = 1 and k = 9,  and consider values γ = 2, 6,  10 that lead to 
    underdamped,  critically damped and overdamped systems,  respectively .   We will also assumeinitial conditions of u[0]  =  1,  u'[0] = 0.

1.  The underdamped case (γ = 2)

Clear[u]

\(soln\  = 
      DSolve[{\(\(u'\)'\)[t]\  + 2\ \(u'\)[t\ ] + \ 9  u[t]\  == \ 0, \ 
          u[0] == 1, \ \(u'\)[0] == 0}, 
	\ \ \ \ \ \ \ \ \ \ \ \ \ \ u[t], 
        \ t]\)

u1 =  u[t] /. First[soln]

2.  The critically damped case (γ = 6)

Clear[u]

\(soln\ \  = 
      DSolve[{\(\(u'\)'\)[t]\  + 6 \( u'\)[t\ ] + \ 9  u[t]\  == \ 0, \ 
          u[0] == 1, \ \(u'\)[0] == 0}, 
	\ \ \ \ \ \ \ \ \ \ \ \ \ \ u[t], 
        \ t]\)

u2 =  u[t]  /. First[soln]

3.  The overdamped case (γ = 10)

Clear[u]

\(soln\ \  = \ 
      DSolve[{\(\(u'\)'\)[t]\  + 10 \( u'\)[t\ ] + \ 9  u[t]\  == \ 0, \ 
          u[0] == 1, \ \(u'\)[0] == 0}, 
	\ \ \ \ \ \ \ \ \ \ \ \ \ \ u[t], 
        \ t]\)

u3  =  u[t] /. First[soln]

u3  =  Expand[u3]

Now we compare all three of these solutions by plotting them on the same graph

Plot[{u1, u2, u3},  {t, 0,  5}]