Hello everybody! For a physics project, I'm trying to create an electromagnet exposed to varying current, determined by a sensor. This sensor will measure the distance between a magnet under the electromagnet and the electromagnet itself, and then we'll need to convert this distance to the current supplied to the elctromagnet, in order to make the magnet levitate under the electromagnet. Currently, I have barely any knowledge in electromotive forces, magnetomotive forces, and magnetic fields. Can somebody give me a general idea of what wikipedia pages and textbook sections to read about, as well as a general formula (if one exists?) Any help is appreciated. Thank you all so much!