A finite element approach to the inverse dynamics and vibrations of variable geometry trusses