Compression In a current carrying spring A spring with $N$ turns radius $R$ and spring constant $k$ with initial length $L$. Current $I$ is flown through it. Find the amount of compression in the spring.
I first tried this question using conserving energy and taking spring as an inductor. Initial magnetic energy $=$ final magnetic energy + spring potential energy.
But that didn't workout. Later I derived force on lateral surface of spring by using magnetic pressure but I don't know how to proceed.
 A: Here are some ideas that you might find useful...
(a) Assume that the spring behaves as a long solenoid. The magnetic flux through the central region of the solenoid will therefore be $\Phi _0 = \pi R^2 \mu_0 \nu I$ in which $\nu=\frac NL$.
(b) The flux leaving the geometrical end of the solenoid (and entering the other end) will be $\tfrac12\Phi_0$ (because at the end of a long solenoid, half the solenoid is missing!)
(c) But $\text{div} \vec B = 0$ so the flux, $\Phi-\tfrac12\Phi_0=\tfrac12\Phi_0$, that doesn't leave through the geometrical end must leave through the sides of the solenoid in the region near the end (and must enter through the sides at the other end). It is the radial component of this flux that exerts an axial motor effect (Laplace) force on the end turns of the solenoid, squashing it.
(d) The axial component of the motor effect force on a length d$z$ of the end region of solenoid, containing $\nu dz$ turns is
$$dF=B \sin \theta\ I\ 2 \pi R \nu dz$$
(e) But $B \sin \theta\ 2 \pi R dz$ is the flux, $d \Phi$, leaving the sides of the solenoid over the length $dz$ of solenoid.
(f) So the (axial) force on length $dz$ of solenoid is
$$dF=I \nu d \Phi$$
(g) Integrating, the total force on each end region is
$$F=I \nu \tfrac12 \Phi_0= \frac{\pi}{2} \mu_0 R^2 \frac{N^2}{L^2} I^2.$$
(h) The spring as a whole is therefore under this compressive force (negative tension), just as if I were pushing each end inward with my hands. We have already assumed that the spring is long compared with its diameter, so the end regions, where the field splays out and the compressive forces arise, are short compared with the total length of the spring. It is therefore a reasonable approximation to neglect the fact that the end regions themselves are not compressed as much as the rest of the spring.
(h) The last step should be pretty straightforward!
