find the maximum compression of the spring.