Enhancing magnetic force of an electromagnet