Numerical modelling of the interaction of nanoparticles with electromagnetic waves