The assembled FE equation of the whole system can be obtained as
Boundary conditions are (i.e. the linear displacement and the moment at the end of teh beam is zero ) for simply supported ends. Above global equation after eliminating 1st and 7th rows and columns reduces to