System Stiffness
The system stiffness is calculated in some steps one after the other.
The basic idea is to get the springs stiffness from the relation of the potential energy of the deformed springs with the stiffness matrix K and the vector of the deformation q. This relation is valid for the total system as well as for every single spring with every main direction (x, y and z) for itselves. The potential energy of the total system is the sum of the potential energy of all single springs with respect to every main directions.
And this is the method to get the stiffness matrix. We consider the potential energy U_{ij} = c_{ij}u_{j}^{2} for spring i in direction j = x, y, z. First we do this in general manner for the lower and the upper springs.
Next we extract the entries of the global stiffness matrix from the this expression for the potential energy for each direction. This can easy be done. Just find the coefficient in the relation for U of all global coordinates x_{i} x_{j} with x = q, p (lower mass and upper mass) and i, j = 1..6, see the set xlist.
So the first step to get the stiffness matrix is to calculate the deformation of the springs and the square of all this.
deformation of the lower springs
Here, we describe the deformation of the lower springs in general manner in terms of the position and orientation of the lower mass.
q1, q2,...,q6 are the degrees of freedom (q1, q2, q3 being the linear motion in x, y, z direction respectively and q4, q5 and q6 being the rotation about the x, y, z axis with respect to the c.o.g.) of the lower body.
a_{k,x}, a_{k,y}, a_{k,z} are the general descriptions of the lower springs positions with respect to the c.o.g. of the lower mass. They are substituted later by the real spring positions of every spring one after the other when the stiffness matrix is generated.
u1, u2 and u3 are the spring deformations in the x, y and z direction respectively. Note that the springs rotational stiffness is neglected.
deformation of the upper springs
For the upper springs, the deformation is described in terms of the position and orientation of the upper and the lower body.
p1, p2,...,p6 are the degrees of freedom of the upper body (similar to the q defined for the lower body).
b_{k,x}, b_{k,y}, b_{k,z} are the general descriptions of the upper end of the upper springs positions with respect to the c.o.g. of the upper mass, bq_{k,z} is the general description of the lower end of the upper springs positions with respect to the c.o.g. of the lower mass. They are substituted later by the real spring positions of every spring one after the other when the stiffness matrix is generated.
o1, o2 and o3 are the spring deformations in the x, y, and z direction respectively.
general form of stiffness matrix for individual spring directions
Using the above deformation equations, we can extract the general form of the spring stiffness components for each direction from the potential energy according to [1].
cl1, cl2, cl3:

12 x 12 stiffness matrices for the lower springs in x, y, and z direction respectively.

co1, co2, co3:

12 x 12 stiffness matrices for the upper springs in x, y, and z direction respectively.

> 

Now we calculate the potential energy of the springs in every direction one after the other. The coefficients of the expression c_{spring number,direction} qi qj (same for pi and pj) yield the entry i,j of the stiffness matrix of each direction of the lower and the upper springs. We do this in two steps. First get the diagonal matrix with the coefficients if j=i using x2list, next we add the entries for i≠j.
stiffness matrix for every spring in every direction
With the above general form of the stiffness matrices in the x, y, and z direction, we can generate the stiffness matrix associated with each spring by substituting the parameters corresponding to each of the springs.
The following index notion are used for the resulting table of stiffness matrices:
first index (): 1, 2, 3 and 4 for lower springs; 5, 6, 7 and 8 for upper springs,
second index (): for direction x, y and z
overall stiffness matrix
Finally, to get the overall system stiffness matrix, we add up all of the individual stiffness matrices.
> 

> 

(right mouse click on the place holder and choose " Browse " to see the entries of the matrix)