Solving numerically invers electromagnetic problems with applications for material characterisation and source analysis