Equations of motion for maneuvering flexible spacecraft