The RF and mechanical coupled analyses are essential in superconducting cavity design in order to predict the deformation of the cavity walls and the frequency shift caused by the deformation. In this paper, the detuning caused by both bath helium pressure and Lorentz force is analysed and a tuning system has been investigated and designed to compensate the detuning by deforming the half-wave resonator along the beam axis. The simulations performed with ANSYS code show that the tuning system can adjust and compensate the frequency drift due to external vibrations and helium pressure fluctuation during operation.