On profile reconstruction of Euler–Bernoulli beams by means of an energy based genetic algorithm