calculate the spring constant.