A new methodology for the optimal design of crash-boxes