Finding the Coefficient Matrix of a Spring-Mass System So as part of a class in numerical linear algebra, we're exploring the topic of banded matrix system. I've come across a problem that involves Hooke's Law, but I'm having a little difficulty interpreting how to attack the problem. Here we have a diagram for $n$ carts: 
And our task at hand is to create the coefficient matrix for this system. Here are our givens about this system:
Taking $n=6$, since the $i^{th}$ cart is only connected to the two adjacent carts, the $i^{th}$ equation for our system is of the form $$a_{i,i-1}x_{i-1} + a_{i,i}x_{i} + a_{i,i+1}x_{x+1} = b_{i}$$
And I know that Hooke's Law is $$\vec F = \kappa \vec x,$$where $\vec x$ is our displacement vector, $\vec F$ is our force vector, and $\kappa$ is our spring constant matrix. It tells us that each spring has stiffness $k_i = 1 \,\mathrm{N/m}.$ So I thought we should have our matrix equation analogous to this: $$\begin{bmatrix}a_{11} & a_{12} & 0 & 0 & 0 & 0 \\
a_{21} & a_{22} & a_{23} & 0 & 0 & 0 \\
0 & a_{32} & a_{33} & a_{34} & 0 & 0 \\
0 & 0 & a_{43} & a_{44} & a_{45} & 0 \\
0 & 0 & 0 & a_{54} & a_{55} & a_{56} \\
0 & 0 & 0 & 0 & a_{65} & a_{66}\end{bmatrix}\begin{bmatrix}x_1 \\ x_2 \\ x_3\\ x_4 \\ x_5 \\ x_6\end{bmatrix} = \begin{bmatrix}f_1 \\ f_2 \\ f_3 \\ f_4 \\ f_5 \\ f_6\end{bmatrix}$$
My question being is that I'm having difficulty determining the coefficient matrix completely. I have the restriction that my matrix must be invertible and positive-definite $\iff$ all our eigenvalues must be positive. I'm not sure what the implications of the diagram are. We're given no more information nor are we asked to solve it, so to me, that suggests that $\vec F$ is not necessarily the zero vector. What exactly do we know about the entries of the coefficient matrix, $\kappa$?
 A: Hooke's Law states that for a spring perturbed from it's natural length $L$, this spring will apply a force $F=-\kappa\Delta x$ (or $+\kappa\Delta x$ depending on convention) where $\Delta x=x-L=\eta$. Notice what the minus sign is telling you: if the coordinate of the end of the spring (say, a mass attached to the spring) is greater than $L$, then there is a negative restorative force on the object. The object is being pulled back to the left. If on the other hand the $x$ coordinate is less than $L$, then $F$ is positive, which signifies a force pushing the mass to the right because the mass is compressing the spring.
Now, let's choose a coordinate system to describe our system. One system of coordinates is to consider the position of each cart with respect to the left wall, so that it may be our origin. But that is more complicated than need be, and it seems the coordinate system you have chosen is one of displacements from equilibrium. Thus, if $x_{0i}$ signifies the equilibrium position (where the objects are at rest with no net force), let $\eta_i=x_i-x_{01}$, i.e, $\eta_{i}$ represents the displacement from equilibrium, which is most important when dealing with springs.
Then we have the following equations:
$f_{1}=-k_1\eta_1+k_2(\eta_2-\eta_1)=-(k_1+k_2)\eta_1+k_2\eta_2$
$f_2=-k_{2}(\eta_2-\eta_1)+k_3(\eta_3-\eta_2)=k_2\eta_1-(k_2+k_3)\eta_2+k_3\eta_3$
...
$f_i=-k_i(\eta_i-\eta_{i-1})+k_{i+1}(\eta_{i+1}-\eta_i)=k_i\eta_{i-1}-(k_i+k_{i+1})\eta_i+k_{i+1}\eta_{i+1}$
...
$f_{n}=-k_n(\eta_n-\eta_{n-1})-k_{n+1}\eta_n=k_n\eta_{n-1}-(k_n+k_{n+1})\eta_n$
Notice what these equations are saying: on the $i$th cart, if the displacement to the right (or positive direction to be more proper) of the $i$th cart is greater than the $i-1$-th cart's displacement, then the left-side spring is stretched out beyond its natural length, and will apply a restorative force, pulling the $i$th cart to the left (or negative direction), and the $i-1$th cart to the right (or positive direction).
For your problem, things are even simpler: all $k_i=1$. So your matrix will have the pattern $1,-2,1$ at the $i$th column, except of course for the first and last columns. You might have to multiply this matrix by $-1$ depending on convention (whether you consider the force applied to a spring, or the force a spring applies; I imagine you use the latter convention due to the positive-definiteness condition, so multiply my matrix by $-1$). The invertibility tells you that there is a force if and only if there is a displacement. The sign-definiteness tells you that your force is always along or in the opposite direction of your displacement.
