- Determine the equations of motion for the system.
- Write a FORTRAN, C or C++ program to determine an approximate numerical solution for the system assuming all the initial conditions are zero except the initial velocity of the 6th mass is -2 and f(t)=0. You may use Euler's method or RK. Plot the solution in a manner that clearly communicates the nature of the solution (is there a wave traveling down the chain?).
- Verify your answer to the previous problem using ode45() in Matlab.
- Use the Matlab place() function to determine the values of the ks that place the eigenvalues for the system under full state feedback (that means f = k1 x1 + k2 x2 + ... k20 x20) at -1, -1.1, -1.2, ..., -2.1. Modify your program to include the force and plot the solution.
- Use the Matlab place() function to determine the values of the ks that place the eigenvalues for the system under full state feedback at -1, -1.1, -1.2, ..., -1.9 and -.1 + i, -.1 - i. Modify your program and plot the solution and compare it to the solution in the previous part and explain any differences and whether or not the differences are what you would expect.
- Use the matlab lqr() command to make the motion of the 4th mass become small much faster than the other masses. Modify your program and plot the solution.

- I downloaded building.m and buildingrhs.m
- I changed the initial conditions in building.m to be [10 10 10 10 10 10 10 10 10 10] and also edited to only plot once.
- Then I ran:
I copied the gains in ans into the K matrix in buildingrhs.m and then ran building.m again (I edited it to only plot once) and got the following plot.
Code: Select all

`>> Q = eye(10); >> lqr(A,B,Q,[1]) ans = 0.1488 0.1888 -0.4697 0.7217 0.7565 0.5678 -2.0227 1.4118 2.6190 2.4976`

- Then I ran
and copied those gains into buildingrhs.m and re-ran building and got the following plot.
Code: Select all

`Q(5,5) = 100 Q = 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 100 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 >> lqr(A,B,Q,[1]) ans = 2.9803 2.8564 -0.2577 6.2080 -0.6458 3.7663 -1.3699 7.5652 6.9451 3.8588`

You can observe that the green curve is smaller relative to the red and blue curves, which reflects a higher weighting for that element.