You can apply unit loads to your flexibility matrix. The resulting deflections & rotation can be used to set the terms in the stiffness matrix that you can build.
Some of this work appears in a CAESAR II presentation for CAU Express in 2015; it's titled F=KX.
What's interesting to me is that even though all the popular pipe stress programs use the stiffness method, the piping codes still provide a flexibility factor for these bends. So, even today, CAESAR II starts with a bend flexibility matrix (like you are doing here) and then inverts it to give the stiffness matrix.
_________________________
Dave Diehl