Referring to Figure 2, the collar A (mass = 20 kg),is released from rest and slides down the rough rod (μ = 0.4), impacting the spring (k = 1.6 kN/m) after travelling a distance L of 0.5m.

The rod is inclined at an angle θ = 60˚. Calculate, (i), the velocity of the collar at the moment

of impact with the spring, and, (ii), the maximum compression of the spring.

https://imgur.com/TorENhp - Link to figure 2

I did the first part and got the right velocity - 2.56 m/s but I am having troubles with the second part. I know that at the beginning there is only Epe (potential energy). Considering gravity acts vertically down then Epe = mgLsin60 , right? And that energy is going to be equal to the energy in the second compressed state = -mgxsin60 + 1/2 k(-x)^2

Are my assumptions correct? I am a bit confused whether the heights should be L and x respectively or Lsin60 and xsin60. What about Es? Would it be equal to 1/2 kx^2 or 1/2 k(xsin60)^2?

Cheers