Coupled oscillators,
jiggled from one end

A one-dimensional system of n masses connected by springs.  The far end of the last spring, the spring connected to the right  (Subscript[m, n]), is fixed.  The first spring, the spring connected to the left of (Subscript[m, 1]), can be "jiggled" from the left with displacement (Subscript[x, 0])(t). The system of equations to solve is :
((d^2)/(dt^2))X = A X +F
where, for an example of 3 masses,
X=(({{(Subscript[x, 1])}, {(Subscript[x, 2])}, {(Subscript[x, 3])}}))
A=(({{-(((Subscript[k, 1])+(Subscript[k, 2]))/(Subscript[m, 1])), ((Subscript[k, 2])/(Subscript[m, 2])), 0}, {((Subscript[k, 2])/(Subscript[m, 2])), -(((Subscript[k, 2])+(Subscript[k, 3]))/(Subscript[m, 2])), ((Subscript[k, 3])/(Subscript[m, 3]))}, {0, ((Subscript[k, 2])/(Subscript[m, 3])), -(((Subscript[k, 3])+(Subscript[k, 4]))/(Subscript[m, 3]))}}))
F=(({{((Subscript[k, 1])/(Subscript[m, 1]))(Subscript[x, 0])}, {0}, {0}}))
We can make this system dimensionless by using (Sqrt[((Subscript[m, 1])/(Subscript[k, 1]))])as the time scale:  t=τ(Sqrt[((Subscript[m, 1])/(Subscript[k, 1]))]).  The dimensionless system will be written as
((d^2)/((dτ)^2))X = A X +(Subscript[X, 0]),
where now all the (Subscript[k, j]) and (Subscript[m, j]) should be interpreted as the ratio of the dimensional value to (Subscript[k, 1])and (Subscript[m, 1]), respectively.  For example, if all (Subscript[k, j])=(Subscript[k, 1])and (Subscript[m, j])=(Subscript[m, 1]), then
A=(({{-2, 1, 1}, {1, -2, 1}, {1, 1, -2}}))
Also,
(Subscript[X, 0])=(({{(Subscript[x, 0])}, {0}, {0}}))
Let the eigenvectors of A be written as (Subscript[K, j]) and the eigenvalues be (Subscript[λ, j]).
Construct a matrix P with the columns being the eigenvectors (Subscript[K, j]).
Let X=P Y, which means Y is the amplitude of the eigenvectors that
are summed to represent the displacment.  Here is the clever way
to solve the coupled problem: 

((d^2)/((dτ)^2))P Y = A P Y +(Subscript[X, 0]),

(P^(-1))P ((d^2)/((dτ)^2)) Y = (P^(-1)) A P Y +(P^(-1)) (Subscript[X, 0]),

 ((d^2)/((dτ)^2)) Y = D  Y +(P^(-1)) (Subscript[X, 0])

where D is a diagonal matrix of the eigenvalues.  Let 
G≡ (P^(-1))(Subscript[X, 0]).   This is really cool: there are uncoupled O.D.E.s for the amplitudes of each of the eigenvectors:
 ((d^2)/((dτ)^2)) (Subscript[y, j]) =(Subscript[λ, j])  (Subscript[y, j]) + (Subscript[g, j])
Finding a particular solution of the above equation is rather elementary. 

We next present a technique for finding  the homogeneous solution,
and in particular an efficient way to satisfy the initial conditions
(Subscript[X, h])(0)  and (Subscript[(OverDot[X]), h])(0).  The general homogeneous solution is:
(Subscript[X, h])(t)= Re{ P (Subscript[Y, h])(t) } 
where 
(Subscript[y, hj])(t)= (Subscript[c, j])(e^((Subscript[iω, j])t))
Let (Subscript[c, j])= (Subscript[c, jr])+ i (Subscript[c, ji]).  And let C be a column vector of the (Subscript[c, j]).
(Subscript[X, h])(0)= P (Subscript[C, r])
(Subscript[(OverDot[X]), h])(0) = -P D (Subscript[C, i])
As a matrix problem, this gives
(Subscript[C, r])= (P^(-1))(Subscript[X, h])(0)
and
(Subscript[C, i])= -(Q^(-1))(OverDot[X])(0)
where Q=P D.

I like to turn off warnings about variable names being similar:

Off[General::spell]

Off[General::spell1]

Create a matrix using "Input"-> "Create Table/Matrix/Pallette".
Then check "Matrix".  The matrix is stored (and can also be input)
as a list of lists, with the inner lists being the rows of A.  Comment
one of these A matrices as text, "uncomment" as needed.  Note the
use of one decimal number forces the use of numerical computation, as opposed to
symbolic.

A=(({{-2, 1, 0}, {1, -2, 1}, {0, 1, -2.}}))

A=(({{-2, 1}, {1, -2}})) (*change this 'Format>Style' to 'Input' to use this one*)

n=Length[A]

First, enjoy the exercise of finding eigenvalues without using the "canned" routine.  
Note from the graph we expect negative roots for λ.

ce=Det[A-λ IdentityMatrix[n]]

Plot[ce,{λ,-6,3}]

Solve[ce==0,λ]

Or use the canned routine:

lam=Eigenvalues[A]

We will solve the homogeneous equation  ((d^2)/((dτ)^2)) (Subscript[y, j]) =(Subscript[λ, j])  (Subscript[y, j])by proposing (Subscript[y, j])= (e^((Subscript[iω, j])t)).   Obviously, (Subscript[ω, j])=(Sqrt[-(Subscript[λ, j])]).  Let's make a list of these "eigenfrequencies":

ef=Sqrt[-lam]

Let Mathematica find the eigenvectors:

evect=Eigenvectors[A]

Store the eigenvectors are columns in P:

P=Transpose[evect];

Calculate (P^(-1)):

Pinv=Inverse[P];

Have a look at (P^(-1)):

Pinv//MatrixForm

Have a look at (P^(-1))A P, just to see that it yields the expected diagonal matrix (except for round-off error):

Pinv.(A.P)//MatrixForm

DiagonalMatrix[lam]//MatrixForm

In this particular example, we set (Subscript[x, 0])= sin Ω τ.  In doing so, we have implicitly nondimensionalized displacement in terms of the amplitude of the "jiggle".

F=PadRight[{1},n]Sin[Ω t]

Project the forcing onto the eigenvectors:

G=Pinv.F

A little  "pencil and paper math" yields the amplitudes of the
eigenvectors as caused by the jiggling:

Y=G/(ef*ef-(Ω^2))

Let's consider a particular value of Ω, so that we can have something
to plot out:

Xp=P.Y/.Ω->1/2

Xpd=D[Xp,t]

Xp0=Xp/.t->0

Xpd0=Xpd/.t->0

Q=P.DiagonalMatrix[ef]

Qinv=Inverse[Q]

Now with all the masses assumed to have no displacement and no velocity at t=0, we have

Xh0=-Xp0

Xhd0=-Xpd0

Cr=Pinv.Xh0

Ci=-Qinv.Xhd0

It is amazing what Mathematica can do with a list.  Exp[list] makes a list.  list*list makes a list of the product of the elements...

Yh=(Cr+I Ci)*Exp[I*ef*t]

Xh=P.Yh;

Check that we really did satisfy initial conditions:

Re[Xh]/.t->0

Re[D[Xh,t]/.t->0]

Re[D[Xh+Xp,t]/.t->0]

Plot[Xp[[1]],{t,0,30}]

Plot[Re[Xh[[1]]],{t,0,30}]

Plot[Xp[[1]]+Re[Xh[[1]]],{t,0,30}]

Check close up to see that initial conditions are really satisfied:

Plot[Xp[[1]]+Re[Xh[[1]]],{t,0,1}]

Here we plot all the X, with a shift added to the displacements to
make them easier to see.  The shift makes a plot look like the 
displacement from a common origin, as it might naturally appear
if the masses are hanging from a ceiling.

XX=Xp+Re[Xh]+Table[1-m,{m,1,n}];

Plot[Evaluate[XX],{t,0.,30.}]