Nonlinear stability analysis of the zonal flows at middle and high latitudes