{'fraction_non_alphanumeric': 0.04913444594174355, 'fraction_numerical': 0.02156110707992122, 'mean_word_length': 4.138482023968042, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A theoretical basis for the Harmonic Balance Method

The Harmonic Balance method provides a heuristic approach for finding truncated Fourier series as an approximation to the periodic solutions of ordinary differential equations. Another natural way for obtaining these type of approximations consists in applying numerical methods. In this paper we recover the pioneering results of Stokes and Urabe that provide a theoretical basis for proving that near these truncated series, whatever is the way they have been obtained, there are actual periodic solutions of the equation. We will restrict our attention to one-dimensional non-autonomous ordinary differential equations and we apply the results obtained to a couple of concrete examples coming from planar autonomous systems.


Introduction and main results
Consider the real non-autonomous differential equation where the prime denotes the derivative with respect to t, X : Ω × [0, 2π] → R is a C 2 -function, 2π-periodic in t, and Ω ⊂ R is a given open interval.
There are several methods for finding approximations to the periodic solutions of (1). For instance, the Harmonic Balance method (HBM), recalled in subsection 2.1, or simply the numerical approximations of the solutions of the differential equations. In any case, from all the methods we can get a truncated Fourier series, namely a trigonometric polynomial, that "approximates" an actual periodic solution of the equation. The aim of this work is to recover some old results of Stokes and Urabe that allow to use these approximations to prove that near them there are actual periodic solutions and also provide explicit bounds, in the infinity norm, of the distance between both functions. To the best of our knowledge these results are rarely used in the papers dealing with HBM.
When the methods are applied to concrete examples one has to deal with the coefficients of the truncated Fourier series that are rational numbers (once some number of significative digits is fixed, see the examples of Section 4) that make more difficult the subsequent computations. At this point we introduce in this setting a classical tool, that as far as we know has never been used in this type of problems: we approximate all the coefficients of the truncated Fourier series by suitable convergents of their respective expansions in continuous fractions. This is done in such a way that using these new coefficients we obtain a new approximate solution that is essentially at the same distance to the actual solution that the starting approximation. With this method we obtain trigonometric polynomials with nice rational coefficients that approximate the periodic solutions.
Before stating our main result, and following [5,6], we introduce some concepts. Letx(t) be a 2π-periodic C 1 -function, we will say thatx(t) is noncritical with respect to (1) Notice that ifx(t) is a periodic solution of (1) then the concept of noncritical is equivalent to the one of being hyperbolic, see [3]. As we will see in Lemma 2.1, ifx(t) is noncritical w.r.t. equation (1), the linear periodic system has a unique periodic solution y b (t) for each smooth 2π-periodic function b(t).
Moreover, once X andx are fixed, there exists a constant M such that where as usual, for a continuous 2π-periodic function f , Any constant satisfying (3) will be called a deformation constant associated tox and X. Finally, consider We will say thatx(t) is an approximate solution of (1) with accuracy S = ||s|| 2 . For simplicity, ifS > S we also will say thatx(t) has accuracyS. Notice that actual periodic solutions of (1) have accuracy 0, in this sense, the function s(t) measures how far isx(t) of being an actual periodic solution of (1). Next theorem improves some of the results of Stokes [5] and Urabe [6] in the one-dimensional setting. More concretely, in those papers they prove the existence and uniqueness of the periodic orbit when 4M 2 KS < 1. We present a similar proof with the small improvement 2M 2 KS < 1. Moreover our result gives, under an additional condition, the hyperbolicity of the periodic orbit.
it is noncritical w.r.t. equation (1) and has M as a deformation constant, it has accuracy S w.r.t. equation (1).
and it is the unique periodic solution of the equation entirely contained in this strip. If in addition, then the periodic orbit x * (t) is hyperbolic and its stability is given by the sign of this integral.
Once some approximate solution is guessed, for applying Theorem 1.1 we need to compute the three constants appearing in its statement. In general, K and S can be easily obtained. Recall for instance that ||s|| 2 , when s is a trigonometric polynomial, can be computed from Parseval's Theorem. On the other hand M is much more difficult to be estimated. In Lemma 2.3 we give a result useful for computing it in concrete cases, that is different from the approach used in [5,6,7].
Assuming that a non-autonomous differential equation has an hyperbolic periodic orbit, the results of [6] also guarantee that, if take a suitable trigonometric polynomialr(t) of sufficiently high degree, we can apply the first part of Theorem 1.1. Intuitively, while the value of the accuracy S goes to zero when we increase the degree of the trigonometric polynomial, the values M and K remain bounded. Thus at some moment it holds that 2M 2 KS < 1.
In Section 4 we apply Theorem 1.1 to localize the limit cycles and prove its uniqueness, in a given region, and its hyperbolicity for two planar polynomial autonomous systems. The first one is considered in Subsection 4.1 and is a simple example for which the exact limit cycle is already known. We do our study step by step to illustrate how the method suggested by Theorem 1.1 works in a concrete example. In particular we obtain an approximationx(t) of the periodic orbit by using a combination between the HBM until order 10 and a suitable choice of the convergents obtained from the theory of continuous fractions applied to the approach obtained by the HBM.
The second case corresponds to the rigid cubic systeṁ , that in polar coordinates writes asṙ = r/10 − cos(θ)r 2 /10 − cos 2 (θ)r 3 ,θ = 1, or equivalently, which has a unique positive periodic orbit, see also [2]. Notice that we have renamed θ as t. We prove: Then, the differential equation (5) has a periodic solution r * (t), such that ||r − r * || ∞ ≤ 0.042, which is hyperbolic and stable and it is the only periodic solution of (5) contained in this strip.
As we will see, in this case we will find computational difficulties to obtain the order three approximation given by the HBM. So we will get it first approaching numerically the periodic solution; then computing, also numerically, the first terms of its Fourier series and finally using again the continuous fractions approach to simplify the values appearing in our computations. We also will see that the same approach works for other concrete rigid systems.
Similar examples for second order differential equations have also been studied in [7].

Preliminary results
This section contains some technical lemmas that are useful for proving Theorem 1.1 and for obtaining in concrete examples the constants appearing in its statement. We also include a very short overview of the HBM adapted to our interests. See [4] for a more general point of view on the HBM.
As usual, given A ⊂ R, 1 A : R → R denotes the characteristic function of A, that is, the function takes the value 1 when x ∈ A and the value 0 otherwise. Lemma 2.1. Let a(t) and b(t) be continuous real 2π-periodic functions. Consider the non-autonomous linear ordinary differential equation Moreover ||x b || ∞ ≤ 2π max t∈[0,2π] ||H(t, ·)|| 2 ||b|| 2 . Proof. Since (6) is linear, its general solution is If we impose that the solution is 2π-periodic, i.e., x(0) = x(2π), we get By replacing x 0 in (8) by the right hand side of (9) we obtain that Therefore the first assertion follows. On another hand, by the Cauchy-Schwarz inequality, This complete the proof.
where H is given in (7) with , t) dt. Now we prove a technical result that will allow us to compute in practice deformation constants. In fact we will find an upper bound of M that will avoid the integration step needed in the computation of the norm || · || 2 . First, we introduce some notation.
Given a function A : We will say that L is an adequate lower bound of A if it holds that L(t) < A(t) for all t ∈ [0, 2π]. It is clear that smooth functions have always adequate functions, that approach to them.
In next result we will use the following functions where Lemma 2.3. Let L be an adequate lower bound of A, where A is the function given in Lemma 2.1. Consider the functions Ψ m (t), m = 0, 1, . . . , N − 1, given in (10). Therefore, following also the notation introduced in that Lemma, it holds So we will find an upper bound of M. Since where Therefore, for t ∈ I m , As a consequence, for t ∈ [0, 2π], and the result follows.
Remark 2.4. Notice that the above lemma provides a way for computing a deformation constant where there is no need of computing integrals. This will be very useful in concrete application, where the primitive of e −2A(t) is not computable and so Corollary 2.2 is difficult to apply for obtaining M.
In next result, which introduces the constant K appearing in Theorem 1.1, D • denotes the topological interior of D.
Lemma 2.5. Consider X as in (1). Let D be a closed interval and letx(t) be a 2π-periodic for all z such that {x(t) + z : t ∈ R} ⊂ D. Then Proof. (i). By using the Taylor's formula, for each t it holds that as we wanted to prove.
Hence, the result follows combining the three inequalities.
2.1. The Harmonic Balance method. In this subsection we recall the HBM adapted to the setting of one-dimensional 2π-periodic non-autonomous differential equations.
We are interested in finding periodic solutions of the 2π-periodic differential equation (1), or equivalently, periodic functions which satisfy the following functional equation Recall that any smooth 2π-periodic function x(t) can be written as its Fourier series, The above set of equations is usually a very difficult non-linear system of equations and for this reason in many works, see for instance [4] and the references therein, only small values of N are considered. We also remark that in general the coefficients of y N (t) and y N+1 (t) do not coincide at all. Notice that equations (13) are equivalent to 2π 0 F (y N (t)) cos(mt) dt = 0 and The hope of the method is that the trigonometric polynomials found using this approach are "near" actual periodic solutions of the differential equation (1). In any case, as far as we know, the BHM for N small is only a heuristic method that sometimes works quite well.
To end this subsection, we want to comment a main difference between the nonautonomous case treated here and the autonomous one. In this second situation the periods of the searched periodic orbits, or equivalently their frequencies, are also treated as unknowns. Then the methods works similarly, see again [4].

Proof of the main result
Proof of Theorem 1.1. As a first step we prove the following result: consider the nonlinear differential equation where s(t) is given in (4). Then a 2π-periodic function z(t) is a solution of (14) if and only if z(t) +x(t) is a 2π-periodic solution of (1). This is a consequence of the following equalities =X(z(t) +x(t), t).
By using the function introduced in Lemma 2.5, equation (14) can be written as Let P be the space of 2π-periodic C 0 -functions. To prove the first part of the theorem it suffices to see that equation (15) has a unique C 1 , 2π-periodic solution z * (t), which belongs to the set N = {z ∈ P : ||z|| ∞ ≤ 2MS}. To prove this last assertion we will construct a contractive map T : N → N . Because N is a complete space with the || · || ∞ norm, its fixed point will be a continuous function in N that will satisfy an integral equation, equivalent to (15). Finally we will see that this fixed point is in fact a C 1 function and that it satisfies equation (15).
Let us define T . If z ∈ N then T (z) is defined as the unique 2π-periodic solution of the linear differential equation Notice that this map is well defined, by Lemma 2.1, becausex(t) is noncritical w.r.t. equation (1). Then z 1 satisfies Let us prove that T maps N into N and that it is a contraction. By Lemmas 2.1 and 2.5 and the hypotheses of the theorem where we have used in the last inequality that 2M 2 KS < 1.
To show that T is a contraction on N , take z,z ∈ N and denote by z 1 = T (z), z 1 = T (z). Then Again by Lemmas 2.1 and 2.5 and the hypotheses of the theorem, KS||z −z|| ∞ , as we wanted to prove, because recall that 2M 2 KS < 1.
Therefore the sequence of functions {z n (t)} defined as with any z 0 (t) ∈ N , and z n+1 (t) chosen to be periodic, converges uniformly to some function x * (t) ∈ N . In fact we also have that We know that x * (t) is a continuous function, but from the above expression we obtain that it is indeed of class C 1 . Therefore x * (t) is a periodic solution of (15) and is the only one in N , as we wanted to see.
To prove the hyperbolicity of x * (t) it suffices to show that and study its sign, see [3]. We have that, fixed t, for some ξ(t) ∈ x * (t),x(t) . Therefore, since we have already proved that |x and the results follows because by hypothesis the first integral is, in absolute value, bigger that 2π/M.

Applications
In this section we apply our result to prove the existence and localize a hyperbolic limit cycle of some planar systems, which after some transformations can be converted into differential equations of the form (1). In the first case, although we know explicitly the limit cycle, we first use the HBM to approximate it and then Theorem 1.1 to prove in an alternative way its existence. In the second case we consider a planar rigid system. First, we found numerically an approximation of the limit cycle and from this approximation we propose a truncated Fourier series as a simpler approximation. Finally, Theorem 1.1 is used again to prove the existence and localize the limit cycle.
Its solutions are r(t) ≡ 0 and Therefore its unique positive periodic solution, which corresponds to the only limit cycle of (16) for the given values of the parameters, is given by the ellipse Moreover since 2π 0 ∂ ∂r X(r * (t), t) dt = 4π > 0 it is hyperbolic and unstable, see [3]. Its Fourier series is where ≈ −0.0005148662408, being K = K( √ 6/3) and E = E( √ 6/3) the complete elliptic integrals of the first and second kind respectively, see [1].
Let us forget that we know the exact solution and its full Fourier series to illustrate how to use the HBM and Theorem 1.1 for equation (17) to obtain an approach to the actual periodic solution (18).
Following the HBM, see subsection 2.1, consider the equation which is clearly equivalent to (17).
Searching for a solution of the form r(t) = r 0 and imposing that the first harmonic of F (r(t)) vanishes we get that r 0 + 2r 3 0 = 0. The only positive solution of the equation is r 0 = √ 2/2 ≈ 0.7071 and this is the first order solution given by HBM.
Motivated by the symmetries of (17) for applying the second order HBM we search for an approximation of the form r(t) = r 0 + r 2 cos(2t).
Thereforer(t) andr(t) are solutions of (17) with similar accuracy so we keep r(t) as the second order approximation given by this modification of the HBM. For thisr(t) we already know that its accuracy is S = 0.14.
We need to know the value of M given in Theorem 1.1. With this aim we will apply Lemma 2.3. We consider in that lemma a function L(t) formed by 13 straight lines and ℓ = 1/9. Then we get that we can take M = 2.3. Therefore, since 2MS = 0. 644  . It is worth to comment that the above two functions are periodic functions that approximate to solution of (17) with accuracies 0.045 and 0.018, respectively, while the solutions obtained solving approximately the non-linear systems with ten significative digits have similar accuracies, namely 0.043 and 0.013, respectively. For none of both approaches Theorem 1.1 applies. Let us see that the next order HBM works for this example.
If we do all the computations we obtain the candidate to be solutioñ Computing the accuracy ofr(t) we obtain that it is 0.0039. If we take the approximation, using some convergents of r 2k ,  (21). Then there is a periodic solution r * (t) of (17), such that ||r − r * || ∞ ≤ 0.0192, which is hyperbolic and unstable and it is the only periodic solution of (17) in this strip.
Remark 4.2. Using the known analytic expression of r * (t) it can be seen that indeed ||r − r * || ∞ ≤ 0.0007. Notice that by using a high enough HBM we have obtained a proof of the existence of a hyperbolic periodic orbit and an effective approximationr(t) without integrating the differential equation.

4.2.
A rigid cubic system. In this section we study some concrete cases of the family of rigid cubic systemṡ already considered in [2]. In that paper it is proved that (22) has at most one limit cycle and when it exists is hyperbolic. With our point of view we will find an explicit approximation of the limit cycle, see Proposition 1.2. We consider the case a = −b = 1/10, that in polar coordinates writes as (5), and we start explaining how we have found the approximation of the periodic solution of (5) given in Proposition 1.2. First attempt: the HBM. First we try to apply this method to find an approximation of the periodic solution of (5) that allows to use Theorem 1.1.
Searching for a solution of the form r(t) = r 0 and imposing that the first harmonic of Hence r 0 = √ 5/5 ≈ 0.4472135954 is the first order solution given by the HBM. We obtain that the positive approximate solution is r = √ 5/5. For applying the second order HBM we search for an approximation of the form r(t) = r 0 + r 1 cos(t) + s 1 sin(t).
The vanishing of the coefficients of 1, cos(t) and sin(t) in F (r(t)) provides the non-linear system 9 4 r 2 0 r 1 − By using the same tools than in the previous example we obtain that one of the approximated solutions of the above system is r 0 ≈ 0.4471066159, r 1 ≈ −0.0009814101 and s 1 ≈ −0.0196567414. We search simple rational approximations of r 0 , r 1 and s 1 , doing again the respective continuous fraction expansions and we obtain the candidatẽ to be an approximate periodic solution of (5). It can be seen that it has accuracy S ≈ 0.046. Doing all the computations needed to apply Theorem 1.1 we obtain that we are not under its hypotheses. Therefore we need to continue with the HBM of second order. Doing the second order approach we obtain five algebraic polynomial equations, that we omit for the sake of simplicity. Unfortunately, neither using the resultant method as in the previous cases, nor using the more sophisticated tool of Gröbner basis, our computers are able to obtain an approximate solution to start our theoretical analysis. A numerical approach. First, we search a numerical solution of (5) by using the Taylor series method. From this approximation we compute, again numerically, its first Fourier terms, obtaining r(t) = with accuracy 0.00298, quite similar to the one ofr 1 (t). Note that (23) is precisely the approximation of the periodic solution of (5) stated in Proposition 1.2.