In today's design, system complexity and increasing demand for safer, more efficient and less costly systems have created new challenges in science and engineering. Locomotives are products which are designed according to market order and technical needs of customers. Accordingly, targets of companies, especially designers and manufacturers of locomotives, have always been on the path of progress and seek to offer products with higher technology than other competitors. Quality of body structures is based on indicators such as natural frequency, displacement, fatigue life and maximum stress. Natural frequency of various components of the system and their adaption to each other are important for avoiding the phenomenon of resonance. In this study, body structures of ER24 locomotive (Iran Safir Locomotive) was studied. A combination of imperialist competitive algorithm (ICA) and artificial neural network was proposed to find optimal weight of structures while natural frequencies were in the determined range. Optimization of locomotive's structure was performed with an emphasis on maintaining locomotive abilities in static and dynamic fields. The results indicated that use of optimization techniques in the design process was a powerful and effective tool for identifying and improving main dynamic characteristics of structures and also optimizing performance in stress, noise and vibration fields.