{'fraction_non_alphanumeric': 0.036836123165943375, 'fraction_numerical': 0.01069435833849969, 'mean_word_length': 4.560758402757828, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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}}
Analytic exploration of safe basins in a benchmark problem of forced escape

The paper presents an analytical approach for predicting the safe basins (SB) in a plane of initial conditions (IC) for escape of classical particle from the potential well under harmonic forcing. The solution is based on the approximation of isolated resonance, which reduces the dynamics to conservative flow on a two-dimensional resonance manifold (RM). Such a reduction allows easy distinction between escaping and non-escaping ICs. As a benchmark potential, we choose a common parabolic-quartic well with truncation at varying energy levels. The method allows accurate predictions of the SB boundaries for relatively low forcing amplitudes. The derived SBs demonstrate an unexpected set of properties, including decomposition into two disjoint zones in the IC plane for a certain range of parameters. The latter peculiarity stems from two qualitatively different escape mechanisms on the RM. For higher forcing values, the accuracy of the analytic predictions decreases to some extent due to the inaccuracies of the basic isolated resonance approximation, but mainly due to the erosion of the SB boundaries caused by the secondary resonances. Nevertheless, even in this case the analytic approximation can serve as a viable initial guess for subsequent numeric estimation of the SB boundaries.

One of the first seminal works on escape was written by Kramers almost 80 years ago [17]. While focusing on thermal activation of chemical reactions, it created a multitude of novel research areas. A particularly interesting phenomenon is the escape triggered by a stochastic resonance [18]- [20].
In recent years a lot of attention was drawn to the dynamics of escape under the external harmonic forcing [21]- [26]. In [21] the escape from a squared hyperbolic secant potential was treated with the help of approximation of isolated 1:1 resonance Previous studies considered only special (primarily, zero) ICs, therefore, the question about the global dynamics remains open. This question can be formulated as follows: what is the set of all ICs corresponding to non-escape for a potential well? The aforementioned set of the ICs for the non-escaping trajectories is commonly referred to as a safe basin (SB) [27], [28]. In order to quantify the size of an SB the notion of integrity measure (e.g., global integrity measure (GIM) which is the hyper-volume of the SB) is introduced [27]- [29]. Reduction of the integrity with the change of the system parameters is referred to as erosion, and the variation of integrity is called the erosion profile. In [27] the control was applied by alteration of the excitation shape leading to the shift of the erosion profile towards greater external forcing amplitudes by eliminating homo/heteroclinic bifurcations of hilltop saddles. Soliman and Thompson investigated stochastic integrity (SI) in the presence of a white noise [30] while Orlando et al. continued the study SI for bistable elastic structures with harmonic and stochastic loading [31], [32].
Despite all the advances in the study of SBs and their erosion, most of the related methods have significant limitations. First, due to the complexity of the problem, the analytic treatment of SBs often stays beyond the consideration. Secondly, an integrity measure only quantifies the magnitude of an SB, however, it possesses no information about the shape. The boundary for possible placement of the attractors in a strongly nonlinear forced system can be assessed by semi-analytic procedure [33] and can be highly nontrivial.
Current work suggests the analytic approach for predicting the SB boundaries in a benchmark model system -a particle in truncated quartic potential -under harmonic forcing with constant amplitude. First, the AIR is applied to find the escape threshold for arbitrary initial conditions inside the well, under different levels of truncation. Then, the SB boundaries are identified and classified both on the RM and in the IC plane.
The paper is organized as follows. In Section 2 the model is presented, and the AIR is described. Those are followed by derivation of the critical forcing amplitude and classification of the safe basins. Section 3 presents the comparison of analytic results with numerical simulations and addresses the limitations of the suggested approach. Section 5 is devoted to discussion and conclusions.

Model description and analytic results
We consider a harmonically forced quartic oscillator in the absence of damping. In the nondimensional form the equation is written as , where q is the displacement, τ stands for a nondimensional time, F is the amplitude of the external force, Ω is the force frequency, and Ψ is the forcing phase.
Equation (1) defines motion of a harmonically forced particle of the unit mass in a symmetric quartic potential .
Assuming initially the particle is trapped inside the potential well, we are looking for the trajectories that correspond to the escape, i.e., particle leaving the well. Commonly, the escape is defined as !→# | (τ)| > max where 0 < max ≤ 1. However, this criterion is problematic for numerical implementation, therefore, we use an alternative definition of escape: ! | (τ)| > max . Note that the two definitions are not equivalent, nonetheless, for the purpose of our problem, the latter definition is sufficient [21], [23].
In light of the range constraints due to the escape, one can generalize the potential (2) by applying the truncation at certain critical displacement inside the potential well: . ( Alternatively, we can perform the truncation by setting the maximum energy level max . In this case the maximum displacement max is defined as follows: . At a first glance, the truncated potential may appear far-fetched, however, in some applications it emerges naturally. For example, in the context of naval mechanics the escape from the full (non-truncated) potential corresponds to the ship capsizing [18], while the truncation corresponds to additional constraints imposed on the maximum allowed roll angle of the ship. Furthermore, truncated polynomial potentials can be used as a tool for approximating the escape problem in more intricate potentials.
It is convenient to represent equation (1) in the Hamiltonian form , where =̇ is the momentum of the particle and Hamiltonian H(p,q) is .
Here, H0 denotes the basic Hamiltonian , i.e., the complete energy exceeds a maximum level max . The difference between different escape definitions is discussed in Appendix.

Action angle formalism and isolated resonance approximation
In order to obtain isolated resonance approximation, one needs to rewrite the Hamiltonian system (4) in AA variables and subsequently average it over the fast phases.
The canonical pair (I, θ) composed of action and angle is defined as follows [1]: , where Γ ) is a curve defined by a level set ' = . The canonical transformation (8) does not explicitly depends on time , and therefore, the Hamiltonian (6) can be written in AA variables: .
Due to the 2 -periodicity of the angle variable, the Hamiltonian (9) can be expanded in terms of the Fourier series: , where symbol * denotes the complex conjugation. In order to treat 1:1 resonance the phase = − − is assumed to be slow, while all other combinations of phases must be considered fast [15], [21], [23]. After performing the averaging over the fast phases, one arrives at the following slow-flow equations: , with the first integral [15], [21] , (12) where = ⟨ (τ) ⟩ denotes the averaged action. Equation (12) defines a family of 1:1 RMs of the system. The existence of the first integral (12) is attributed to the fact that (5) is Hamiltonian. The value of the constant is determined by the IC on the RM, i.e., the values of the averaged action and the slow phase γ at which the system is captured by the RM.
By applying transformation (8) to the basic Hamiltonian (7) one can express action-angle variables as functions of the energy E and the displacement q as follows (see [23] for the detailed derivation): , , (14) where ( ) = √1 − 4 ; functions ( ) and ( ) are complete elliptic integrals of the first and the second kind, respectively, with the modulus 1 = S(1 − )/(1 + ).
Finally, ( , ) denotes the incomplete elliptic integral of the first kind.
Equation (14) yields the displacement q as a function of the angle and the where sn(x, k) denotes the Jacobi elliptic sine function.
By taking the time derivative of (15) and noting that , we obtain the following expression for the momentum p: .
In order to proceed with derivation of the conservation law (12), one needs to find ' ( ). Unfortunately, the inversion of (13) in a closed form is impossible, however, for the purpose of the escape problem it is enough to consider an averaged energy = ⟨ ( )⟩ instead of the averaged action . In this case the conservation law for the slow dynamics is written as follows: 1 Commonly in scientific software like SciPy or Wolfram Mathematica one needs to square the modulus, i.e., K(k) or F(ϕ| k) in the formula reads as K(k 2 ) or F(ϕ| k 2 ) in the program code.

Escape threshold on the control plane
We proceed with the qualitative analysis of the averaged dynamics of the system defined by the integral of motion (18). In order to determine if a trajectory starting from a given IC ( ini , ini ) is escaping according to the maximum energy criterion, one has to check whether the corresponding level curve , crosses the circle = max . In [21], [23] two main scenarios of transition to escape were identified as a maximum mechanism (MM) and saddle mechanism (SM).
The maximum mechanism is a passage to escape described as follows. For a fixed frequency , and the forcing < cr the phase curve (21) lies entirely below the threshold level = max and the particle stays in the well; at = cr the curve (21) is tangent to the circle = max ; finally, for values > cr the same curve crosses the circle = max , leading to the escape.
Similarly, the saddle mechanism represents the following behaviour. For the values of the external force < cr , the part of the curve (21) connected to the point ( ini , ini ) remains below the saddle on the RM; when = cr it passes through the saddle point; and for > cr the escape occurs.
In order to obtain the critical value cr of the external forcing amplitude needed for the escape through MM, one can solve the following equation: .
where * is such that It is easy to see that for any 0 < max < 1/4 the possible values of * are 0 and .
Therefore, the critical force cr is .
In case of SM, the critical force cr is obtained by solving the system , , where ∇ and denote the gradient and the Hessian matrix, respectively. Note that, solving the above equations analytically for is an impossible task. However, it is not necessary as one can use to parameterize the curve \ ]^, ]^_. Figures 1 and   2 show the behaviour of the critical force curve depending on different values of ξini and γini, respectively. Generally, higher initial energies ini correspond to lower critical force amplitude required for the escape. However, our research shows that zero initial energy in the case of SM turns out to be an exception as its cr (Ω) curve lies below analogous curves for some higher initial energies.    is, while the resonance frequency (at the minima) increases. This behaviour is attributed to the fact that a shallow well can be approximated with a quadratic potential (i.e., linear oscillator), hence the resonance frequency is close to = 1.

Safe basins in the vicinity of the main resonance of the perturbed system
The escape of the particle corresponds to the phase curves that transverse the threshold energy level = max on the phase cylinder ( , ). On the contrary, the phase curves located below the circle = max correspond to non-escaping trajectories of the particle. Therefore, in order to locate the SB, one needs to determine its boundarythe critical position of the non-escaping phase curves.
Similarly, to the available escape mechanisms, there are two types of the SB depending on their boundaries: the maximum type and the saddle type. We say the basin is of maximum type (SBMT) if its boundary is a phase curve tangent to the circle = max . An SB is of the saddle type (SBST) if its boundary passes through the saddle point. Note that these two types are not mutually exclusive and can coexist.
The boundary of a SBMT is defined by the equation: , where γ* is a solution to (23). It is clear that there are only two possible values of γ*: γ * = 0 and γ * = . Once the boundary is established, one needs to locate the safe region it is enclosing. There are two topologically non-equivalent kinds of SBMT: "island" and "peninsula". The main difference between the two is that the peninsula wraps around the RM phase cylinder, whereas the island does not. However, for our = purposes the most important distinction is in the way we find the safe region. In the case of an island the safe region is defined as all the points enclosed by the curve (28) whereas in the case of peninsula the safe region comprises all the points bounded between the curve (28) and the circle ξ=0. It is important to note that the latter kind of SBMT contains points with all possible values of the angle γ. A special case of an island SBMT has an LPT as its boundary. In this case the safe region is defined the same way as for a peninsula.
After the boundary of SB in the space (γ, ξ) is computed, one can use formulas (15), (17) to obtain the corresponding SB in the space of IC on the (q0,p0) plane.
The island kind of SBMT is illustrated in Figure 5, where and satisfy equation (25). The safe region is bounded by the curve (28) and the circle = 0.
An example of SBST is presented in Figure 8. The case of coexisting regions is demonstrated in Figure 9. We adopt the same notation as in Figures 5 -7.  The amount and the location of the available critical points in equation (18) exhaust all the possibilities of escape scenarios. Therefore, for the problem in question the presented classification of SBs is complete.

Numeric verification
In order to validate theoretical predictions of the critical forcing curve cr (Ω) as well as the SBs, we compare the analytic results from Sections 1-2 with numerical simulations. The averaged system (18) is expected to approximate the original system (1) in the vicinity of the primary 1:1 resonance for relatively small excitation amplitudes. However, for the larger forces we anticipate SB to undergo erosion due to the higher order resonances, see [2], [27]- [32].

3.1.
Critical escape force in the control plane  Similarly, Figures 11 and 12 show the corresponding curves Fcr(Ω) for nonzero ICs.  The notation is the same as in Figure 10.
Comparison of numerical simulation results with these derived from a simplified model prediction clearly shows high fidelity approximation in the vicinity of the main resonance, the dip, and weaker prediction quality on the distant frequencies, especially with the MM scenario.

The SB -analytic predictions versus numerical simulations
In order to verify the approximation of SB, we compare it with the numerical simulation results. We superimpose theoretic SB boundaries on the non-escaping regions obtained with numeric time   Figure 13 have the same topology for all the cutoff energy levels, Figure 14 shows the disjoint SBs for smaller values of max (cf. Figure 9). For the chosen parameters the agreement between theoretically obtained SBs and their numerical counterparts is very good.  Figure 14). For relatively small force amplitudes ( Figure 16) the numeric results nicely conform to the theoretical predictions. Figure 17 presents a similar comparison for higher levels of forcing.  As one can see, for small values of the external forcing F the analytically predicted boundaries perfectly match the numeric SBs, even when the SB is disjoint. However, when F increases, the discrepancy between the theoretic prediction and the numeric SBs becomes more and more substantial. The reason for the reduction of the prediction quality can be attributed to the fact that the AIR method captures only the primary 1:1 resonance, while neglecting the secondary resonances which cause the erosion of SBs [27]- [32]. Nevertheless, the obtained theoretical boundaries can serve as a reasonable initial approximation of the SB for subsequent possible numeric refining.
In order to further analyze the structure of SB for the larger values of external forcing, it is instructive to consider the stroboscopic (period) map , (29) with = 2π/Ω. Figure 18   ( ( ), ( )) ( ( ), ( )) q t p t q t T p t T + + !

Discussion and conclusions
The results obtained above indicate that the approximation of isolated resonance enables analytic prediction of the safe boundaries in the problem of forced escape. For relatively small forcing amplitudes, these predictions are very accurate. The reason is that the forcing term is in fact a perturbation of integrable basic Hamiltonian describing the conservative motion in the well. This approach reveals some new possible properties of the SB, e.g., complicated, or even disjoint geometric shape For higher forcing amplitudes, the quality of the prediction deteriorates due to intrinsic inaccuracies of the AIR and, more significantly, due to secondary resonances that are not taken into account in the AIR and cause the SB erosion. Still, the analytic prediction can serve as a viable initial guess for the SB with further numeric tightening.
The analysis presented above is substantially based on the ability to perform the action-angle transformation in the benchmark model with quartic potential.
Application of the developed method to more generic models, where this transformation is not possible, may be based on appropriate approximation techniques, and requires further exploration.

Appendix: Comparison of the escape criteria
As it was mentioned before, the two escape criteria -maximum energy and maximum displacement -are not equivalent. It is obvious that the energy criterion immediately follows from the displacement criterion, and therefore, the SB based on the energy criterion (ESB) is always included in the corresponding SB defined through the maximum displacement criterion (DSB). However, the other way is not necessarily true. In order to compare two criteria, the following numeric test is performed. For each value of the forcing amplitude F, we pick 10,000 random ICs from the square Next, we run the simulations again for the rest of ICs but with the displacement criterion to obtain the set belonging to the DSB but not to the ESB. Let / and ) denote the number of points that belong to the DSB and the ESB, respectively. The difference between / and ) relative to ) exhibits the discrepancy between the two criteria.
The experiment is repeated 5 times for the values of the external forcing amplitude F ranging from 0.001 to 0.071 with a step Δ = 0.005. The results are presented in Figure 19. As one can see, for the small values of the external forcing amplitude F, SBs for both criteria are almost identical. However, with increasing F the difference becomes substantial, see Figure 19.   Each point on the graph is a natural logarithm of the SB area computed numerically at a given evaluation time.