calculate hysteresis method 1 find the absolute value