To illustrate the formation mechanisms for the Pacific decadal oscillation (PDO) and the North Pacific gyre oscillation (NPGO) as the dominant and less dominant climate patterns of the North Pacific, and correlations between their periods of oscillation and the length of the ocean in the East-West direction, this paper adopts a mid-latitude channel linear quasi-equilibrium ocean model with reduced gravity to seek the analytical solution of the ocean flow field response to zonal wind forcing, with a special focus on resonance. Main findings include that the response pattern of the bounded ocean resembles the PDO and NPGO modes during winter respectively; specifically, to the east of the west coast of the ocean, the former is characterized by a gyre in an oval shape and the latter by two gyres rotating in opposite directions in the north and the south, constituting a gyre couple; across the entire ocean, the former features basin-wide ocean general circulation, while the latter features basin-wide general circulation in the north and the south respectively, which rotate in opposite directions. The above situations can be forced by anomalous positions of mid-latitude westerlies to the north and the south respectively. The frequency (period) of ocean flow field response to zonal wind field forcing is identical to the frequency (period) of zonal wind forcing; the response is observed after zonal wind forcing while the flow field (stream function) of the response is proportional to the zonal wind in scale. When the frequency (period) of zonal wind forcing equals that of the natural frequency (period) of the ocean, resonance will happen, with the observation of the strongest ocean response; while when the two frequencies differ by wide margins, rather small response will be observed. Smaller frictions correlate with stronger resonance along with more resonance occurrences. The length of the bounded ocean in the East-West direction has an obvious effect on the natural frequency (period), namely, the frequency (period) of resonance, and plays a decisive role in determining such a frequency; the distance between two neighboring resonance periods increases as the length is reduced. Different non-linear air-sea interactions lead to the complexity of the oscillation frequencies of a random wind field, ranging from extremely low to extremely high frequencies; through the resonance, resonance period identical or similar to the natural frequency of the ocean can be identified, at which frequency the ocean flow response to wind fields is the strongest, thus determining the periods of the PDO and NPGO. The final conclusion is that such a non-linear interaction, the effect of wind field forcing on flow field, and resonance are three key factors leading to the PDO and NPGO; the analytical solution is in nature a time-varying resonant Rossby wave.