The problem comes from 'introduction to classical mechanics' by David Morin. It is as follows:
A chain with mass density $\sigma$ kg/m hangs from a spring with spring constant $k$. In the equilibrium position, a length $L$ is in the air, and the bottom part of the chain lies in a heap on the floor; see figure. The chain is raised by a very small distance, $b$, and then released. What is the amplitude of the oscillations, as a function of time?
Assume that (1) $L >>b$, (2) the chain is very thin, so that the size of the heap on the floor is very small compared with $b$, (3) the length of the chain in the initial heap is larger than $b$, so that some of the chain always remains in contact with the floor, and (4) there is no friction of the chain with itself inside the heap.
Now how I tried it is as follows:
Let the length of chain on ground(heap) initially be $c$. Initially the elongation of the spring would be $x_0=\frac{\sigma Lg}{k}$. At any moment let $x$ be the further displacement of the spring in downward direction. Then the length of spring in air would be $L-x$ and on the ground would be $c+x$. The total momentum of the chain would be $\sigma \dot {x}(L-x)$ in the downward direction. Hence by equating force with $\frac{dp}{dt}$, we get that $\sigma (L+c)g-F_{ground}-k(x+x_0)=\sigma (\ddot{x}(L-x)-\dot{x}^2)$ where $F_{ground}$ is the force from the ground in the upward direction. Also we see that force from ground does 2 things, i.e. it balances the weight of the chain already on the ground and it stops the motion of the part of the chain that strikes it, hence $F_{ground}=\sigma (c+x)g+\frac{\sigma \dot{x}dt \cdot \dot{x}}{dt}=\sigma (c+x)g +\sigma \dot{x}^2$. Hence we get that( using the previous equation) $ x(\sigma g +k)=-\sigma \ddot{x}(L-x)$. It is valid only when the chain is moving down, because if it is moving upwards then $F_{ground}$ will not contain $\sigma \dot{x}^2$ whereas the first equation would be the same, hence for upward motion, we have that $\sigma (\ddot{x}(L-x)-\dot{x}^2)=-x(\sigma g+k)$. Am I correct for both the cases? Now how do I proceed forward? If I assume that $\sigma \dot{x}^2$ is small then we have that $x(\sigma g+k)\approx -\sigma \ddot{x}(L-x) \approx -\sigma \ddot{x} L $. This is the equation of a simple harmonic oscillator, hence $x=A\cos(\omega t)$ where $\omega^2=\frac{\sigma g +k}{\sigma L}$. Now how do I find $A(t)$ which is asked in the problem? I think it will change slowly but I have no idea how to explicitly calculate it. Any help is appreciated.