Analysis of microstructures and phase transition phenomena in one-dimensional, non-linear elasticity by convex optimization