Modelling of flexible multibody dynamics and a computer method via the bond graph method