Natural convection in an infinite horizontal layer subject to a periodic heating along the lower wall has been investigated. The heating maintains the same mean temperatures at both walls while producing sinusoidal temperature variations along one horizontal direction with its spatial distribution characterized by the wave number $\alpha$ and the amplitude expressed in terms of a Rayleigh number $Ra_p$. The primary response of the system has the form of a stationary convection which consists of rolls with axis orthogonal to the heating wave vector and structure determined by the particular values of $Ra_p$ and $\alpha$. It is shown that for sufficiently large $\alpha$ convection is limited to a thin layer adjacent to the lower wall with a uniform conduction zone emerging above it; the temperature in this zone becomes independent of the heating pattern and varies in the vertical direction only.

Linear stability of the above system has been considered and conditions leading to the emergence of a secondary convection have been identified. The secondary convection gives rise either to the longitudinal rolls, to the transverse rolls, or to the oblique rolls at the onset, depending on $\alpha$. The longitudinal rolls are parallel to the primary rolls and the transverse rolls are orthogonal to the primary rolls, and both of them result in striped patterns. The oblique rolls lead to the formation of convection cells with aspect ratio dictated by their inclination angle and formation of rectangular patterns.

Two mechanisms of instability have been identified. In the case of $\alpha=0(1)$, the parametric resonance dominates and leads to the pattern of instability that is locked-in with the pattern of the heating according to the relation $\delta_{cr} = \alpha/2$, where $\delta_{cr}$ denotes the component of the critical disturbance wave vector parallel to the heating wave vector. The second mechanism, Rayleigh-Bénard (RB) mechanism, dominates for large $\alpha$ where the instability is driven by the uniform mean vertical temperature gradient created by the primary convection with the critical disturbance wave vector $\delta_{cr} \rightarrow 1.56$ for $\alpha \rightarrow \infty$ and the fluid response becoming similar to that found in the case of a uniformly heated wall. Competition between these mechanisms gives rise to non-commensurable states in the case of longitudinal rolls and appearance of soliton lattices, to the formation of very distorted transverse rolls, and to the appearance of the wave vector component in the direction perpendicular to the forcing direction. A rapid stabilization is observed when the heating wave number is reduced below $\alpha \approx 2.2$ and no instability is found when $\alpha < 1.6$ in the range of $Ra_p$ considered. It is shown that $\alpha$ plays the role of an effective pattern control parameter and its judicious selection provides means for creation of a wide range of flow responses.

The relevant mean flow solution has been determined using discretization based on Fourier expansions in the streamwise direction and spectral collocation method for the transverse direction. The resulting system of nonlinear algebraic equations has been solved using linearization based on the use of convective terms from previous iteration. The linear stability problem has lead to an eigenvalue problem for system of ordinary differential equations. These equations have been discretized using spectral collocation method. The eigenvalues have been determined either by computing spectra of very large matrices, or by tracing eigenvalues using inverse iteration method, or by tracing eigenvalues using Newton-Raphson procedure.