In this example, I will introduce a little bit more complicated model than the previous one and I will also show you a new method to construct a Matrix for the system. The method we used in previous example was more relevant to real physical characteristics of the system. But it will be very tedius to construct the matrix via going through every details of physical characteristics.
In this example, I will introduce another widely used method but easier to construct a mathematical model. (Note : I got this specific example model from MIT opensource : http://www.youtube.com/watch?v=oNqSzzycRhw and try to describe in my own words).
- What system is being modeled ?
- What does the finished matrix look like ?
- How is each element of the matrix obtained ?
- Why do the two rules work ?
- How are the cart displacements found ?
What system is being modeled ?
Let's look at the model first, because the size and the pattern of the matrix both come from it. The previous page had springs in a single chain. Here one cart is connected to several others, and two springs sit side by side between the same pair of carts.
The model which was given in the lecture linked above is as follows. (You would see this kind of example from various sources with just a little bit of modification, but I intentionally used the model as it is from the above link so that you can learn the same thing from different source (the link above and this page). Of course, the final outcome will be the same but a little bit different way of description)
The drawing above has three carts on rollers, so each cart can move only horizontally. A wall on the left is the fixed point. Five springs connect the carts to each other and to the wall.
- k1 connects cart 1 to the wall.
- k2 and k3 both connect cart 1 and cart 2. They act side by side, in parallel.
- k4 connects cart 1 and cart 3, and it passes over cart 2 without touching it.
- k5 connects cart 2 and cart 3.
- x1, x2 and x3 are the cart displacements, and F1, F2 and F3 are the outside forces on the carts. All of them are positive to the right.
we have three carts connected each other and a fixed point by five springs. This system will be described by the following matrix equation. See the matrix is 3 x 3 matrix and the size of the matrix determined by the number of carts in the model and we call each of the carts as a "Node" in this section. You would notice the size of Matrix is determined by the number of nodes.
The generic matrix above has one small error. The element in row 2 and column 3 should read a23, but the drawing shows a21 there. The completed matrix below has the correct entry in that position.
One cart is one node : three carts give three unknown displacements, so the matrix is 3 x 3.The wall is not a node : it never moves, so it adds no row and no column to the matrix.
What does the finished matrix look like ?
It helps to see the target before the method. The complete matrix is shown first. Then the next section builds every element of it one at a time, so you can check each step against the answer.
Now the question is to determine each of the elements of the matrix according to the condition given in the model. Let me give you the answer key first and let's go through each of the steps to realize the matrix. Just with a brief look, you will notice following characteristics.
i) All the values on the diagonal line of the matrix are positive values.
ii) All the values not on the diagonal line of the matrix are negative values.
iii) Values not on the diagonal line of the matrix are symetric. (e.g, a21 = a12, a31 = a13 etc).
The three characteristics above describe the matrix of this example. Statement ii) needs one condition in general, though. An off-diagonal element is negative only when a spring connects the two carts. If no spring joins cart i and cart j, then aij = 0. In this model every pair of carts is connected, so all six off-diagonal elements happen to be negative.
The diagonal is positive : each diagonal element is a sum of spring constants.The off-diagonal is negative or zero : it is zero when no spring connects the two carts.The matrix is symmetric : a spring between two carts acts on both of them equally.
How is each element of the matrix obtained ?
Only two rules are needed, one for the diagonal and one for the off-diagonal. The diagonal rule is applied three times and the off-diagonal rule three times. In each drawing below, the springs that take part in the element are shown in red.
Now let's look into the steps of how we get the values for each of the element.
a11 is obtained as shown below. The meaning of a11 is the summation of the spring constants (stiffness constants, k) which are connected to Cart 1 (node 1). As shown below, all the springs connected to Node 1 are shown in red. As you see, spring 1,2,3,4 are connected to node 1. So the value becomes k1+k2+k3+k4.
a22 is obtained as shown below. The meaning of a22 is the summation of the spring constants (stiffness constants, k) which are connected to Cart 2 (node 2). As shown below, all the springs connected to Node 2 are shown in red. As you see, spring 2,3,5 are connected to node 2. So the value becomes k2+k3+k5.
a33 is obtained as shown below. The meaning of a33 is the summation of the spring constants (stiffness constants, k) which are connected to Cart 3 (node 3). As shown below, all the springs connected to Node 3 are shown in red. As you see, spring 4,5 are connected to node 3. So the value becomes k4+k5.
a12 and a21 are obtained as shown below. The meaning of a12 and a21 is the summation of the spring constants (stiffness constants, k) which are connecting Cart 1 and Cart 2 (node 1 and node 2). As shown below, all the springs connecting the two nodes are shown in red. As you see, spring 2,3 are connecting the two nodes. So the value becomes -k2-k3. But notice that these values has negative sign.
a23 and a32 are obtained as shown below. The meaning of a23 and a32 is the summation of the spring constants (stiffness constants, k) which are connecting Cart 2 and Cart 3 (node 2 and node 3). As shown below, all the springs connecting the two nodes are shown in red. As you see, spring 5 is connecting the two nodes. So the value becomes -k5. But notice that these values has negative sign.
a13 and a31 are obtained as shown below. The meaning of a13 and a31 is the summation of the spring constants (stiffness constants, k) which are connecting Cart 1 and Cart 3 (node 1 and node 3). As shown below, all the springs connecting the two nodes are shown in red. As you see, spring 4 is connecting the two nodes. So the value becomes -k4. But notice that these values has negative sign.
This is more complicated than the previous example, but I hope you might feel easier than the previous one because the steps were described in a kind of mechanical procedure without much of mathematics and physics. If you feel that you would be able to write a computer program to create this kind of matrix, then you can say you fully understood these steps.
Let's summarize the two rules in a form that you can apply to any spring network.
aii = sum of the spring constants of all springs attached to node i aij = -(sum of the spring constants of all springs between node i and node j), i not equal to j
A spring to the wall appears only in one diagonal element, because the wall has no row of its own. That is why k1 appears in a11 and nowhere else. Every other spring appears four times: twice on the diagonal with a plus sign, and twice off the diagonal with a minus sign.
The diagonal collects every spring on a node : a11 = k1 + k2 + k3 + k4.The off-diagonal collects the springs between two nodes : a12 = -(k2 + k3), because k2 and k3 are in parallel.A spring to a fixed point touches only one diagonal element : k1 appears only in a11.
Why do the two rules work ?
The two rules look like a recipe, but they come from the same force balance that the previous page used. Let's write that balance for cart 1 and see the first row of the matrix appear.
Move cart 1 by x1, cart 2 by x2 and cart 3 by x3. Each spring then carries a force equal to its constant times its stretch. The outside force F1 must balance the four springs attached to cart 1.
F1 = k1x1 + k2(x1 - x2) + k3(x1 - x2) + k4(x1 - x3) = (k1 + k2 + k3 + k4)x1 - (k2 + k3)x2 - k4x3
Every spring attached to cart 1 contributes +k x1, so a11 is the sum of all of them. A spring to another cart also contributes -k times the displacement of that cart, so the off-diagonal elements carry the minus sign. The wall spring k1 has no second term, because the wall does not move. The same balance at cart 2 and cart 3 gives the other two rows.
This model also differs from the previous page in one important way. There, the chain of springs was free, so the matrix was singular until node 1 was fixed. Here the wall spring k1 holds the system in place. The determinant of the matrix is k1(k2k4 + k2k5 + k3k4 + k3k5 + k4k5). It is positive whenever k1 is positive, and it becomes 0 if you remove the wall spring.
Both rules come from the force balance at each node : the diagonal is the coefficient of the node's own displacement, and the off-diagonal is the coefficient of a neighbour's.A connection to a fixed point makes the matrix solvable : without k1, the three carts could move together with no force, and the determinant would be 0.
How are the cart displacements found ?
The closing paragraph above suggests a test: can you write a program that builds this matrix? Let's do that and solve for the displacements at the same time. The program also gives numbers that we can check by hand.
The short Python program below treats the wall as node 0. It adds each spring to the matrix with the two rules and then deletes row 0 and column 0, because the wall does not move. The springs have k1 to k5 = 10, 20, 30, 40 and 50 N/m, and a force of 10 N pulls cart 3 to the right.
import numpy as np
# (node a, node b, stiffness) ; node 0 is the wall
springs = [(0, 1, 10), (1, 2, 20), (1, 2, 30), (1, 3, 40), (2, 3, 50)]
K = np.zeros((4, 4))
for a, b, k in springs:
K[a, a] += k; K[b, b] += k
K[a, b] -= k; K[b, a] -= k
K = K[1:, 1:] # the wall does not move : drop its row and column
x = np.linalg.solve(K, [0, 0, 10])
print(K)
print(x)
The program prints the matrix [100 -50 -40; -50 100 -50; -40 -50 90] and the displacements x = (1.000, 1.077, 1.154) m. The exact values are x1 = 1, x2 = 14/13 and x3 = 15/13 m.
You can check these numbers with the spring forces. The wall spring carries k1x1 = 10 N, which is the whole outside force, as it must be. At cart 3, spring k4 carries 40 x 2/13 = 6.15 N and spring k5 carries 50 x 1/13 = 3.85 N. Together they balance the 10 N pull. At cart 2, the parallel pair k2 and k3 carries 50 x 1/13 = 3.85 N, which balances the pull of k5.
Assembly is a short loop : each spring adds its constant to two diagonal elements and subtracts it from two off-diagonal elements.A fixed node is removed after assembly : treating the wall as node 0 and deleting its row and column gives the same matrix as the rules.Force balance checks the answer : the wall spring must carry the full outside force, and each cart must be in balance.