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  m _ n, is fixed.  The first spring, the spring connected to the left of m _ 1, can be "jiggled" from the left with displacement x _ 0(t). The system of equations to solve is :
d^2/dt^2X = A X + F
where, for an example of 3 masses,
X = (x )       1       x       2       x       3
A = ( k  + k    k                  )        1    2    2      --------   --         m       m          1       2         0       k           k  + k    k       2           2    3    3      --         --------   --      m             m       m       2             2       3                  k           k  + k                  2           3    4                 --         --------                 m             m      0           3             3
F = (k    )       1      -- x      m   0       1           0           0
We can make this system dimensionless by using m _ 1/k _ 1^(1/2)as the time scale:  t = τ m _ 1/k _ 1^(1/2).  The dimensionless system will be written as
d^2/dτ^2 X = A X + X _ 0,
where now all the k _ j and m _ j should be interpreted as the ratio of the dimensional value to k _ 1and m _ 1, respectively.  For example, if all k _ j = k _ 1and m _ j = m _ 1, then
A = (-2   1    1 )       1    -2   1       1    1    -2
Also,
X _ 0 = (x )           0            0            0
Let the eigenvectors of A be written as K _ j and the eigenvalues be λ _ j.
Construct a matrix P with the columns being the eigenvectors 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 + X _ 0, <br />
FormBox[RowBox[{Cell[], P^(-1)}], TraditionalForm]P d^2/dτ^2 Y = P^(-1) A P Y + P^(-1) X _ 0,

 d^2/dτ^2 Y = D    Y + P^(-1) X _ 0

where D is a diagonal matrix of the eigenvalues.  Let
G ≡ P^(-1) 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 y _ j = λ _ j    y _ j + 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
X _ h(0) and Overscript[X, .] _ h(0).  The general homogeneous solution is:
X _ h(t) = Re { P Y _ h(t) }
where
y _ hj(t) = c _ j e^(iω _ j t)
Let c _ j = c _ jr + i c _ ji .   And let C be a column vector of the c _ j.
FormBox[RowBox[{RowBox[{X _ h(0), Cell[]}], =,  , P C _ r}], TraditionalForm]
Overscript[X, .] _ h(0) = -P D C _ i
As a matrix problem, this gives
C _ r = P^(-1) X _ h(0)
and
C _ i = -Q^(-1) Overscript[X, .](0)
where Q = P D.

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

In[1]:=

Off[General :: spell]

In[2]:=

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.

In[3]:=

A = (-2    1     0  )       1     -2    1       0     1     -2.

Out[3]=

{{-2, 1, 0}, {1, -2, 1}, {0, 1, -2.`}}

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

{{-2, 1}, {1, -2}}

In[4]:=

n = Length[A]

Out[4]=

3

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

In[5]:=

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

Out[5]=

-4.` - 10.` λ - 6.` λ^2 - λ^3

In[6]:=

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

[Graphics:HTMLFiles/index_56.gif]

Out[6]=

-Graphics -

In[7]:=

Solve[ce == 0, λ]

Out[7]=

{{λ -> -3.414213562373095`}, {λ -> -2.`}, {λ -> -0.585786437626905`}}

Or use the canned routine:

In[8]:=

lam = Eigenvalues[A]

Out[8]=

{-3.4142135623730954`, -2.`, -0.5857864376269049`}

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

In[9]:=

ef = Sqrt[-lam]

Out[9]=

{1.8477590650225737`, 1.4142135623730951`, 0.7653668647301795`}

Let Mathematica find the eigenvectors:

In[10]:=

evect = Eigenvectors[A]

Out[10]=

{{0.49999999999999994`, -0.7071067811865475`, 0.5`}, {-0.7071067811865477`, -7.577190362262357`*^-17, 0.7071067811865474`}, {0.49999999999999994`, 0.7071067811865476`, 0.49999999999999994`}}

Store the eigenvectors are columns in P:

In[11]:=

P = Transpose[evect] ;

Calculate P^(-1):

In[12]:=

Pinv = Inverse[P] ;

Have a look at P^(-1):

In[13]:=

Pinv // MatrixForm

Out[13]//MatrixForm=

( 0.5`                        -0.7071067811865476`        0.5000000000000001`       )    -0.7071067811865477`        -1.9968293511751778`*^-16   0.7071067811865474`    0.4999999999999999`         0.7071067811865476`         0.5000000000000001`

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

In[14]:=

Pinv . (A . P) // MatrixForm

Out[14]//MatrixForm=

( -3.4142135623730954`        3.0444397003392965`*^-16    2.937239210534792`*^-16   )    8.651933336434325`*^-17     -2.`                        1.8026216370287118`*^-16    9.074772183703672`*^-17     -1.0928757898653885`*^-16   -0.585786437626905`

In[15]:=

DiagonalMatrix[lam] // MatrixForm

Out[15]//MatrixForm=

( -3.4142135623730954`   0                      0                    )    0                      -2.`                   0    0                      0                      -0.5857864376269049`

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

In[16]:=

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

Out[16]=

{Sin[t Ω], 0, 0}

Project the forcing onto the eigenvectors:

In[17]:=

G = Pinv . F

Out[17]=

{0.5` Sin[t Ω], -0.7071067811865477` Sin[t Ω], 0.4999999999999999` Sin[t Ω]}

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

In[18]:=

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

Out[18]=

{(0.5` Sin[t Ω])/(3.414213562373096`  - Ω^2), -(0.7071067811865477` Sin[t Ω])/(2.0000000000000004`  - Ω^2), (0.4999999999999999` Sin[t Ω])/(0.5857864376269049`  - Ω^2)}

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

In[19]:=

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

Out[19]=

{1.1092436974789917` Sin[t/2], 0.9411764705882355` Sin[t/2], 0.5378151260504203` Sin[t/2]}

In[20]:=

Xpd = D[Xp, t]

Out[20]=

{0.5546218487394958` Cos[t/2], 0.47058823529411775` Cos[t/2], 0.26890756302521013` Cos[t/2]}

In[21]:=

Xp0 = Xp /. t -> 0

Out[21]=

{0, 0, 0}

In[22]:=

Xpd0 = Xpd /. t -> 0

Out[22]=

{0.5546218487394958`, 0.47058823529411775`, 0.26890756302521013`}

In[23]:=

Q = P . DiagonalMatrix[ef]

Out[23]=

{{0.9238795325112867`, -1.0000000000000002`, 0.38268343236508967`}, {-1.3065629648763766`, -1.0715765374994131`*^-16, 0.541196100146197`}, {0.9238795325112868`, 0.9999999999999998`, 0.38268343236508967`}}

In[24]:=

Qinv = Inverse[Q]

Out[24]=

{{0.2705980500730985`, -0.38268343236508967`, 0.27059805007309856`}, {-0.5`, 0.`, 0.5`}, {0.6532814824381882`, 0.923879532511287`, 0.6532814824381885`}}

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

In[25]:=

Xh0 = -Xp0

Out[25]=

{0, 0, 0}

In[26]:=

Xhd0 = -Xpd0

Out[26]=

{-0.5546218487394958`, -0.47058823529411775`, -0.26890756302521013`}

In[27]:=

Cr = Pinv . Xh0

Out[27]=

{0.`, 0.`, 0.`}

In[28]:=

Ci = -Qinv . Xhd0

Out[28]=

{0.04275913188839186`, -0.14285714285714285`, 0.9727633537779373`}

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...

In[29]:=

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

Out[29]=

{(0.`  + 0.04275913188839186` i) e^(1.8477590650225737` i t), (0.`  - 0.14285714285714285` i) e^(1.4142135623730951` i t), (0.`  + 0.9727633537779373` i) e^(0.7653668647301795` i t)}

In[30]:=

Xh = P . Yh ;

Check that we really did satisfy initial conditions:

In[31]:=

Re[Xh] /. t -> 0

Out[31]=

{0.`, 0.`, 0.`}

In[32]:=

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

Out[32]=

{-0.5546218487394959`, -0.47058823529411775`, -0.2689075630252102`}

In[33]:=

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

Out[33]=

{-1.1102230246251565`*^-16, 0.`, -5.551115123125783`*^-17}

In[34]:=

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

[Graphics:HTMLFiles/index_118.gif]

Out[34]=

-Graphics -

In[35]:=

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

[Graphics:HTMLFiles/index_121.gif]

Out[35]=

-Graphics -

In[36]:=

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

[Graphics:HTMLFiles/index_124.gif]

Out[36]=

-Graphics -

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

In[37]:=

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

[Graphics:HTMLFiles/index_127.gif]

Out[37]=

-Graphics -

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.

In[38]:=

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

In[39]:=

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

[Graphics:HTMLFiles/index_132.gif]

Out[39]=

-Graphics -


Converted by Mathematica  (March 3, 2003)