A formal approach for the inverse dynamic control of flexible beams