Dynamic analysis of elastic-plastic beams by means of thermoelastic solutions