Virtual experiments in teaching electromagnetic theory