Bar Magnet as an Equivalent Solenoid:
Magnetic field lines for a bar magnet and a current carrying solenoid Re resemble very closely. Therefore a bar magnet can be thought as a large number of circulating currents in analogy with a solenoid.
Let i be the current passing through a solenoid, a be the radius of the solenoid, 2l be the length of the solenoid and n be the number of turns per unit length of the solenoid.
Let P be the point at a distance r from the centre at which magnetic field is to be calculated.
The magnetic field magnitude at point P due to the circular element is given by