Force constant calculations—I: Theory and procedure