Factors affecting magnetic field strength of an electromagnet