The Magnetic Field Due to a Solenoid
A loop of wire carrying an electric current generates the magnetic field shown below.
Many loops close together will reinforce the field in some directions – outside and inside the current loops, parallel to the coil axis – and cancel it in other directions – perpendicular to the coil axis.
Bringing the loops very close together will produce a field like a bar magnet. The solenoid will in fact behave similarly to a bar magnet, with a North pole and South pole, attracting and repelling each other in accordance with the law, 'Like poles repel, unlike poles attract'.
The field at the centre of the solenoid is given by the equationwhereis the number of turns per unit length.