Coupled Oscillator: Coupled Mass-Spring System with Damping

From Class Wiki
Jump to navigation Jump to search

Problem Statement

For the below system set up a set of state variable equations, and then solve. Assume all motion takes place in the vertical directions.

Fig. 1

Solution

Initial Values

For the upper mass:

And for the lower mass:

Initial Condition

We can have an input force, however, we are just going to have mass 2 pulled down 2 meters. Or in another words x_2 = 2 meters for our initial condition.

Find the Force Equations

First we need to sum forces in the y-direction for each block.

For mass 1:


For mass 2:


So if we put the equations above into the correct form we have:


and


Note: Many people include the original length of the springs in the above equations, however if we take our initial reference point to be where the mass is in equilibrium, we do not need to include the initial spring length or gravity as an imput.

State Space Equation

The general form for the state equation is as shown below:



Where denotes a matrix and denotes a vector.


If we let , , , and be the state variables, then



Now we need to set up our output. The below is the general form of the output.



If we want to output both positions and velocities of both masses we will use:


Eigenvalues

If we solve the A matrix for the eigenvalues using Matlab we get:


Eigenvectors

Now that we have our eigenvalues, we can use them to find the eigenvectors. Again using Matlab we get:





Diagonalized A Matrix

With the above eigenvectors we also get the diagonalized A matrix which we will denote as D:



Solving

We know that the T inverse matrix is just made up from the eigenvector columns, so:


It then follows that the T matix is:



Now we can use the equation for a transfer function to help us solve through the use of matrix exponentials.

This can be rearranged by multiplying T-inverse to the left side of the equations.

Now we can bring in the standard form of a state space equation

Combining the two equations we then get

Multiplying both sides of the equation on the left by T we get

where


If we take the Laplace transform of the above D matrix from the previous secton and use the below equation:


where


We then substitute this equation back into

and get

Notice here that

Which gives us




Note: All of the above matrices are supposed to be multiplied in the horizontal, but they are put in the vertical to save space so that you don't need to scroll over.

As in Johnathan Schreven's problem, the solution to the above matrix multiplication is huge, therefore I am not going to include it here. It does however work out.

Graphical Representation

Since the solution above is so long below is a graphical representation of the solution. I could not figure out how to change the y-axis labels on each of the four graphs per one solution. So the first two are position and velocity of mass 1 and the second two are position and velocity of mass two. Positions are in meters and velocities are in meters per second. Figure one is with the initial value of damping, and figure 2 is the same system with no damping.

Fig. 1
Fig. 2

As we can see, there is a huge difference between the two graphs. This shows us that even if damping is small, there can be a huge difference in the output.

The matlab code used is shown below:

Tstop = 50; % Total time run
npts = 500; % Number of points per second
mag = 0;    % This has to do with input exp. (0 = nothing, 1 = step)
m1=2;       % Mass, Spring constants, and Damping coefficients
m2=4;
k1=10;
k2=12;
b1= .1;
b2= .2;
A=[       0                 1             0           0
   -(k1/m1+k2/m1)  -(2*b1/m1+2*b2/m1)  (k2/m1)    (2*b1/m1)
          0                 0             0           1
      ( k2/m2)          (2*b2/m2)     -(k2/m2)   -(2*b2/m2)];
B=[0 0 0 0]';              % A, B, C, D are the matrices from our equations
C=[1 0 0 0
   0 1 0 0
   0 0 1 0
   0 0 0 1];
D=[0
   0
   0
   0];
X0=[0 0 2 0]';             % The initial value matrix
sys1 = ss(A,B,C,D);        % Setting up the system for the state equations
t= linspace(0,Tstop,npts); % Setting up the time axis
u= mag*ones(size(t));      % The input
lsim(sys1,u,t,X0);         % lsim is the solver for the state equations
xlabel('time');
ylabel('postions and velocities of mass 1 and mass 2');

Again, the only difference between the graphs are the damping coefficients.


Written by: David Steinweg