Let's see. Wouldn't that be as follows?
k_basic = member basic coordinate system (CS) stiffness matrix.
k = truss (rod) member global stiffness matrix.
K = structure global stiffness matrix.
D = structure nodal global displacements.
R = structure nodal global applied external loads.
Code:
k_rod = EA/L.
k_spr = ko.
k_basic = k_rod + k_spr = (EA/L + ko).
r = kd
--Truss-member global stiffness relation. (1)
Code:
[r1] [ c^2 cs -c^2 -cs ][d1]
[r2] = (k_basic)[ cs s^2 -cs -s^2][d2]
(2)
Code:
[r3] [-c^2 -cs c^2 cs ][d3]
[r4] [-cs -s^2 cs s^2][d4]
where
ko = spring constant of parallel spring.
r = member end-forces array, in global CS.
d = member end displacements array, in global CS.
c = cos(alpha).
s = sin(alpha).
alpha = member end 1 angle from global
x axis to member axis.
Note that the truss member basic stiffness matrix, k_basic, is 1 x 1. If there's only one member in your structure, solve the equation P = (k_basic)(delta) for delta and you're done. I.e., delta = P/(k_basic), where P = member nodal basic applied external (axial tensile) loads and delta = relative end displacements in basic (axial) CS.
If, however, there's more than one member in your structure, assemble (add) partitions of each Eq. 2 member global stiffness matrix k into proper node locations of structure global stiffness matrix K, then solve R = KD for D. I.e., D = (K^-1)R. Then backsubstitute D solution partitions back into Eq. 2 member global stiffness equations to solve for r. Good luck.