This paper proposes a Hindmarsh–Rose(HR) neuron model controlled by electromagnetic radiation to solve the mechanical optimization design problem. A novel memristor for simulating electromagnetic radiation is established to control the dynamical behavior of HR neuron models. By analyzing the HR model and using the numerical analysis methods of phase portrait, bifurcation diagram, Lyapunov exponent and spectral entropy (SE) complexity, the HR model is shown to have a hidden attractor and rich chaotic dynamics. Then, a chaotic optimization algorithm based on HR neuron model is designed to solve the mechanical optimization design of tension/compression coil springs and pressure vessels. The chaotic sequence of this algorithm which has high-quality pseudo-random number, has stronger global search ability. Simulation of two mechanical optimization design problems in comparison with some well-known optimization algorithms demonstrates the superiority of the HR in the solution quality.