Geometry optimization of a slender cantilever beam subjected to lateral buckling