{'fraction_non_alphanumeric': 0.035825854565810146, 'fraction_numerical': 0.01273045739359685, 'mean_word_length': 4.385064177362894, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Instabilities induced by a weak breaking of a strong spatial resonance

Through multiple-scales and symmetry arguments we derive a model set of amplitude equations describing the interaction of two steady-state pattern-forming instabilities, in the case that the wavelengths of the instabilities are nearly in the ratio 1:2. In the case of exact 1:2 resonance the amplitude equations are ODEs; here they are PDEs. We discuss the stability of spatially-periodic solutions to long-wavelength disturbances. By including these modulational effects we are able to explore the relevance of the exact 1:2 results to spatially-extended physical systems for parameter values near to this codimension-two bifurcation point. These new instabilities can be described in terms of reduced `normal form' PDEs near various secondary codimension-two points. The robust heteroclinic cycle in the ODEs is destabilised by long-wavelength perturbations and a stable periodic orbit is generated that lies close to the cycle. An analytic expression giving the approximate period of this orbit is derived.


Introduction
Pattern-forming instabilities occur in many physical problems, for example Rayleigh-Bénard convection, Faraday wave experiments and directional solidification [8]. In some of these situations well-established governing equations are available which are sufficiently simple to analyse. In others the situation is not so clear cut, and reductions to model equations are of great value. The derivation of model equations to describe instabilities in these physical problems often provides a clear and unified viewpoint, bringing out similarities in the underlying mathematical structure.
In one spatially-extended dimension, the study of the stability of spatiallyperiodic patterns that arise from a steady-state bifurcation with continuous translational symmetry often reduces to the investigation of an evolution equation, for example the Ginzburg-Landau equation. Such equations, derived by asymptotic methods rather than rigorous analysis (though see recent work by Melbourne [17]) can both comprehend uniform spatially-periodic patterns and describe their stability to long-wavelength disturbances.
In the present paper we consider the case when two distinct instability mechanisms are present, for example in two-layer thermal convection [23]. Here the two instabilities will typically have different preferred horizontal lengthscales given by the critical wavenumbers corresponding to local minima in the curves of marginal stability. Each instability separately can be described by a 'universal' model equation such as the Ginzburg-Landau equation. However, the two instability mechanisms interact nonlinearly if the instabilities occur for similar values of the control parameters; this is a codimension-2 bifurcation. In such a situation more complicated model equations are needed to describe the dynamics in the region of parameter space near the codimension-2 point. The form of these model equations will depend on the symmetry of the problem, the steady or oscillatory nature of the instabilities, and on the ratio of the critical wavenumbers.
When the critical wavenumber ratio is rational (say p/q where p and q are coprime integers) we may restrict attention to solutions which are periodic in the horizontal direction and derive, in a mathematically rigorous fashion using a centre manifold reduction, ODEs describing the dynamics on the centre manifold at the point of instability. The cases p = 1, q = 1, 2, 3 have been termed 'strong' spatial resonances since the nonlinear interaction terms generated appear at third order, or below, in the resulting amplitude equations.
When the ratio is irrational this centre-manifold approach cannot be applied. Any restriction to spatially-periodic solutions will not be able to capture important features of the dynamics. In consequence the periodic solutions found may be unstable to long-wavelength instabilities, and their subsequent evolution must be described by PDEs rather than ODEs. In this case, there is currently no rigorous mathematical formulation which leads to PDEs. At best the equations used represent asymptotic approximations to the true situation. Nonetheless we shall adopt the PDE approach here, following the work of (among others) Coullet & Repaux [5], since it is natural and has proved very productive in similar, though simpler, problems.
In this paper we discuss the interaction of two steady-state instabilities with wavenumbers close to, but not exactly in, the ratio 1 : 2, using multiplescales expansions in time and space. The case of exact 1 : 2 resonance was treated first by Dangelmayr [9] and later by Jones & Proctor [13] and by Proctor & Jones [23] (hereafter referred to as Part 1) in the context of twolayer thermal convection. Important results were also obtained by Armbruster et al. [1] and Julien [12], and more recently by Porter & Knobloch [20]. In particular, [12] resolved several contradictions and errors in the earlier papers mentioned above, and investigated the dynamics of the ODEs away from the codimension-2 point; a full description of the dynamics of the ODEs becomes very involved. Here we extend this work and show that small deviations from the exact 1 : 2 situation result in additional long-wavelength instabilities of otherwise stable spatially periodic patterns ('spatial quasiperiodicity').
The most unusual part of the dynamics of the 1 : 2 resonance problem is the occurrence of a structurally stable heteroclinic cycle. The local information that we are able compute near the equilibria on the cycle enables analysis of the stability of the cycle to long-wavelength spatial disturbances.
The equations that we derive to capture these modulational instabilities are nonlinear PDEs, and as such, a full analysis is a daunting task. Indeed, even a complete classification of possible solutions is far beyond the scope of this paper. This paper considers those parts of the problem that can be treated analytically rather than presenting a superabundance of numerical results. Our analysis explores the stability of spatially-periodic equilibria and travelling waves, identifying those new instabilities that are due to the inclusion of modulational effects. The dynamics near these new instabilities can be described by 'normal form' equations (simpler PDEs whose structure is often prescribed by symmetry requirements). Although the algebraic expressions may become lengthy, it is possible to reduce the original nonlinear PDEs to these 'normal forms' explicitly via adiabatic elimination. Such a reduction, although not completely rigorously justified, can be extremely useful, particularly near secondary codimension-2 points (intersections of lines of codimension-1 bifurcations away from the initial bifurcation point). The paper illustrates this idea with two explicit detailed examples (the points L and X in figure 1); in neither case is the 'normal form' equation the Ginzburg-Landau equation. The dynamics near L have been well-studied in the literature, but those near X are more novel.
The original study of Part 1 was motivated by a particular two-layer thermal convection problem, and we refer the interested reader to that paper for detailed discussion of the physical background. Wavenumber interactions in the ratio 1 : 2 also occur in two-dimensional thermal convection in a single layer, for example in the asymptotic long-wavelength equation discussed by Cox [7], and in non-Boussinesq convection as discussed by Mercader, Prat & Knobloch [18,21]. These papers discuss situations that have one instability mechanism; by looking for solutions that are spatially-periodic with a given wavenumber k they locate codimension-two points (R c , k c ) where two periodic patterns interact, with wavenumbers in the ratio 1 : 2. Since, in these problems, R c is always greater than the minimum value required to drive convection in a formally infinite layer, the results are not directly applicable to the infinite layer case. In contrast, this paper (formally) attempts to analyse the infinite-layer situation in the case where there are two distinct instability mechanisms occurring for very similar values of the control parameters. The large horizontal extent of the layer enables periodic patterns to be destabilised by 'sideband' instabilities, for example the Eckhaus instability. We remark that a similar study, for 'weak' resonances, has been performed recently by Higuera, Riecke & Silber [11]. Their results, although very different in detail, have points of similarity to those presented here, for example the existence of solutions in the form of localised structures.
The paper is organised as follows. In section 2 we derive the model equations and make general remarks about the dynamics. In section 3 we briefly summarise the dynamics of the model ODEs in the absence of the modulational terms. Here and throughout the rest of the paper we use a single combination of coefficients that were used in Part 1, for ease of comparison. Sections 4 and 5 discuss in detail the new instabilities of spatially-periodic states that occur when the modulational terms are added to the model. In section 6 we discuss the stability of the robust heteroclinic cycle. Analytic work shows the existence of a long-period periodic orbit lying close to the cycle, in quantitative agreement with numerical results. Section 7 briefly highlights the coexistence, over a substantial region of the parameter plane, of stable non-modulated travelling waves and complex spatiotemporal behaviour. We conclude in section 8.

Model equations near 1 : resonance
Consider a horizontal two-dimensional layer, or layers, of fluid in the domain (−∞, ∞) × [0, 1], using co-ordinates (x, z), i.e. of finite vertical extent but extending to infinity in the horizontal direction x. We suppose that there is an x-independent state which may become linearly unstable to either of two competing steady-state instabilities, with wavenumbers nearly in the ratio 1 : 2. By way of illustration, the analysis of Part 1 was concerned with a two-layer thermal convection problem where these two instabilities corresponded to the onset of convection predominantly in either the upper or the lower layer separately. The most interesting dynamics can be captured by the distinguished limit in which the deviation of the ratio of the critical wavenumbers from the exact value 1 2 is of the order of the square root of the deviation of the bifurcation parameter (in this case the Rayleigh number R) from its critical value R c . If we set R − R c = ε 2 then we may write the critical wavenumbers (those associated with local minima in the value of the critical Rayleigh number) as k + εq and 2k. A suitable ansatz for small-amplitude solutions near the codimension-2 point where the conditions for instability coincide is then where lengths have been rescaled so that k = 1; X = εx and T = ε 2 t are long length and time scales, c.c. denotes complex conjugate, and the functions f 1,2 (z) give the vertical structure of the eigenfunction corresponding to each mode of instability. The amplitudes A(X, T ), B(X, T ) are complex-valued. The initial homogeneous state is symmetric under the Euclidean group E(1) generated by the reflection m x : x → −x and the translations τ δ : x → x + δ. These symmetries induce the following transformations on the amplitudes A and B: The combinationĀ 2 Be 2iqX is found to be the lowest-order translation-invariant combination that is not a product of the usual terms |A| 2 and |B| 2 .
The resulting amplitude equations (ignoring terms of order higher than three in A, B and ∂ X ) take the forṁ where the coefficients a j , b j and c are forced to be real by the reflection symmetry (2), the dots denote derivatives with respect to the slow time scale T and µ 1 , µ 2 are bifurcation parameters. We remark that (4) -(5) contain both quadratic and cubic terms in the amplitudes A and B. To ensure a rational scheme of approximation in the limit ε → 0 we should arrange that a 3 , b 3 scale as ε. This can be achieved in several ways, for example where a further symmetry which would leave the equations invariant under the sign change (A, B) → (−A, −B) is weakly broken.
The form of equations (4) - (5) shows that when |q| becomes large the spatiallyaveraged contribution from the quadratic terms decreases to zero. In this limit we formally recover the usual 'Landau' equations describing two coupled modes of instability in the absence of spatial resonance. This is in agreement with our ansatz (1); the system is far from the 1 : 2 mode interaction point when |q| ∼ O(1/ε).
Subsequent calculations are made considerably easier if we make the change of variableÂ = Ae −iqX to remove the exponential factors, and rescale the variables A, B, T and X to set a 3 = a 4 = 1 and b 3 = ±1. Dropping the carat onÂ we obtaiṅ which is the form of the equations that we will use in what follows. These equations have the same structure as the ODEs derived in Part 1 with the addition of terms giving modulation on the long lengthscale X. The term 2iqA X captures the effect of the departure from exact 1 : 2 resonance.
Writing A = R(X, T )e iθ(X,T ) and B = S(X, T )e iφ(X,T ) , the evolution equations (6) - (7) becomė where χ ≡ φ − 2θ. When the modulational terms are omitted, we can express the dynamics in terms of only the two moduli and the one phase difference χ (i.e. a reduction to a third-order system), as was done in Part 1. This leads to the ODEṡ However, in the presence of modulational terms, each of the individual phase variables θ and φ is dynamically independent. Vyshkind & Rabinovich [24] introduced the new variables u = S cos χ , v = S sin χ (also used by Porter & Knobloch [20]) to produce a third-order system avoiding the co-ordinate singularity, but this change of variables offers no simplification in the PDE problem.
The choice of the sign of the ±A 2 term in (7) has a huge effect on the dynamics. It was shown in Part 1 that in the '+' case for the non-modulated problem the dynamics are much less interesting than those may occur in the '−' case. Indeed in the '+' case there is a Lyapounov functional V (R, θ, S, φ) for the dynamics when 2b 1 = b 2 : where · · · denotes a horizontal average. Then a direct calculation shows thaṫ i.e. the system evolves monotonically towards a steady state. More complicated dynamics, for example temporal oscillations, are not possible. It follows that, at least when 2b 1 and b 2 are not widely different, or the amplitudes are small (equivalently, near to the codimension-2 point), we expect solution trajectories to tend asymptotically to equilibria after long times.
For the remainder of the paper we consider the '−' case, choosing the minus sign in (7). In this case it is not possible to construct a Lyapounov functional, and even in the absence of modulational terms the related ODE problem (12) - (14) can indeed display oscillatory dynamics; moreover there is a region of parameter space where a robust heteroclinic cycle exists and is stable. This cycle was analysed in Part 1 and by Armbruster et al. [1]. The parameter c in (7) corresponds to differential diffusion rates of the two amplitudes. Varying c away from unity leads to Turing instabilities, well-known in the context of reaction-diffusion equations. We remove this complicating consideration by setting c = 1 in nearly all of what follows. The occurrence of Turing instabilities in mode interactions is common to all cases of strong spatial resonance and is of a different type to the instabilities we discuss here, since it occurs in the spatially-extended but exactly-resonance case. A full discussion of this second class of instabilities is given in a companion paper ( [22], in preparation).
3 Non-modulational dynamics near µ 1 = µ 2 = 0 In this section we summarise the relevant parts of the bifurcation sequences observed in Part 1 near µ 1 = µ 2 = 0 in the analysis of the ODEs (12) - (14), setting q = 0. As remarked on earlier, even in the absence of the modulational terms, a full analysis of (6) -(7) is extremely complicated.
The trivial equilibrium A = B = 0 is stable in the quadrant µ 1 < 0, µ 2 < 0. Near the codimension-2 point at µ 1 = µ 2 = 0, the ODEs (12) -(14) support simple non-trivial equilibrium solutions of three types. The first type is a pure mode solution P , of the form A = 0, |B| 2 = µ 2 /a 2 . The continuous symmetry of the problem implies the existence of a group orbit of equilibria; that is, the phase of B is arbitrary due to the underlying translational symmetry. Within the subspace Fix(m x ) where A, B ∈ R there are two equilibria, denoted P ± . The pure mode solutions bifurcate from the trivial solution and exist when µ 2 > 0. They are stable for µ 1 sufficiently negative. The other equilibria are mixed mode equilibria of two kinds, M ± , corresponding to χ taking the values χ = 0 and χ = π, respectively. The M ± amplitudes R = R 0 and S = S 0 are given by solutions of the equations where the sign choices select either M + or M − . In fact there is a group orbit of each of M + and M − equilibria also, since although χ is fixed at 0 or π respectively, there is a free choice of one of the underlying phases θ or φ. When µ 1 is increased, holding µ 2 > 0 fixed, stable M + equilibria are created in a bifurcation at which the pure mode solutions lose stability.
The M + solution then loses stability (as µ 1 is increased further) either through a symmetry-breaking drift bifurcation which produces travelling waves (TW), or through a Hopf bifurcation to standing waves (SW). The TW solution resembles the mixed-mode M + in form, but it drifts along the group orbit of mixed-mode solutions as time evolves. The TW bifurcation is clearly a phase instability rather than an amplitude instability. Because the phase variables θ and φ evolve at constant rates such that χ is constant and sin χ = 0, the TW solutions appear as equilibria in the (R, S, χ ) variables. In other words, the use of the (R, S, χ ) variables identifies all points on the group orbit of M + solutions as a single equilibrium, and, in these co-ordinates, information about drift around group orbits is lost.
In contrast, the SW bifurcation is an amplitude-driven instability and produces periodic orbits that lie within the subspace χ = 0. Typical curves along which M + undergoes bifurcations to TW or SW solutions are shown in figure 1. For a large region of parameter space these two curves intersect at a codimension-2 point, labelled A in figure 1. Because the eigenvectors corresponding to the TW and SW bifurcations are orthogonal the codimension-two bifurcation corresponding to simultaneous instability is a pitchfork-Hopf bifurcation (in the (R, S, χ ) co-ordinates).
As we increase µ 1 for small positive µ 2 , the SW instability occurs first. Within the subspace Fix(m x ) the periodic orbit created in the SW bifurcation grows until it collides simultaneously with the origin and the P + equilibrium. After this global bifurcation the periodic orbit disappears, but now the unstable  manifold of P + tends asymptotically to the pure mode solution P − . By symmetry, within the invariant subspace Fix(m x • τ π ) the unstable manifold of P − tends to P + , and a heteroclinic cycle is formed. The heteroclinic cycle is structurally stable due to the existence of invariant subspaces, within which each connecting trajectory lies. Hence it exists for an open set of values of the coefficients and bifurcation parameters. Moreover, this cycle is attracting for an open interval of values of µ 1 .
At larger µ 1 this cycle ceases to attract nearby trajectories as it undergoes a resonant bifurcation, resulting in a global loss of stability, and creating modulated waves (MW). MW are destroyed in a Hopf bifurcation from the TW which themselves cease to exist in a bifurcation with the M − states. Moreover, several other heteroclinic cycles are possible for other combinations of coefficients, and at larger positive µ 2 . These have been investigated in detail by Porter & Knobloch [20].

Modulational instability of the pure mode
Having summarised the behaviour of the system in the absence of spatial modulations, we now allow q to take non-zero values, and examine the possibility of new modes of instability due to the spatial frequency mismatch. We first note that the results of Part 1, summarised in the previous section, apply within the subspace of non-modulated (X-independent) solutions. To examine the stability of the pure mode solution P + , given by A = 0 and B = B 0 ≡ µ 2 /a 2 , we substitute the ansatz into (6) -(7) and linearise. The linearised dynamics for α 1,2 and β 1,2 decouple and P + is found to be stable to the perturbations β 1,2 for all wavenumbers m. The linearised system for the perturbations α 1,2 is This matrix has trace tr(ℓ 2 ) and determinant D(ℓ 2 ): No oscillatory bifurcation is possible since tr(ℓ 2 ) = 0 implies D(ℓ 2 ) < 0. A steady-state instability to perturbations with wavenumber ℓ occurs when D(ℓ 2 ) = D ′ (ℓ 2 ) = 0 since D ′′ (ℓ 2 ) = 2 > 0. These conditions show that the first instability of P + may be to perturbations either with ℓ = 0 or with ℓ non-zero. When µ 2 > a 2 (µ 1 + q 2 )/b 1 the first instability is to ℓ = 0 and occurs along the curve µ 1 = b 1 µ 2 /a 2 + q 2 − µ 2 /a 2 . When µ 2 < a 2 (µ 1 + q 2 )/b 1 the first instability is to finite ℓ = ℓ c > 0 and occurs along the line These two instability curves meet at the point (µ L 1 , µ L 2 ) = (4b 1 q 4 − q 2 , 4a 2 q 4 ), marked L on figure 1. The gradients of these curves are equal here, so the transition between instabilities is smooth. Along the line OL (from the origin to L) the most unstable wavenumber, ℓ c , is given by ℓ 2 c = µ 1 − b 1 µ 2 /a 2 + q 2 , i.e. 0 < ℓ c < q, and ℓ c increases monotonically as the origin is approached.
At any point on the interior of the line OL we can fully describe this bifurcation by the usual Ginzburg-Landau equation, since for the PDEs (6) -(7) this is an instability of a uniform state to a nonzero-wavelength perturbation, and the growth rate of a perturbation with a wavenumber far from ℓ c is negative and bounded away from zero. We have carried out a weakly nonlinear perturbation expansion near OL to investigate whether this bifurcation is subcritical or supercritical, details of which are given in Appendix 1. The resulting analytic expression is cumbersome, but it is possible to deduce that the bifurcation is always supercritical when a 1 > 0 is large enough. This calculation can be carried out analytically without assuming c = 1; if c is large compared to unity and a 1 is small it is possible for the bifurcation to be subcritical. For the illustrative set of coefficients used in figure 1 the bifurcation is supercritical along the whole of OL.
The dynamics in a neighbourhood of the codimension-2 point L cannot, though, be described by the Ginzburg-Landau equation, since the instability wavelength ℓ c tends to zero as L is approached. A codimension-2 point identical in structure to L occurs in the analysis by Coullet & Repaux [5] of a patternforming instability subjected to an external nearly-resonant periodic forcing. They term L a 'Lifschitz point'. Through asymptotic expansions near L it is possible to describe the dynamics in terms of a single 'normal form' equation which governs the evolution of a small perturbation A(ξ, τ ) ∈ R to the P + solution; ν 1 and ν 2 are new bifurcation parameters, defined so that the point L corresponds to ν 1 = ν 2 = 0, τ is a new scaled time variable and ξ is a new long spatial scale associated with the smallness of ℓ c . Equation (19) is known as the Extended Fisher-Kolmogorov equation and it's properties have been extensively investigated ( [3,19,2]). It is easily shown that there is a Lyapounov functional for the dynamics, and so there are only steady state solutions at long times. However, these states need not be periodic in space; and in fact the solutions can have very complex spatial structure when ν 1 > 0, corresponding to the region 5 Modulational instabilities of the mixed modes M + undergoes a plethora of different bifurcations. In this section we will discuss three new instabilities to long-wavelength disturbances that occur. We examine a codimension-two bifurcation where two of these curves meet. We also discuss other codimension-two points that occur where one of these longwavelength instabilities meets a bifurcation curve from the non-modulated problem. Our discussion is organised by the sequence in which these bifurcations appear in figure 1 as µ 1 increases.

Instability of M + near the Lifschitz point L
The first new instability of M + that we find is a steady-state bifurcation to spatially-modulated solutions, i.e. the most unstable wavenumber is non-zero. This occurs along the dashed curve LT emanating from the Lifschitz point L. This instability is part of the generic bifurcation structure near a Lifschitz point and hence the existence of this curve can be shown by analysis of the normal form (19). We have followed the bifurcation curve to larger values of µ 1 where it becomes asymptotic to the line µ 1 = q 2 as µ 2 → ∞. Near L, when a 1 is large we expect the bifurcation to be subcritical by comparison with the results of Coullet & Repaux [5]. This bifurcation curve meets a second such non-zero-ℓ instability curve (this one starting from the point S) at the point T on figure 1. At T there is a Hopf/steady-state mode interaction coupled to a phase mode which has zero growth rate at zero wavenumber; figure 2 shows the variation of the real parts of the eigenvalues λ(ℓ 2 ) at this point.
The dynamics near the codimension-two point T depend strongly on the ratio of the wavenumbers involved in the instabilities. This ratio varies considerably with q, as shown in figure 3. For the illustrative coefficient set used in figure 1, when q = 0.097 there is a codimension-three bifurcation as S collides with T.   As we approach this collision, the wavenumber of the oscillatory instability at T goes to zero and so the wavenumber ratio is formally infinite there.
The critical wavenumbers for the steady-state instability can be seen from figure 3(a) to be slightly greater than the mismatch parameter q, in contrast with the modulational instability of the pure mode solution P + discussed in section 4 where the maximum critical wavenumber of instability is exactly q.
It turns out that for M + the maximum instability wavenumber is 2q. This can be easily shown by examining M + near the line µ 1 = q 2 , µ 2 > 0. When µ 1 − q 2 is small and negative the amplitudes R 0 and S 0 for M + are, solving (20) - (21) to leading order: Then, substituting these expressions into the termÊ(ℓ 2 ) from the characteristic polynomial P (λ) we obtain The double root at ℓ 2 = µ 2 comes from the LW instability; it is the root at ℓ 2 = 4q 2 that comes from the continuation of the steady-state instability curve through T towards µ 1 − q 2 ≈ 0. From numerical investigations we conjecture that the wavenumber of the instability evolves monotonically along the curve, but there does not seem to be a straightforward way to verify this analytically.

Instability of M + to standing waves
The dash-dotted line TS in figure 1(b) marks the instability boundary of M + to the second new bifurcation involving spatial modulation; an oscillatory instability to temporal oscillations (standing waves) with non-zero spatial wavenumber. The dynamics near the point S is analogous (but time-periodic rather than steady) to that near the Lifschitz point L, and can thus be described by a similar extension of the complex Ginzburg-Landau equation: governing the evolution of a complex-valued perturbation A(ξ, τ ) to the M + solution. As before, ν 1 and ν 2 are new bifurcation parameters; the point S corresponds to ν 1 = ν 2 = 0, ω 0 is the non-zero frequency of the instability, α, β and γ are real parameters, τ is a new scaled time variable and ξ is a new long spatial scale. Clearly the dynamics of (23) are at least as complicated as those of (19). The wavenumber of this oscillatory instability increases as µ 2 decreases along the curve (from S to T).

The long wavelength phase instability of M +
The third new instability occurs, at larger µ 2 , along the curve LW in figure 1(a). This instability is a long-wavelength steady-state bifurcation; as q is increased from zero, the LW curve splits off from the TW curve along its entire length. Since, in the absence of modulational terms, M + are unstable first to SW below A and unstable first to TW above A, the LW instability (at least for this combination of coefficients) is the instability of M + that occurs first in an intermediate range of µ 2 , between the new codimension-two points X and Y. The LW and SW curves intersect at Y and the LW and TW curves intersect at X, see figure 1(a). Since the LW instability curve coalesces with the TW instability as q → 0 it is clear that the LW instability must also be a phase instability rather than an amplitude instability.
It is important to observe that the point A, where the TW and SW curves cross, is now 'shielded' by the LW curve. The dynamics near A were investigated in detail in this context by Julien [12], and in greater generality by Landsberg & Knobloch [15]. In the presence of modulations the dynamics near A are expected to be less relevant to the observed dynamics in a spatiallyextended physical system. However, it is worth noting that by varying the diffusivity ratio c away from unity it is possible to make the points X and A coincide; this would result in a codimension-three bifurcation involving the TW, LW and SW instabilities of M + .
Reduced descriptions of the dynamics near X and Y can be derived from the PDEs starting either from (6) - (7) or, more conveniently here, from the modulus/phase representation of the dynamics given by (8) - (11). In this subsection we will present the reduction near X in some detail, and comment only briefly on the dynamics near Y.
Near X we strive to eliminate the equations (8) and (10) for the evolution of the moduli R and S by adiabatic elimination to leave a pair of real equations for the phases θ and φ. It turns out to be more convenient to describe the dynamics in terms of χ ≡ φ − 2θ and θ, since the TW instability involves only the combination χ . From (14) it is clear that the TW instability occurs when where R 0 and S 0 satisfy (20) - (21). The LW instability occurs whenÊ(0) = 0 where ℓ 2Ê (ℓ 2 ) is the determinant of the linearisation matrix (22): Note that when c = 1 and q = 0 this condition reduces to the condition for the TW instability (24). When c = 1 the algebra simplifies substantially (and so we set c = 1 for the remainder of this section); solving (24) and (25) together yields the moduli R 0 = √ 2/a 2 , S 0 = 1/a 2 at the point X where the LW and TW instabilities coincide. Substitution into (20) - (21) gives the co-ordinates of the point X in the (µ 1 , µ 2 ) plane: The adiabatic elimination of R and S at the point X proceeds in the usual manner, but the scaling for χ differs from that which might be expected. Our choices of scalings are determined completely by the requirement to balance the linear terms in the reduced equations. This balance then introduces two specific nonlinear coupling terms at leading order. We write Substituting into (8) and (10) and dropping the tildes gives, at O(ε 2 ): Hence Substituting the scalings (26) -(29) into theθ equation (9), dropping the tildes and cancelling a factor of ε 3 yields From (30) we see that r 0X = 0 and so (32) simplifies to givė which is the first of our pair of reduced equations. It turns out that we need to compute the term r 1 to determine the leading order evolution of χ correctly. From (10) at O(ε 4 ) we find which, after substituting (30) and (31), becomes where const denotes terms independent of X, and the last term is equal to 2qS 0 χ X /(2b 1 S 0 − 1) at leading order, using (33).
The form of the equations (37) -(38) stems directly from the requirement of invariance under x-reflection (2), which sends ( χ , θ, ∂ X ) → (− χ , −θ, −∂ X ). We note that the TW bifurcation is one of the secondary instabilities of spatially periodic patterns classified on symmetry grounds by Coullet  [4]; their equations (8a,b) closely resemble (37) -(38), although theirs contain only one bifurcation parameter since they are concerned with classifying codimension-one instabilities. By including a second bifurcation parameter, κ 2 , we are able to capture the codimension-two transition between the TW and LW instabilities.

Eckhaus instability dynamics near the LW bifurcation
At the codimension-one LW bifurcation, instability to modes of arbitrarily long wavelength occurs; near this bifurcation we may adiabatically eliminate χ to derive a single real equation describing the dynamics. The relevant scalings are θ = εθ,X = εX, χ = ε 3χ ,T = ε 4 T, we introduce a bifurcation parameter ν by writing ε 2 ν = 1 − ξ 1 /(a 2 ξ 0 ). On substituting these scalings into (36) we obtain and we substitute this expression for χ into theθ equation (33) to obtaiṅ to leading order. Equation (39) is identical in form to that which describes the weakly nonlinear behaviour of the Eckhaus instability. Like the Eckhaus instability, the LW bifurcation is therefore always subcritical.

Instability of travelling waves near the TW bifurcation
In a similar way, the dynamics of travelling waves, near the TW bifurcation, near X, can be investigated. At the TW bifurcation, θ can be eliminated (again, adiabatically) from (37) -(38) and the resulting single real Ginzburg-Landau equation for χ describes the bifurcation leading to TW solutions. The scalings leading to (33) and (36) cannot be chosen to include a term χ 3 in (36) which would be required to capture stable finite-amplitude TW states near the bifurcation point. In the absence of modulations a different set of scalings can be chosen which are able to include this term. In this way the sub-or supercriticality of the TW bifurcation can be easily computed.
However, it transpires that spatially-periodic TW are unstable to modulational disturbances and this instability is indeed captured by the reduced equations near X. To illustrate this, we compute the stability of the X-independent state χ = χ 0 constant, θ = χ 0 T /a 2 for (33) and (36). Let then, on substituting into (33) and (36) and linearising we obtaiṅ Eliminating α yields a single linear, constant coefficient ODE for β: Solving the homogeneous equation for the complementary functions β = e λ ± T we find Expanding this expression for λ + up to O(ℓ 2 ) we obtain For sufficiently small ξ 0 , the growth rate λ + is more positive than the growth rate ξ 0 of the state χ = χ 0 , θ = χ 0 T /a 2 towards a fully-nonlinear TW equilibrium, hence stable TW are not anticipated to appear close to the codimensiontwo point X.
Near X, numerical results (see figures 5 and 6) show M + solutions losing stability first to a TW perturbation which generates a TW-like 'transient', and then the occurrence of an instability to spatial modulations. The final state is, however, steady, and consists of an extremely long-wavelength, but O(1) in amplitude, modulation -see figure 6. Throughout most of the domain θ and φ increase linearly with X, while χ remains close to zero.
From the form of the equations (8) - (11) it is clear that families of solutions with θ X and φ X constant and non-zero are possible, corresponding to exactly spatially-periodic states with wavenumber close to unity. Some analytic investigation of these solutions should be possible. It may well be possible also to look analytically at other classes of solution, for example homoclinic orbits corresponding to spatially localised structures in infinite domains, or solutions where R and S are spatially periodic, but the possibilities are too numerous to discuss further here.

Dynamics near the codimension-two point Y
Below the point A on figure 1 the LW and SW curves intersect at yet another codimension-two point, labelled Y on figure 1(a). A similar analysis to that near X could be carried out here, leading to a pair of equations for the SW instability (which leads to time-periodic variations in solution amplitude), and the LW (phase) instability. Although we have not computed the reduced 'normal form' in this case, its structure is simple to derive and we include it for completeness. The relevant reduced equations describing the dynamics of this bifurcation are coupled ODEs for two variables (z, θ) where z ∈ C gives the perturbation in the direction of the SW instability and θ ∈ R describes the    LW instability. On symmetry grounds, the equations will be invariant under the transformation (z, θ, ∂ X ) → (z, −θ, −∂ X ). We also make use of the normal form symmetry z → e iψ z which appears naturally in Hopf bifurcation problems, and we use the fact that only spatial derivatives of θ will appear because the value of θ itself is dynamically unimportant. Under these constraints the reduced equations (including terms up to cubic order in (z, θ, ∂ X )) take the formż where ξ 0 , ξ 1 , ξ 2 ∈ C and ξ 3 , ξ 4 , ξ 5 ∈ R are undetermined coefficients, ω > 0 is the frequency of oscillation at the Hopf bifurcation, and λ 1 , λ 2 are real bifurcation parameters. Due to the large number of undetermined coefficients, space does not permit a detailed investigation of this bifurcation here. However, since the symmetry does not permit a linear term in z in theθ equation it is clear that the dynamics of (40) -(41) are not related to those of (33) and (36). The codimension-one bifurcation that occurs for λ 1 = 0 and λ 2 < 0 was one of the 'normal forms' identified by Coullet & Iooss [4] and has been explored numerically by Lega [16] and Daviaud et al. [10]. In particular, these authors identify two distinct regimes of spatio-temporal chaos depending on the choices of the coupling coefficients in (40) -(41).

Instability of M − to long-wavelength perturbations
Finally in this section, we briefly discuss the dynamics in the quadrant µ 1 > 0, µ 2 < 0. The spatially-periodic equilibrium state M − exists in the whole of this region and is stable when µ 2 is sufficiently negative, for a fixed µ 1 > 0. The amplitudes R = R 0 and S = S 0 satisfy and χ = π. For q = 0, M − states lose stability to TW solutions as µ 2 is increased at fixed positive µ 1 . These TW states have χ ≈ π near the bifurcation since χ = π for M − . As for M + this phase instability also generates a distinct long-wavelength instability when q = 0.
Following the usual linearisation of (8) -(11) about M − we find that a longwavelength instability occurs when Since the bifurcation to TW occurs when R 2 0 = 2S 2 0 as before, it is clear that in the case c = 1 these bifurcation curves do not intersect and no further codimension-two bifurcation points appear. In the limit where we keep µ 1 ∼ O(1) fixed and let µ 2 → −∞ we see from (42) -(43) that S 0 → 0 and R 0 ∼ O(1). Then (44) is satisfied when a 1 R 2 0 ≈ 2q 2 to leading order. From (42) this gives the asymptotic behaviour of the curve of LW instability: µ 1 ∼ 3q 2 , illustrated in figure 7.
In summary, in this section we have identified various codimension-one and two bifurcations involving modulational instabilities. In particular, two codimension-2 points, X and Y, organise the interaction of the new LW instability with the previously-studied TW and SW bifurcations. Reductions of the original PDEs (6) -(7) to 'normal form' equations describing the dynamics near these bifurcations enables us to gain insight into the nature of these bifurcations, despite the fact that solutions, even of the reduced equations, may have extremely complicated spatial structure.

The heteroclinic cycle
One of the most interesting features of the ODE problem (12) - (14) analysed in Part 1 is the existence of a robust heteroclinic cycle between pure mode solutions related by a half-wavelength spatial translation; for example P + and P − . For the coefficient values selected in this paper this heteroclinic cycle exists for an open region of the (µ 1 , µ 2 ) plane, abutting the origin. Its formation relies on the existence of pairs of two-dimensional invariant subspaces for the dynamics: for example within the two-dimensional subspace Fix(m x ) = {Im(A) = Im(B) = 0} the point P + is a saddle and P − is a sink and, if various other conditions are met, a connecting trajectory between them exists. The second connection is then forced to exist by symmetry, and is contained within the subspace Fix(m x • τ π ) = {Re(A) = Im(B) = 0}.
For small positive µ 2 and increasing µ 1 the cycle is formed after a global bifurcation that involves the intersection of the unstable manifold of P + and the stable manifold of the origin; this bifurcation also creates or destroys the SW periodic orbit. At larger values of µ 2 the connecting trajectory appears after a saddle-node bifurcation marking the boundary of existence of a further two M + equilibria. Hence this curve of saddle-node bifurcations also bounds the region of existence of the cycle. At larger µ 1 the cycle ceases to exist where the pure mode equilibria P ± gain stability in a pitchfork bifurcation with M − equilibria. These bifurcations proscribe the region of existence of the cycle. Within this region of existence, a further curve separates regions where it is stable or unstable. At this stability boundary a branch of modulated waves (MW) bifurcate from the cycle in a global ('resonant') bifurcation. Theoretical work by Armbruster et al. [1] and by Proctor & Jones [23] was confirmed by the general stability results of Krupa & Melbourne [14, section 6.1]. It turns out that the natural condition (that the ratio of eigenvalues in the 'contracting' and 'expanding' directions should be greater than one for stability) is necessary and sufficient. This yields the condition µ 1 < b 1 µ 2 /a 2 for the stability boundary of the cycle.
When modulational terms are included, the instability of P + to P − that is necessary for existence of the cycle implies that P + will also be unstable to sufficiently long-wavelength perturbations, so it might be expected that the cycle also could not be stable to long-wavelength perturbations. Moreover, the subspaces {Im(A) = Im(B) = 0} and {Re(A) = Im(B) = 0} are no longer invariant for the dynamics; spatial variations of the amplitude A drive the evolution of the phase θ when q = 0, see equation (9). Of course, the cycle still exists, within the subspace of solutions with no spatial modulation at all. But, in large domains it cannot be asymptotically stable (that is, points in a full neighbourhood -in some appropriate sense -of the cycle converge to it) as the equilibria P ± will be unstable to perturbations of a sufficiently long wavelength, as well as to each other within the subspaces containing the heteroclinic connecting orbits.
Numerical simulations show that spatially-modulated perturbations eventually grow, when q = 0, and the simulation converges to a periodic orbit rather than showing the characteristic increases of time spent near each equilibrium that would indicate convergence to the robust heteroclinic cycle.
In this section we analyse the behaviour of trajectories close to the cycle using a linearised stability analysis near the equilibria P ± and under the commonlyused assumption that trajectories near the cycle spend very little time passing between neighbourhoods of the equilibria. Our aim is to determine conditions for existence of periodic orbits lying close to the cycle. We restrict our attention to periodic orbits that spend equal amounts of time near each equilibrium since this feature is observed in numerical work.
Recall from section 4 that the linear stability of P + to perturbations ∼ α 1 e iℓX + α 2 e −iℓX in A(X, T ) with wavenumber ℓ is given by the matrix (18) acting on the amplitudes (α 1 , α 2 ). For simplicity we write this matrix as Note that a necessary condition for the existence of the cycle is that the eigenvalues λ ± of M 1 , when evaluated when ℓ = 0, satisfy λ − < 0 < λ + , so that P + is a saddle point. The form of M 1 implies that this is equivalent to requiring a 0 < 0 when ℓ = 0, and hence in the rest of this section we assume a 0 < 0. The corresponding linearisation around P − is denoted M 2 : The form of M 2 is determined entirely from M 1 and the equivariance of the ODEs (6) - (7).
We assume that trajectories close to the heteroclinic cycle spend equal amounts of time T near each equilibrium, and that we may ignore the time spent travelling between neighbourhoods of the equilibria. Hence a perturbation v 0 = (α 1 , α 2 ) T near P + evolves to the point where the matrix S is given by and c 0 = q 2 + b 2 0 and e ± = exp[(a 0 ± c 0 )T ]. The eigenvalues of S then determine the stability of the cycle. We are particularly interested in the dependence of these eigenvalues on the travel time T , the selected wavelength ℓ and the wavenumber mismatch parameter q.
When q = 0, S simplifies enormously: it is diagonal with eigenvalues e + e − = exp(2a 0 T ) where a 0 is defined in (45). Since a 0 < 0 we have contraction of the perturbation vector v 0 under successive iterates of S. This corresponds to trajectories passing repeatedly through neighbourhoods of P ± , and converging to the cycle. This result is independent of the time T spent near each equilibrium.
For general q = 0 the eigenvalues of S will, however, depend on T . Moreover, for any q = 0, S will have eigenvalues of modulus greater than unity when T is taken to be sufficiently large (so that e + is sufficiently large). So, in addition to the discussion above, we can conclude directly from the form of the map that for any non-zero q the cycle is unstable.
Numerical simulations indicate that trajectories remain close to the cycle, though, so it is natural to ask whether stable dynamics close to the cycle is possible. One possibility is the existence of a long-period periodic orbit. That such an orbit might exist is motivated by the observation that S has an eigenvalue greater than unity for T ≫ 1, i.e. trajectories very close to the cycle are pushed further away from it, but that for T ∼ 1 the eigenvalues of S may lie within the unit circle, indicating that trajectories that start further away from the cycle move closer on successive passes near the cycle. This behaviour is confirmed by numerical simulations (see figure 8), where we choose an initial condition lying extremely close to the subspace of nonmodulated solutions, but not close to the heteroclinic cycle. Thus the first few travel times T between neighbourhoods of P ± occur with T small, and the perturbation decays. Then, as the trajectory becomes closer to the cycle T increases and the perturbation grows (exponentially on average) until the trajectory converges to the periodic orbit.
The above argument is unusual in that it suggests that we can extract nonlinear information (about the period of the orbit) from a purely linear calculation (that which leads to the form of S). This is because we are essentially using T as a proxy for the closest distance between the periodic orbit and the heteroclinic cycle. Hence solving for the position of the orbit and solving for T are really the same thing. By setting up the usual 'small box' approach we could construct a return map, fixed points of which would correspond to periodic orbits. By using T instead, we are able to circumvent the need to compute this return map in full in order to extract an estimate for the period. Essentially we construct the component of the return map in a pair of directions orthogonal to the invariant plane corresponding to unmodulated solutions. Then the condition for locating a fixed point of this part of the map is identical to the condition that S has an eigenvalue of +1.
At least for small q and large times T we expect that the behaviour outlined above could be captured by the map S based on linearisation near P ± . We compute the approximate period P (q) ≈ 2T (q) of a stable periodic orbit by imposing the condition that the larger eigenvalue m + of S is +1 (the other (m − ) lies inside the unit circle). Finally we consider only the minimum wavenumber ℓ min = 2π/L since this is the mode with the highest growth rate for the points in the (µ 1 , µ 2 ) plane that we consider. Hence the eigenvalue condition yields a relationship (implicitly) between T and q which can be compared with numerical simulations. This relationship simplifies in the asymptotic regime where q is small and T is large.
It might appear that the dominant term for large T is the first term in the expression for Y 2 , proportional toq 2 e 6c 0 T , but this is incorrect. In fact, the dominant terms in the limit of smallq and large T are those proportional tô q 2 e 4c 0 T . This leads to the asymptotic relationship as q → 0. For two combinations of L and µ 2 , figure 9 compares this asymptotic relationship with the exact implicit T -q relationship implied by (48) setting m + = 1, and with the results of numerical integrations of the PDEs (6) - (7). In both cases there is clear agreement as long as q is sufficiently small. At small q the numerical simulations become more difficult, due to the intermittent nature of the dynamics. Given the several approximations involved in the analytic estimate of T (q) the results of figure 9 are enouraging. The major discrepancy in the analysis is the consideration of only one wavenumber ℓ min = 2π/L in the estimate. Implicitly we assume that the 'most unstable' eigenfunction direction near P + is aligned exactly with the single Fourier mode e iℓ min X .
For larger q numerical simulations did not converge to a stable periodic orbit, but instead remained spatiotemporally disordered even after large integration times. Although solutions still often spend considerable amounts of time near the spatially-uniform P + state these events occur only intermittently. At much larger q, numerical integrations of the PDEs show that the cycle still plays a rôle in local organisation of the spatiotemporally complicated dynamics. The spatial structure of solutions often resembles a series of fronts between intervals of points which remain near either P + or P − for a time, and then switch rapidly to a neighbourhood of the other equilibrium. This is illustrated in figure 10, particularly around X = 90 and X = 140 (where the solution is close to P + ), and at X = 120 where the solution is close to P − . For the parameter values of the figure, the pure mode equilibria have amplitude |B| = 0.2. Nearby spatial locations are often still well-correlated in time, see figure 11.

Stable travelling waves and complex spatiotemporal dynamics
At large positive µ 1 and µ 2 the TW states are restabilised after a Hopf bifurcation involving a branch of modulated waves generated by the global bifurcation in which the heteroclinic cycle loses stability. Surprisingly, for the spatiallyextended system, these spatially-homogeneous TW states are also stable for large enough µ 1 and µ 2 , as shown in figures 12 and 13. The stable TW coexist with stable complicated spatiotemporal dynamics, illustrated in figures 14 and 15. The latter state might be expected to be a more generic solution in this region of the (µ 1 , µ 2 ) plane, although no systematic study of the relative sizes of the basins of attraction has been performed.

Discussion and conclusions
In this paper we have examined the robustness of the results of Part 1 on the dynamics near the 1 : 2 strong spatial resonance, to modulational instabilities which might be expected to play a role when the spatial resonance is close to, but not exactly, 1 : 2. We have derived a pair of coupled amplitude equations using symmetry arguments; these amplitude equations are PDEs rather than ODEs as is the case for exact resonance.
We have examined the stability of the spatially-periodic solutions found in Part 1, looking for instabilities to finite-wavelength and long-wavelength perturbations. In general, we find that the results of Part 1 still apply when µ 1 and µ 2 are large (equivalently when the mismatch q is small), but that new instabilities are present near the codimension-two point µ 1 = µ 2 = 0. Since these lead, in general, to variations with a horizontal wavenumber O(εq), solutions still resemble those of the non-modulated problem over short lengthscales. This paper is primarily concerned with identifying the several codimensiontwo points in the parameter space which link modulational instabilities and amplitude or phase instabilities which are present in the ODEs discussed in Part 1. We have presented reduced equations that describe the dynamics near these various points. The form of these reduced equations (which are still PDEs) may be deduced from symmetry arguments, and can also be derived through perturbation expansions. This analysis enables us to understand qualitative features of the dynamics; although analytic solutions are still extremely difficult to derive for the reduced equations, this process of deriving 'normal forms' contributes greatly to an understanding of the interaction of these various instabilities.
Our three main results are firstly, that the pure mode P and the mixed-mode M + may undergo steady-state instabilities to finite-wavelength modes with a maximum critical wavenumber ℓ c = q (for P ) and ℓ c = 2q (for M + ). This confirms our intuition; it is natural to think that there are only two important lengthscales in the problem -the O(1) lengthscale of the spatially-periodic patterns and long lengthscales > O(1/εq) introduced by the deviation from exact resonance. M + may also undergo an oscillatory bifurcation to a non-zero wavenumber mode, and numerical investigations suggest this wavenumber is also O(q). Secondly, the reduction of the governing PDEs to a 'normal form' and subsequent analysis of these reduced equations for the codimension-two phase instability at the point X is novel and is presented in detail. Thirdly, we have considered the fate of the structurally stable heteroclinic cycle present in the ODE problem. Although the equilibria on the cycle, and hence the cycle itself, must be unstable to long-wavelength perturbations, the dynamics for small q result in a stable periodic orbit that lies close to the cycle and whose period can be estimated well analytically. At larger q the heteroclinic cycle still organises the spatial dynamics over short distances, although solutions are spatiotemporally complex as might in general be expected.
There is, of course, much more work that could be done on this problem. Two obvious directions of interest are the fate of the more complicated heteroclinic cycles examined by Porter & Knobloch [20] to modulational perturbations, and the behaviour for asymptotically large q (within this scaling ansatz); we have concentrated on behaviour for q ≤ 1, where the results may be most easily interpreted with reference to previous work. expression forĉ 2 ; the complexity is derived from the third-order contributions from theḂ equation.