Professional Documents
Culture Documents
21 Nonlinear Mass Spring
21 Nonlinear Mass Spring
2024/05/03
Goals
Here, we develop a nonlinear version of the mass–spring system as a test problem
for optimization methods.
For this class, it is not necessary that you completely understand the physical
significance of the model presented below. It is enough that you understand
the definition of the total energy function so that you can minimize it using
line-search methods.
Hooke’s Law
First, we briefly review the mass–spring system introduced earlier. Consider a
one-dimensional lattice of masses connected by springs:
Let
• k: the spring constant of all of these springs
• r: rest length of all springs
• xi : location of i’th mass on real line
• Fie : external force acting on i’th mass
Assume for simplicity that
• x0 = 0, so left endpoint of first spring is fixed at 0
• xn = 1, so right endpoint of last spring is fixed at 1
• springs constrained to lie on a line, cannot bend in three dimensions
• masses constrained so that xi < xi+1 for all i = 1, . . . , n − 2
1
We have seen a model for the mass-spring system based on Hooke’s law. Recall
that Hooke’s law can be formulated either in terms of forces or energies. Here,
we start with the energy.
Define
x = (x1 , . . . , xn−1 ) ∈ Rn−1
to be the vector of positions of masses.
Let
1
k(|xi+1 − xi | − ℓ)2
Ei (x) =
2
be the energy associated with the spring that lies between xi and xi+1 .
It will be convenient to write the energy in a slightly different form. We define
1
ψ(r) = k(r − ℓ)2 ,
2
and we have
1
Ei (x) = k(|xi+1 − xi | − ℓ)2 = ϕ(|xi+1 − xi |).
2
The energy Ei (x) is a potential for the forces induced by the spring between xi
and xi+1 , i.e. the force induced by that spring on the mass at xi is
∂
− ψ(|xi+1 − xi |)
∂xi
and the force induced on the mass at xi+1 is
∂
− ψ(|xi+1 − xi |).
∂xi+1
The total potential energy of the system is the sum of the energy of each spring
plus the sum of the energies due to external forces:
n−1
X n−1
X n−1
X n−1
X
E(x) = Ei (x) − Fie xi = ψ(|xi+1 − xi |) − Fie xi .
i=0 i=1 i=0 i=1
Energies such as this have deep physical significance. For now, we simply observe
the following:
1. The force is minus the gradient of the energy, and in particular the total
∂E
force experienced by mass i when the masses are at positions x is − ∂xi
(x) =
−(∇E(x))i .
2. Any minimizer x of the potential energy must be a critical point of E
with ∇E(x) = 0, and therefore the forces are zero when the masses are
at energy minimizing positions x. That is, minimizers of the energy are
mechanical equilibria.
2
Lennard–Jones Energy
Suppose we were to replace the function ψ in the energies defined above with
the Lennard-Jones potential
σ 12 σ 6
ϕ(r) = 4ϵ − .
r r
In the new model, the forces on the masses are still minus the gradient of the
energy. In particular, the force induced by the spring between xi and xi+1 on
the mass at xi is
∂
− ϕ(|xi+1 − xi |).
∂xi
The force on induced by the same spring on the mass at xi+1 is
∂
− ϕ(|xi+1 − xi |).
∂xi+1
Solids
Under the Lennard-Jones model, one could interpret the masses as atoms in
some solid material and the springs as chemical bonds that hold them together.
In this context, one should imagine a spring between every pair of atoms, not
just nearest neighbors in the chain.
3
We will consider the energy
n−1
X n−2
X n−1
X
E(x) = ϕ(|xi+1 − xi |) + ϕ(|xi+2 − xi |) − Fie xi ,
i=0 i=0 i=1
| {z } | {z }
first nearest neighbors in the chain second nearest neighbors in chain
which places Lennard-Jones springs between first and second nearest neighbors
in the chain. (Interactions between more distant masses or atoms are ignored.)
4
diagonals and it is symmetric. Therefore, if you knew E ′′ (xk ) to be positive
definite, you could use conjugate gradients or Gauss–Seidel, for example.
But E ′′ (xk ) might not be positive definite or even invertible.
Of course, when E ′′ (xk ) is not invertible, Newton’s method is not even well-
defined.
What about positive definiteness? Roughly speaking, E ′′ (x) is positive definite
when the springs are close to their rest lengths, but it isn’t positive definite if
you stretch the springs too much. I won’t prove this. The point is simply that
under some conditions that might actually be of scientific interest, E ′′ (x) is not
positive definite. When E ′′ (xk ) is not positive definite, you can’t use conjugate
gradients and you have no guarantees regarding the convergence of Gauss–Seidel.
An additional problem associated with positive definiteness: When E ′′ (xk ) is not
positive definite, it may be that −E ′′ (xk )−1 ∇E(xk ) is not a descent direction.