Matlab Project: Dynamical Systems
Matlab Project: Dynamical Systems
Matlab Project: Dynamical Systems
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Matlab</strong> <strong>Project</strong>: <strong>Dynamical</strong> <strong>Systems</strong><br />
Goal: Compute the eigenvalues and eigenvectors of a dynamical system<br />
Problem:<br />
Consider a system of five masses m 1 , m 2 , m 3 , m 4 , m 5 connected in a straight line by four springs<br />
with spring constants k 1 , k 2 , k 3 , k 4 as shown below:<br />
k 1 k 2 k 3 k 4<br />
✉ ✉ ✉ ✉ ✉ ✲ x<br />
m 1 m 2 m 3 m 4 m 5<br />
Such a system could serve as a simple model for various physical systems, such as a linear molecule<br />
composed of five atoms, or a string of five railroad cars loaded on a barge. We want to determine<br />
the natural frequencies of vibration of the system: for a molecule, these will correspond to the<br />
frequencies of light which it absorbs; for a string of railroad cars, forcing at any of these frequencies<br />
(by wave motion under the barge) will cause resonance and possible destruction of the train. The<br />
purpose of this project is to illustrate how you can solve such a problem using MATLAB to compute<br />
eigenvalues and eigenvectors.<br />
Details:<br />
Assuming that the motion is confined to the x-direction only and that the springs obey Hooke’s<br />
Law, the motion of the system is described by the equations<br />
m 1<br />
d 2 x 1<br />
dt 2 = k 1 (x 2 − x 1 )<br />
m 2<br />
d 2 x 2<br />
dt 2 = −k 1 (x 2 − x 1 ) + k 2 (x 3 − x 2 )<br />
m 3<br />
d 2 x 3<br />
dt 2 = −k 2 (x 3 − x 2 ) + k 3 (x 4 − x 3 )<br />
m 4<br />
d 2 x 4<br />
dt 2 = −k 3 (x 4 − x 3 ) + k 4 (x 5 − x 4 )<br />
m 5<br />
d 2 x 5<br />
dt 2 = −k 4 (x 5 − x 4 )<br />
Here x i (t) denotes the position of mass m i at time t, with each x i = 0 if all springs are unstretched.<br />
(a) Assuming for simplicity that all masses are equal (m 1 = · · · = m 5 = m), the system (1) can be<br />
written in matrix form as<br />
m d2 x<br />
= −Ax, (2)<br />
dt2 where x(t) = [x 1 , x 2 , x 3 , x 4 , x 5 ] T . On the answer sheet, write out the matrix A explicitly in terms<br />
of k 1 , k 2 , k 3 , k 4 . Take care to account for the minus sign in (2). Note that A is tridiagonal (i.e.,<br />
only three diagonals are nonzero) and symmetric.<br />
(1)<br />
Page 1 of 2
(b) Free vibrations of the system correspond to solutions of the form<br />
x(t) = e iωt u, (3)<br />
where u is a constant vector, ω is the (angular) frequency, and i = √ −1 is the imaginary unit. By<br />
plugging (3) into (2), derive a matrix eigenvalue problem of the form<br />
Au = λu, (4)<br />
where the eigenvalue λ is related to the frequency ω and mass m. Write the formula which relates<br />
λ, ω, and m on the answer sheet.<br />
(c) Use the MATLAB command eig to computer all eigenvalues λ and corresponding eigenvectors u<br />
of the matrix A as defined above. Type “help eig” for details of how to use this command. Use the<br />
last four digits of your student number for k 1 , k 2 , k 3 , and k 4 . For example, if your student number<br />
is 0124659 use k 1 = 4, k 2 = 6, k 3 = 5, and k 4 = 9. Write the eigenvalues on the answer sheet<br />
(rounded to four decimal places).<br />
(d) From equation (3), each eigenvalue/eigenvector pair (λ, u) corresponds to a distinct mode of<br />
vibration. The eigenvalue λ gives a corresponding frequency ω via your formula, and the components<br />
of the eigenvector u describe the motions of the individual masses m 1 , . . . , m 5 . In particular,<br />
the relative sizes of the components show the relative amplitudes of these motions, and the signs<br />
indicate which masses are moving in the which direction at a given time. For example, if we had<br />
u = [3, −2, 5, 1, −4] T then the corresponding motion would look like:<br />
✉ ✲ ✛ ✉ ✉ ✲ ✉✲ ✛ ✉<br />
m 1 m 2 m 3 m 4 m 5<br />
Here, the arrows show the velocities at a time t when all masses are at their equilibrium positions<br />
x i = 0 (they oscillate back and forth around these with velocities as shown). On the answer sheet,<br />
write the largest natural frequency ω (use the value m = 100), and draw a similar picture describing<br />
the corresponding motion of the masses for that mode of vibration.<br />
(e) Show (using pencil and paper) that λ = 0 is always an eigenvalue of A (for any choice of<br />
the k i ), find a corresponding eigenvector, and explain the corresponding motion. Hint: try different<br />
(positive) values for the k i ’s and see what the eigenvector corresponding to λ = 0 looks like—then<br />
show it always works.<br />
Hand in the following:<br />
1. The completed answer sheet. DO NOT hand in the instructions (I already have a copy).<br />
2. A printed copy of your MATLAB session (input and output): for example, use File—Print<br />
to print the MATLAB command window, or use the diary command to capture the input and<br />
output to a file and then print that file. If you use an M-file (MATLAB script) to do these<br />
calculations, also attach a copy of it.<br />
Page 2 of 2
<strong>Matlab</strong> <strong>Project</strong>: <strong>Dynamical</strong> <strong>Systems</strong><br />
ANSWER SHEET<br />
Name:<br />
(a) Matrix A (in terms of k 1 , k 2 , k 3 , and k 4 ):<br />
(b) Formula relating λ, ω, and m:<br />
(c) Eigenvalues λ of the matrix A (in increasing order, rounded to four decimal places):<br />
(d) Highest natural frequency ω of the system (assuming m = 100):<br />
Corresponding eigenvector u:<br />
Draw a picture describing the motion of the system for this mode of vibration:<br />
(e) Put your answer for this part on the back of this sheet.<br />
Also attach a copy of your MATLAB input and output to this answer sheet.