Optimal Design of Miniature Flexural and Soft Robotic Mechanisms