MATLAB-ENGINEERING ASSIGNMENT

profileLeila@
engr_232_matlab_midterm.pdf

ENGR  232  Take  Home  Matlab  Midterm   Due:  Monday,  November  24,  6  PM  

May  work  in  groups  of  up  to  3.  List  group  members  in  comments  of  code.   Submission  must  be  in  .pdf  format  

  Consider  a  system  of  two  masses,  m1 and m2 ,  attached  to  three  springs,  with  spring   constants  of  k1, k2, and k3 ,  where  the  outside  two  springs  are  connected  to  walls  and   the  internal  spring  connects  the  two  masses.  The  configuration  is  shown  below.                         We  can  set  x(t)  and  y(t)  equal  to  the  positions  of  the  left  and  right  mass  from  their   respective  equilibrium  positions.      

1. Write  two  second  order  differential  equations  which  describe  the  forces  on  each   mass.  Do  this  in  the  comments  of  your  code.  (Hint:  Newton’s  Law  F=ma,  Hooke’s   law  F=-­‐kx.  F=Force,  m=mass,  a=acceleration,  k=spring  constant,  x=displacement   from  equilibrium  position.)    

  2. Write  a  matrix  A  from  the  equation  in  the  form  

! x ' = A

! x  which  describes  the  

dynamics  of  the  mass  spring  system.  (Hint:  A  should  be  a  4x4  matrix).  Display  the   matrix  A.  

  3. Let   m1 = m2 = 1, k1 = k3 = 1, k2 = 2  Solve  the  general  matrix  equation  by  finding  

the  eigenvalues  and  eigenvectors  and  using  the  equation  

! x(t) = c1e

!1t!v1 + c2e !2t!v2 + c3e

!3t!v3 + c4e !4t!v4  .  Display  the  eigenvalues  and  

eigenvectors.    

4. Assume  your  initial  conditions  are  x=1  and  y=-­‐1.  Apply  the  initial  conditions  to   solve  for  the  ci.  Plot  x(t)  and  y(t)  on  the  same  figure  for  t=0  to  t=50.  On  a  second   figure  plot  y’(t)  versus  x’(t)  (Phase  Plane).  Display  both  plots  with  legend,  title,   and  axes  labeled.  

  5. Repeat  part  4  with  the  initial  conditions  x=1,  y=0.  Display  both  plots  with  legend,  

title,  and  axes  labeled.  

         k1                          m1                          k2                              m2                          k3  

     x=0        y=0