If you want 2.5 Amps to flow through the inductor then you need a constant current regulator.Thanks for correcting it. Yes the current is what affects the intensity of the magnetic field of the electromagnet. I have been reading about buck converters and will soon try to use it instead of the high 24 V and avoid wasting power in the 10 Ohm resistor. I am thinking of using this type of buck converter:
https://www.electronicscomp.com/xl4...sQGAOrwCz3ZtTXi6YZ5t9snwGsVj1JCxoCaVUQAvD_BwE
Then for 2.5 Amps to flow through the inductor I will need a 2 Ohm, 10 Watts resistor in series with the electromagnet/inductor. The Power supplied by the buck converter would be 12.5 Watts which is much lesser than the 57 Watts wasted by the resistor.
However I also read the buck converter generates heat which could be dissipating electric power to some extent but that may not be as high as the 57 Watts dissipated by the resistor.
