Algorithms for synthesizing mechanical systems with maximal natural frequencies