Optimal design of flexible mechanisms using a generalized equivalent static load method