Analytical first and second energy derivatives in the polarization model