A projection approach to optimization of the spatial motions for an elastic beamстатья