State space formulation of magneto-electro-elasticity in Hamiltonian system and applications