I think you can find the solution from the book: Analytical and Numerical Methods for Vibration Analyses by J.S. Wu, published by John Wiley & Sons Singapore Pte. Ltd. 2013.
In deflection of beams there are two theory i.e. Euler-Bernoulli and Timoshenko beam. Theory of Euler-Bernoulli beam is based on the assumption that plane cross sections remain plane and perpendicular to the longitudinal axis after bending. Assumption of normality to the longitudinal axis was removed in Timoshenko beam theory, so transverse shear strain is not zero.
please see An introduction to the finite element method (New York: McGraw-Hill) by Reddy, J.N. chapter 5.3 page 261 and this pdf has been uploaded
Please see Section 4.3.2 on page 314 and Fig. 4.18 on page 316 of the book "Analytical and Numerical Methods for Vibration Analyses" by J.S. Wu published by John Wiley & Sons Singapore Pte. Ltd., 2013. It is noted that the formulation in Section 4.3.2 is available for the "non-uniform" Timoshenko beam carrying various concentrated elements and elastically supported by a number of linear springs with stiffness Kt,i and rotational springs with stiffness Kr,i.
For a "uniform" beam without carrying any concentrated elements, one may set the diameters of all beam segments to be "equal to each other" (if the cross-section of the beam is circular), and all lumped masses mi as well as Kt,i and Kr,i to be equal to zero (mi=ei=Ji=0 and Kt,i=Kr,i=0 with i=2 to n) except that the stiffness of the linear springs and rotational springs at both ends are dependent on the boundary conditions (BCs) of the entire beam. For the Pinned-Pinned (P-P) beam, one may set the stiffness of the linear springs very large (e.g., Kt,1=Kt,n+1=1.0E16 or larger) and that of the rotational springs to be equal to zero (i.e., Kr,1=Kr,n+1=0). For a Clamped-Clamped (C-C) beam, one may set the stiffness of both linear springs and rotational springs to be very large (e.g, Kt,i=Kr,i=1.0E16 or larger, with i=1 and n+1). It is noted that one may obtain various hybrid BCs by only adjusting the magnitudes of stiffness of the linear springs and rotational springs located at both ends of the entire beam. for example, C-P, C-F, P-C, F-C, F-F, ect. For a Free-Free (F-F) beam, Kt,i=Kr,i=0 with i=1 and n+1. It is hope that you may find many useful numerical examples from that book.