The measurement of resilience with a scanning probe microscope