Free and forced vibrations of nanowires on elastic substrates