Implemented minmax_location function to find min/max of potential well