1 Introduction

Since the inception of complex systems as a focus of interest within Physics, ensembles of coupled oscillators have provided one of the main archetypes for the study of the emergence of collective behavior in systems formed by many interacting dynamical elements. Coherent motion induced by coupling—namely, mutual synchronization of various degrees between single oscillations—is identified as a paramount example of the kind of phenomena brought about by the interplay of individual dynamics and interactions [1, 2]. The study of collective behavior in large ensembles of coupled oscillators has been originally motivated by the observation of coherent dynamics in biological systems, ranging from molecular complexes and cell tissues to populations of insects and other living beings [3]. The basic mechanism underlying synchronization in oscillator ensembles, initially proposed by Winfree [4] and later formalized by Kuramoto [5], is directly inspired in the reciprocal action of “biological clocks”.

On the other hand, although the first recognized historical observation of synchronization was reported for two pendulum clocks (in 1665, by Christiaan Huygens [1]), ensembles of interacting mechanical oscillators have received relatively little attention concerning their feasibility of becoming synchronized. The joint motion of mechanical oscillators, however, not only provides an effective theoretical illustration of coherent evolution in dynamical systems, but is also an important matter of consideration in many technological applications. In particular, the control of energy exchange between different components of a mechanical device, and between the device and its surroundings, is of high relevance to the functioning of a broad class of machines and instruments. Examples that involve coupled oscillators are, for instance, equipment for energy harvesting [6, 7], pacemakers, and sensors [8,9,10].

In a recent contribution [11], we have studied energy exchange in an ensemble of globally coupled mechanical oscillators, in a situation where the system is excited by an external harmonic force applied to one of the oscillators. Friction forces, whose intensity varied from oscillator to oscillator, made it possible to reach a state of stationary motion where we characterized the flow of energy between different oscillators and with the environment. The conservative part of the dynamics, which encompassed coupling between oscillators, was described by the mean-field Hamiltonian [12, 13], where the canonical coordinates of each oscillator are its phase and the conjugate (angular) momentum.

Here, we generalize the analysis to the case where both the friction coefficients and the moments of inertia are different between oscillators. We show that this heterogeneity induces a varied dependence of the rates of energy exchange on the individual parameters of each element, which can even control the direction in which energy flows in different parts of the system. Energy exchange is characterized in three disparate regimes of coherent motion, depending on the degree of entrainment with the external excitation: full and partial synchronization, and desynchronization. In Sect. 2, after introducing our model, we describe the main dynamical properties of the three regimes. In Sect. 3, approximate analytical solutions for the equations of motion in each regime are presented. Using these solutions, in Sect. 4, we calculate the respective rates of energy exchange, and present a comparison with results obtained from direct numerical integration of the equations. Finally, conclusions are outlined in Sect. 5.

2 Globally coupled non-identical phase oscillators

Our system consists of an ensemble of N phase oscillators subjected to global coupling, friction, and an external harmonic excitation applied to one of the oscillators –which, without generality loss, we identify as oscillator 1. The dynamical state of each oscillator is fully characterized by its phase \(\theta _n (t) \in [0,2\pi )\) and the corresponding conjugate momentum \(p_n(t)\). Coupling is given by a pair interaction which derives from the Hamiltonian mean-field (HMF) model,

$$\begin{aligned} {{\mathcal {H}}} = \sum _{n=1}^N \frac{p_n^2}{2I_n} -\frac{K}{N}\sum _{n<m}^N \cos (\theta _m-\theta _n) , \end{aligned}$$
(1)

where \(I_n\) is the moment of inertia of oscillator n, and K is the coupling strength. We recall that, owing to its minimalist nature, the HFM model has been widely applied to the study of collective behavior in Hamiltonian systems [12, 13]. Here, we use it as a convenient stylized representation of any ensemble of coupled mechanical (nonlinear) oscillators.

To the equations of motion derived from the Hamiltonian in Eq. (1), we add friction forces proportional to the velocities \({\dot{\theta }}_n\), and the external harmonic excitation, getting

$$\begin{aligned} I_n {\ddot{\theta }}_n {=} \frac{K}{N} \sum _{m=1}^N \sin (\theta _m -\theta _n) - \gamma _n {\dot{\theta }}_n {+} F \sin (\omega t-\theta _1) \delta _{n1},\nonumber \\ \end{aligned}$$
(2)

for \(n=1,\dots , N\), where \(\gamma _n\) are the friction coefficients. In the last term, F and \(\omega \) are the amplitude and frequency of the external excitation, and \(\delta _{n1}\) is Kronecker’s delta. Note that this forcing is equivalent to the interaction of oscillator 1 with an oscillator of prescribed phase \(\omega t\), having the same dependence on phases as the coupling described by the first term in the right-hand side.

Equations (2) adopt a more tractable form if we introduce a Kuramoto-like order parameter [5]

$$\begin{aligned} R \, \mathrm{e}^{i \varTheta } = \frac{1}{N-1} \sum _{n=2}^N \mathrm{e}^{i \theta _n}. \end{aligned}$$
(3)

Because of the special dynamical status of oscillator 1, which experiences the action of the external force, we have restricted the sum in Eq. (3) to \(n>1\). Hereafter, the group of oscillators with \(n=2,\dots , N\) is called the \(\varOmega \) set.

It is convenient, moreover, to rescale time in such a way that the frequency of the excitation equals unity. This amounts to renaming \(\omega t\rightarrow t\), \(\omega ^{-2} K \rightarrow K\), \(\omega ^{-1} \gamma _n \rightarrow \gamma _n\), and \(\omega ^{-2} F \rightarrow F\) for all n. With these definitions, Eqs. (2) finally read

$$\begin{aligned} I_1 {\ddot{\theta }}_1 = {\bar{K}} R \sin (\varTheta -\theta _1)- \gamma _1 {\dot{\theta }}_1 + F \sin ( t-\theta _1) \end{aligned}$$
(4)

for oscillator 1, and

$$\begin{aligned} I_n{\ddot{\theta }}_n = {\bar{K}} R \sin (\varTheta -\theta _n)- \gamma _n{\dot{\theta }}_n+ k \sin (\theta _1-\theta _n) \end{aligned}$$
(5)

for \(n=2,\dots ,N\), with \({\bar{K}} =(N-1) K/N\), and \(k=K/N\).

The instantaneous power exchanged by oscillator n with the rest of the system is given by the product \(I_n {\dot{\theta }}_n{\ddot{\theta }}_n\). As the oscillator receives or releases energy, this quantity is respectively positive or negative. Its average over time, \(w_n =I_n \langle {\dot{\theta }}_n{\ddot{\theta }}_n \rangle _t\), can be divided into contributions coming from the three mechanisms that drive the dynamics, namely, coupling, friction, and the external excitation. Specifically, we write \(w_n = w_n^\varOmega +w_n^\varGamma +w_n^F\), where

$$\begin{aligned} w_n^\varOmega = {\bar{K}} \langle R \sin (\varTheta -\theta _n){\dot{\theta }}_n \rangle _t \end{aligned}$$
(6)

is the rate of energy exchange between oscillator n and the \(\varOmega \) set, and

$$\begin{aligned} w_n^\varGamma = - \gamma _n \langle {\dot{\theta }}_n^2 \rangle _t, \end{aligned}$$
(7)

equals the power lost by friction. Moreover,

$$\begin{aligned} w_1^F = F \langle \sin (t-\theta _1) {\dot{\theta }}_1 \rangle _t \end{aligned}$$
(8)

corresponds to the power received or released by oscillator 1 from or towards the source of external forcing, and

$$\begin{aligned} w_n^F = k \langle \sin (\theta _1-\theta _n) {\dot{\theta }}_n \rangle _t, \end{aligned}$$
(9)

for \(n=2,\dots N\), is the rate of energy exchange of an oscillator in the \(\varOmega \) set with oscillator 1.

As discussed in our previous publication [11], the present system is expected to exhibit three qualitatively different stationary regimes of collective behavior, depending on the parameters which control the dynamics. These regimes are characterized by diverse degrees of synchronization with the external excitation. It is important to remark that they are not necessarily separated by sharp boundaries in parameter space, but rather belong to well-differentiated ranges of K, F, and of the individual parameters \(I_n\) and \(\gamma _n\). The three regimes are schematized in Fig. 1.

Fig. 1
figure 1

Upper row: Illustrative diagram of the position and the velocity of oscillators around the circle of phases, in the three regimes of collective behavior described in the text. The cross indicates the phase of the external excitation. Open and full dots represent oscillator 1 and the \(\varOmega \) set, respectively. Single arrows stand for the frequency of excitation and the average frequency of oscillators, and double arrows denote small oscillations around the average motion. Lower row: Schematic representation of the time dependence of phases for the excitation, oscillator 1, and the \(\varOmega \) set, as indicated in the legend

When the external excitation is sufficiently strong as compared to the action of coupling and friction, oscillators reach a state of full synchronization. In this regime, the whole ensemble moves rigidly with the same frequency as the forcing. Different oscillators, however, have different phases, depending on their individual moments of inertia and friction coefficients.

If the external excitation remains dominant but friction forces overcome the effects of coupling, the average motion of oscillator 1 is still synchronized with the forcing. In contrast, the \(\varOmega \) set detaches itself from synchronized motion and, on the average, moves at a much slower pace. Moreover, in this regime of partial synchronization, all oscillators perform small-amplitude oscillations around their average phase drift.

Finally, when the external force is weak as compared to coupling and friction, the excitation is unable to entrain the ensemble and desynchronization follows. In this situation, oscillator 1 becomes aggregated to the \(\varOmega \) set, and the whole ensemble moves with a frequency much smaller than that of the forcing, also modulated by small oscillations.

In the following, we provide a quantitative description of these three stationary dynamical regimes, within some simplifying assumptions that make the problem analytically tractable. Results allow us to explicitly calculate the rates of energy exchange \(w_n^\varOmega \), \(w_n^\varGamma \), and \(w_n^F\) of Eqs. (6) to (9). These quantities are compared with estimations obtained from numerical solution of the equation of motion, illustrating the variety of behaviors that energy exchange can adopt all over the system.

3 Analytical treatment of collective dynamics

The equations of motion (4) and (5) can be dealt with analytically if the standard deviation of the friction coefficients and the moments of inertia over the ensemble, \(\sigma _\gamma \) and \(\sigma _I\), respectively, are sufficiently small as compared with the coefficients themselves. Numerical integration of the equations show that, under these conditions, the dispersion of phases between the oscillators in the \(\varOmega \) set is small. Based on this evidence, we assume that the individual phases \(\theta _n\) differ from their arithmetic average \(\langle \theta \rangle =(N-1)^{-1} \sum _{n=2}^N \theta _n\) by quantities \(\epsilon _n =\theta _n - \langle \theta \rangle \) which are proportional to \(\sigma _\gamma \) and \(\sigma _I\). Neglecting terms of order \(\sigma _\gamma ^2\) and \(\sigma _I^2\) in Eq. (3), we get \(R\, \exp (i \varTheta ) = \exp (i \langle \theta \rangle )\) or, equivalently,

$$\begin{aligned} R=1, \qquad \varTheta =\langle \theta \rangle . \end{aligned}$$
(10)

Moreover, if we disregard statistical correlations between friction coefficients and velocities on one side, and moments of inertia and accelerations on the other, we can write

$$\begin{aligned} \frac{1}{N-1} \sum _{n=2}^N \gamma _n {\dot{\theta }}_n = \langle \gamma \rangle \langle {\dot{\theta }} \rangle , \qquad \frac{1}{N-1} \sum _{n=2}^N I_n {\ddot{\theta }}_n = \langle I \rangle \langle {\ddot{\theta }} \rangle ,\nonumber \\ \end{aligned}$$
(11)

where \(\langle \cdot \rangle \) stands for averages over the \(\varOmega \) set. Naturally, the validity of these assumptions is to be assessed from comparison with numerical results, which we postpone to next section.

Replacing our simplifying hypotheses in Eqs. (4) and (5), we get a pair of coupled equations of motion for the phase of oscillator 1 and for the average phase of the \(\varOmega \) set, \(\theta _1\) and \(\varTheta \), of the form

$$\begin{aligned} I_1 {\ddot{\theta }}_1= & {} {\bar{K}} \sin (\varTheta -\theta _1)-\gamma _1{\dot{\theta }}_1 + F \sin (t-\theta _1), \end{aligned}$$
(12)
$$\begin{aligned} \langle I \rangle {\ddot{\varTheta }}= & {} -\langle \gamma \rangle {\dot{\varTheta }} + k \sin (\theta _1 - \varTheta ). \end{aligned}$$
(13)

The equation of motion for the individual phase differences in the \(\varOmega \) set, \(\epsilon _n=\theta _n-\varTheta \), is obtained by dividing Eq. (5) by \(I_n\), subtracting Eq. (13) divided by \(\langle I \rangle \), and approximating to the first order in \(\epsilon _n\):

$$\begin{aligned} \ddot{\epsilon }_n = -{\bar{K}}_n \epsilon _n+ \frac{ K_n-K}{N} \sin (\theta _1 - \varTheta ) -(\gamma _n -\langle \gamma \rangle ) {\dot{\varTheta }} -\gamma _n {\dot{\epsilon }}_n.\nonumber \\ \end{aligned}$$
(14)

Here, for the sake of brevity in notation, we have renamed \(\gamma _n/I_n\rightarrow \gamma _n\), \(\langle \gamma \rangle / \langle I\rangle \rightarrow \langle \gamma \rangle \), and \(K/ \langle I\rangle \rightarrow K\). Also, we have defined \(K_n=K/I_n\), \({\bar{K}}_n={\bar{K}}/I_n\). Note that Eq. (14) couples the dynamics of \(\epsilon _n\) with those of \(\theta _1\) and \(\varTheta \).

Equations (12) to (14) constitute our approximation to deal analytically with the equations of motion (4) and (5). In the following, we study their solution in the three synchronization regimes pointed out in Sect. 2.

3.1 Full synchronization

For the whole ensemble to synchronize with the external excitation it is necessary, first, that oscillator 1 becomes entrained by the harmonic force. This requires that, in Eq. (4), the last term in the right-hand side dominates over the other two, \(F\gg {\bar{K}}, \gamma _1\). Under these conditions, for long times, the phases of oscillator 1 and the external excitation differ by a small quantity

$$\begin{aligned} \eta (t)=t -\theta _1 (t) . \end{aligned}$$
(15)

To the first significant order in \( \eta \), Eq. (4) becomes

$$\begin{aligned} \ddot{\eta }= {\bar{K}} \sin (\tau -\varTheta )-\gamma _1 ( {\dot{\eta }} - 1) - F \eta , \end{aligned}$$
(16)

while from Eq. (5) we get

$$\begin{aligned} {\ddot{\varTheta }} = -\langle \gamma \rangle {\dot{\varTheta }}+ k \sin (t- \varTheta ). \end{aligned}$$
(17)

This is the equation of motion for a mechanical oscillator of phase \(\varTheta \) subjected to friction and an external harmonic force of unitary frequency. It can be readily shown [2, 11] that, for long times, its solution becomes synchronized to the force if \(k > \langle \gamma \rangle \). Thus, this is the second condition that defines the regime of full synchronization in our oscillator ensemble. The asymptotic stationary solution for the average phase in the \(\varOmega \) set is

$$\begin{aligned} \varTheta = t- \arcsin \frac{\langle \gamma \rangle }{k} . \end{aligned}$$
(18)

Replacing this result in Eq. (16), and taking into account the first condition that defines the regime of full synchronization, we consistently verify that \(|\eta | \ll 1\) for long times.

Finally, substituting Eq. (18) in Eq. (14), we obtain the individual deviations of oscillators in the \(\varOmega \) set with respect to their average phase:

$$\begin{aligned} \epsilon _n = \frac{\langle \gamma \rangle }{{\bar{K}}_n} \left( \delta K_n - \delta \gamma _n \right) , \end{aligned}$$
(19)

with

$$\begin{aligned} \delta K_n = \frac{K_n-K}{K}, \ \ \ \ \ \delta \gamma _n = \frac{\gamma _n-\langle \gamma \rangle }{\langle \gamma \rangle }. \end{aligned}$$
(20)

Note that \(\epsilon _n\) results from the combination of the deviations of individual coupling constants \(K_n\) and friction coefficients \(\gamma _n\) with respect to their average values. Depending on their relative sign, these deviations can mutually reinforce their effect or compensate each other.

3.2 Partial synchronization

When \(F\gg {\bar{K}}, \gamma _1\) and \(\langle \gamma \rangle > k\), Eqs. (15) and (16) still hold and, therefore, oscillator 1 is entrained by the external excitation and moves with the same frequency, but the \(\varOmega \) set does not synchronize with oscillator 1. This situation defines the regime of partial synchronization, for which we are able to provide an analytical description in the limit \(\langle \gamma \rangle \gg k\). On the basis of numerical evidence, as advanced in Sect. 2, we propose a stationary solution where the average phase in the \(\varOmega \) set moves with a small constant drift velocity \(\nu \) and, at the same time, oscillates around this uniform motion with a small amplitude and a frequency induced by its interaction with oscillator 1, namely,

$$\begin{aligned} \varTheta (t) = A \cos [(1-\nu ) t - \varPsi ]+\nu t. \end{aligned}$$
(21)

Substitution into Eq. (17) gives, to the leading order in \(\nu \) and A,

$$\begin{aligned} A = \frac{k}{\sqrt{1+\langle \gamma \rangle ^2}} \end{aligned}$$
(22)

where we have neglected higher-harmonic contributions coming from the last term in the right-hand side. Furthermore, averaging the equation over the fast oscillation of frequency \(1-\nu \), we find

$$\begin{aligned} \nu = \frac{1}{2}A^2 = \frac{k^2}{2(1+\langle \gamma \rangle ^2)} \end{aligned}$$
(23)

for the drift velocity. Consistently with our approximation to the regime of partial synchronization, we have \(A,\nu \ll 1\). Moreover, replacing the stationary solution for the average phase in the \(\varOmega \) set into Eq. (16), and using the defining conditions of this regime, we find that the approximation \(|\eta | \ll 1\) holds. This implies that oscillator 1 is entrained by the external excitation, which makes our analytical description consistent.

For asymptotically long times, the individual deviations from the average motion of the \(\varOmega \) set are now time-dependent:

$$\begin{aligned} \epsilon _n (t) = A \sqrt{\frac{(\delta K_n)^2+\langle \gamma \rangle ^2 (\delta K_n - \delta \gamma _n)^2}{\left( {\bar{K}}_n-1 \right) ^2+\gamma _n^2}} \cos (t-\psi _n), \end{aligned}$$
(24)

with A given by Eq. (22). The phase shifts \(\varPsi \) in Eq. (21) and \(\psi _n\) in Eq. (24) can also be given explicit expressions. However, since these algebraically cumbersome formulas are not involved in the rates of energy exchange we are interested in, we avoid reporting them for brevity.

Note that, in contrast with the result of Eq. (19) in the regime of full synchronization, the deviations \(\epsilon _n\) in Eq. (24) cannot be suppressed by mutually compensating \(\delta K_n\) and \(\delta \gamma _n\). In the regime of partial synchronization, a dispersion in the values of \(K_n\) –i.e. in the moments of inertia– is enough to induce non-trivial dynamics inside the \(\varOmega \) set.

3.3 Desynchronization

When the condition on the external excitation that defines the regimes of full and partial synchronization is inverted, \(F\ll {\bar{K}} , \gamma _1\), the oscillator ensemble cannot be entrained by the force, and moves out of synchrony. In this regime, at long times, both oscillator 1 and the \(\varOmega \) set exhibit a slow drift with the same velocity, and small oscillations around this motion. Our proposal for the solutions to Eqs. (4) and (5) is now

$$\begin{aligned} \begin{array}{rl} \theta _1(t) &{}= a_1 \cos [(1-\nu ) t-\psi _1]+\nu t, \\ \\ \varTheta (t) &{}= A \cos [(1-\nu ) t-\varPsi ]+\nu t+\varTheta _0. \end{array} \end{aligned}$$
(25)

To the leading order in amplitudes and velocities, we get

$$\begin{aligned} a_1= & {} \frac{F}{\sqrt{\left[ {\bar{q}}{\bar{K}}-1+ q ( N-1)\right] ^2+\left( {\bar{q}} \gamma _1 +q \varGamma \right) ^2}} , \end{aligned}$$
(26)
$$\begin{aligned} A= & {} \frac{\sqrt{q}F}{\sqrt{\left[ {\bar{q}}{\bar{K}}-1+ q ( N-1)\right] ^2+\left( {\bar{q}} \gamma _1 +q \varGamma \right) ^2}}, \end{aligned}$$
(27)

and

$$\begin{aligned} \nu = \frac{1}{2} A^2 + \frac{{\bar{q}} \gamma _1}{2 \varGamma } a_1^2, \end{aligned}$$
(28)

with \(\varGamma =\sum _{n=2}^N \gamma _n\) and

$$\begin{aligned} q\equiv \frac{k^2}{(k-1)^2 + \langle \gamma \rangle ^2}, \ \ \ {\bar{q}}=1-q. \end{aligned}$$
(29)

The individual deviations \(\epsilon _n\) have the same form as in Eq. (24), with A now given by Eq. (27). As in the regime of partial synchronization, the phase shifts in Eqs. (25) and in the expression for \(\epsilon _n\) can be given explicit expressions, which we do not report here.

4 Rates of energy exchange: analytical and numerical results

Having obtained approximate stationary solutions for the equations of motion in the three regimes of collective dynamics of our system, we can now proceed to calculate the rates of energy flow and dissipation, \(w_n^\varOmega \), \(w_n^\varGamma \), and \(w_n^F\), given by Eqs. (6)–(9). The procedure amounts to substituting the solutions found in the preceding section and, within the same approximation order, compute the time averages which define the quantities \(w_n^\varOmega \), \(w_n^\varGamma \), and \(w_n^F\). As we show in the following, the results can be given explicit analytical expressions.

At the same time, we compare our analytical results with estimations of the same quantities obtained from direct numerical integration of the equations of motion (2). This integration was performed using a standard Runge–Kutta fourth-order ODE solver implemented in C++. At every time step, the sum of forces acting over each oscillator was calculated in GPU by means of the Thrust parallel algorithms library [14]. With the aim of maintaining consistency and accuracy in the computation, we strictly adhered to the following protocol. (i) Set the total integration time to ten times the maximum ratio between moment of inertia and friction coefficient over the ensemble, \(10 \max _n \{I_n/\gamma _n\}\). This setting satisfactorily ensures that transients have elapsed and that stationary oscillations have been reached. (ii) Choose a sufficiently small time discretization, so that the total deviation in the conservation of energy due to the numerical errors remains below 0.1%. (iii) Store in video memory the data for the position and the velocity of each oscillator during ten successive oscillations in the stationary state. (iv) Calculate the time average of the different rates of energy exchange using the stored data, by means of GPU parallel computation. In all cases studied below, the relative discrepancy between analytical and numerical results consistently remained within a few percent.

From the analytical solutions in the regime of full synchronization, we get

$$\begin{aligned} w_1^\varOmega= & {} -(N-1) \langle \gamma \rangle , \nonumber \\ w_1^\varGamma= & {} -\gamma _1, \nonumber \\ w_1^F= & {} (N-1) \langle \gamma \rangle +\gamma _1 , \end{aligned}$$
(30)

for oscillator 1, and

$$\begin{aligned} w_n^\varOmega= & {} \frac{K}{K_n} \langle \gamma \rangle (\delta \gamma _n -\delta K_n), \nonumber \\ w_n^\varGamma= & {} - \frac{K}{K_n}\gamma _n, \nonumber \\ w_n^F= & {} \langle \gamma \rangle , \end{aligned}$$
(31)

for \(n=2,\dots ,N\). It can be shown that \( w_n^\varOmega + w_n^\varGamma + w_n^F =0\) for all n, as expected to happen in stationary motion, where the incoming and the outgoing mechanical power must compensate each other for each oscillator.

In this regime, the rates of energy exchange depend linearly on the friction coefficients and are inversely proportional to the constants \(K_n\) –i.e. they are linear on the moments of inertia \(I_n\) (see Sect. 3). Moreover, the exchange of energy between oscillators in the \(\varOmega \) set, measured by \(w_n^\varOmega \), can change sign depending on the deviations of \(\gamma _n\) and \(K_n\) with respect to their averages. These deviations, in turn, can reinforce or compensate each other; cf. Eq. (19). Figure 2 shows three-dimensional plots of \(w_n^\varOmega \), \(w_n^\varGamma \), and \(w_n^F\) for the \(\varOmega \) set over the plane spanned by \(K_n\) and \(\gamma _n\). Gridded surfaces correspond to the analytical results of Eq. (31) and dots are numerical estimations for a system of \(2\times 10^4\) oscillators, with the parameters indicated in the caption.

Fig. 2
figure 2

Rates of energy exchange, \(w_n^\varOmega \), \(w_n^\varGamma \), and \(w_n^F\), in the regime of full synchronization as functions of the friction coefficients \(\gamma _n\) and the coupling constants \(K_n\) of individual oscillators in the \(\varOmega \) set. The gridded surfaces correspond to the analytical results of Eqs. (31), and the dots show numerical results for \(N=2 \times 10^4\), \({\bar{K}}=1.5 \times 10^4\) and \(F=10^5\). The friction coefficients and moments of inertia were drawn from a Gaussian distribution with mean values \(\langle \gamma \rangle =0.2\) and \(\langle I \rangle =1\), and standard deviations \(\sigma _\gamma =0.05\), \(\sigma _I =0.1\) respectively. The bright line on the horizontal surface of the uppermost panel indicates the curve in the (\(K_n,\gamma _n\))-plane where \(w_n^\varOmega =0\)

In the regime of partial synchronization, we have

$$\begin{aligned} w_1^\varOmega= & {} -\frac{A^2}{2} (N-1) \langle \gamma \rangle ,\nonumber \\ w_1^\varGamma= & {} -\gamma _1 , \nonumber \\ w_1^F= & {} \frac{A^2}{2} (N-1) \langle \gamma \rangle + \gamma _1, \end{aligned}$$
(32)

for oscillator 1, where the amplitude A is given by Eq. (22). Meanwhile, the rates of energy exchange for the \(\varOmega \) set are

$$\begin{aligned} w_n^\varOmega= & {} \frac{A^2}{2} \frac{{\bar{K}} \langle \gamma \rangle }{({\bar{K}}_n-1)^2+\gamma _n^2} \left[ \delta \gamma _n ({\bar{K}}_n -1) \nonumber \right. \\&\left. -\delta K_n ({\bar{K}}_n-1+\gamma _n /\langle \gamma \rangle )\right] ,\nonumber \\ w_n^\varGamma= & {} - \frac{A^2 }{2} \frac{\gamma _n K/ K_n}{({\bar{K}}_n-1)^2+\gamma _n^2} [ (K_n-1)^2 - \langle \gamma \rangle ^2 \delta \gamma _n \nonumber \\&+2 \delta K_n (\langle \gamma \rangle \gamma _n -{\bar{K}}_n+1) + (\delta K_n)^2 (1+\langle \gamma \rangle ^2) ] , \nonumber \\ w_n^F= & {} \frac{A^2 }{2} \frac{\langle \gamma \rangle }{({\bar{K}}_n-1)^2+\gamma _n^2} [({\bar{K}}_n-1)^2+\gamma _n^2\nonumber \\&-\delta \gamma _n ({\bar{K}}-1+\langle \gamma \rangle \gamma _n) \nonumber \\&+\delta K_n \gamma _n (1+\langle \gamma \rangle ^2)/\langle \gamma \rangle ] . \end{aligned}$$
(33)

Now, as a consequence of the approximations involved in our analytical approach to partial synchronization, \( w_n^\varOmega + w_n^\varGamma + w_n^F =0\) to the first order in \(\delta K_n\) only.

Figure 3 shows the quantities \(w_n^\varOmega \), \(w_n^\varGamma \) and \(w_n^F\) for the \(\varOmega \) set in the regime of partial synchronization. The first substantial difference with the case of full synchronization is that the rates of energy exchange are now much smaller (the vertical axes in the plots are amplified by a factor of \(10^8\)). This is due to the fact that, as implied by Eq. (22), oscillations have an amplitude of order K/N. As a consequence, for a given value of K, energy flow and dissipation are of order \(N^{-2}\).

However, the main feature in the rates of energy exchange for partial synchronization resides in their non-trivial dependence on both the friction coefficient \(\gamma _n\) and the coupling constant \(K_n\). The profile of the rate of energy dissipation (middle panel of Fig. 3) points to the existence of a resonance effect for \(K_n \approx 1\), which becomes enhanced as \(\gamma _n\) approaches zero. Mathematically, the sharp downward peak of \(w_n^\varGamma \) is a direct consequence of the denominator \(({\bar{K}}_n-1)^2+\gamma _n^2\) in Eq. (33), which is already present in the amplitude of individual departures from the \(\varOmega \) set, Eq. (24). This resonance can be traced back to the equation of motion (14) for the deviation \(\epsilon _n\) where, as demonstrated by the first term in the right-hand side, \({\bar{K}}_n\) plays the role of the squared natural frequency of \(\epsilon _n\). From the third term, meanwhile, we see that \(\epsilon _n\) is being forced harmonically by the \(\varOmega \) set, through its phase \(\varTheta \). This phase moves with unitary frequency as a collective response to the coupling with oscillator 1, which is in turn driven by the external excitation. In short, \(\epsilon _n\) behaves as a damped harmonic oscillator of squared frequency \({\bar{K}}_n\) subjected to an excitation of unitary frequency. Thus, it exhibits a resonance at \({\bar{K}}_n=1\). Because of their more complicated dependence on \({\bar{K}}_n\), the rates \(w_n^\varOmega \) and \(w_n^F\) exhibit a change of sign for \(K_n \approx 1\), with conspicuous extrema at each side, at least, for small \(\gamma _n\). This behavior resembles the dependence of the phase of oscillation near the resonance of a periodically forced, damped harmonic oscillator.

Fig. 3
figure 3

As in Fig. 2, for the regime of partial synchronization. Here, \({\bar{K}}=1\) and \(F=10^3\). For clarity in the representation, scales in the vertical axes are multiplied by a factor \(10^8\). Bright lines on the horizontal planes of the upper- and lowermost panels indicate the curves in the (\(K_n,\gamma _n\))-plane where \(w_n^\varOmega =0\) and \(w_n^F=0\), respectively

Fig. 4
figure 4

As in Fig. 3, for the regime of desynchronization. Here, \({\bar{K}}=1.1\) and \(F=10^{-2}\). For clarity in the representation, scales in the vertical axes are multiplied by a factor \(10^{12}\)

Finally, for the regime of desynchronization, we get

$$\begin{aligned} w_1^\varOmega= & {} - (N-1) \langle \gamma \rangle \left( \frac{A^2}{2} + \nu ^2 \right) , \nonumber \\ w_1^\varGamma= & {} -\gamma _1 \left( \frac{a_1^2 }{2} + \nu ^2 \right) , \nonumber \\ w_1^F= & {} \frac{A^2}{2} (N-1) \langle \gamma \rangle +\frac{a_1^2 }{2} \gamma _1 +\varGamma \nu ^2 , \end{aligned}$$
(34)

for oscillator 1, with \(a_1\), A, and \(\nu \) given by Eqs. (26) to (28), respectively. For the \(\varOmega \) set, in turn, we find

$$\begin{aligned} w_n^\varOmega= & {} -{\bar{K}}_n\frac{A^2}{2}\frac{\langle \gamma \rangle \delta r_n({\bar{K}}_n-1)+\gamma _n \delta K_n}{({\bar{K}}_n-1)^2+\gamma _n^2}\nonumber \\&-\langle \gamma \rangle \frac{K}{K_n}\delta r_n \nu ^2,\nonumber \\ w_n^\varGamma= & {} - \frac{A^2 }{2} \frac{\gamma _n K/ K_n}{({\bar{K}}_n-1)^2+\gamma _n^2}[({\bar{K}}_n-1)^2+\gamma _n^2\nonumber \\&+(\langle \gamma \rangle \delta r_n)^2+( \delta K_n)^2 \nonumber \\&+\gamma _n \langle \gamma \rangle \delta r_n - ({\bar{K}}_n-1) \delta K_n ] -\gamma _n \frac{K}{K_n} \nu ^2, \nonumber \\ w_n^F= & {} \frac{A^2}{2} \langle \gamma \rangle \left[ 1 + \frac{\gamma _n \langle \gamma \rangle \varDelta r_n-\delta \gamma _n ({\bar{K}}_n-1)+\gamma _n \delta K_n/\langle \gamma \rangle }{({\bar{K}}_n-1)^2+\gamma _n^2} \right] \nonumber \\&+\frac{K}{K_n}\nu ^2 (\langle \gamma \rangle \delta r_n + \gamma _n) \end{aligned}$$
(35)

with \(\delta r_n \equiv \delta K_n - \delta \gamma _n\). Now, \( w_n^\varOmega + w_n^\varGamma + w_n^F =0\) to the first order in \(\delta K_n\) and \(\delta \gamma _n\).

Figure 4 shows our analytical and numerical results for the regime of desynchronization in the \(\varOmega \) set. With respect to the regime of partial synchronization, the rates of energy exchange have diminished further, due to the much smaller intensity of the external forcing; cf. Eqs. (26) and (27). Otherwise, the overall behavior of \(w_n^\varOmega \), \(w_n^\varGamma \) and \(w_N^F\) is similar to that of partial synchronization. Namely, the rate of energy dissipation by friction (middle panel) exhibits a resonance peak for \(K_n\approx 1\) and \(\gamma _n \approx 0\), while \(w_n^\varOmega \) and \(w_n^F\) show a change of sign near \(K_n =1\), with a maximum and a minimum at each side. The origin of this resonance lies again in the dynamics of the individual deviations with respect to the \(\varOmega \) set, Eq. (14). Indeed, the collective average motion of the ensemble, now added with oscillator 1 and forced with unitary frequency from outside the system, acts as an excitation over each oscillator, inducing larger responses when the individual frequencies are closer to that of the external force.

5 Discussion and conclusion

We have studied the stationary collective dynamics of an ensemble of coupled mechanical phase oscillators subjected to an external harmonic excitation applied to one of the oscillators, and to friction forces. Heterogeneity in the system is given by different individual moments of inertia and friction coefficients. Our attention was focused on finding the rates at which energy is added from the external excitation and transferred between different parts of the ensemble, and the power dissipated by friction. To this end, we have proposed a series of approximations that allowed for analytical treatment of the equations of motion. Three regimes of collective motion were characterized, with different degrees of entrainment with the external excitation. Our approximations were validated by comparison of the rates of energy exchange derived from analytical results and from numerical integration of the equations of motion in the three regimes.

When the external excitation is sufficiently strong, the ensemble becomes fully synchronized with the excitation and follows it rigidly. Even in this very simple form of coherent motion, the rate of energy exchange between the oscillators not directly connected to the excitation varies its sign depending on how the individual moments of inertia and friction coefficients differ from their average values over the ensemble.

Collective motion becomes richer when the entrainment with the external excitation is weaker, as we have shown in the regimes of partial synchronization and desynchronization. In these cases, the main dynamical feature is a resonance effect in which individual oscillators respond to the overall motion of the ensemble, which is in turn driven –but not completely entrained– by the excitation. Superimposed to the uniform drift of its phase, each element performs an oscillation whose specific frequency is controlled by its moment of inertia. Resonance occurs when this individual frequency approaches the frequency of the external harmonic forcing. In this situation, first, the power dissipated by friction increases abruptly when the friction coefficient decreases, as a consequence of the growth in amplitude of individual oscillations. At the same time, the individual rates of energy exchange between oscillators and with the external excitation switch their sign across the resonance. In other words, the flow of energy from each oscillator is positive or negative depending of its moment of inertia being above or below the average.

These results show, in a simplified scenario, how energy exchange between different parts of a system formed by coupled mechanical oscillators can be manipulated by tuning individual parameters, impacting on the overall dynamics of the ensemble. Although obtained within a theoretical context, such conclusions may be relevant to the design and operation of technological devices based, for instance, on fast damping for rapid switching between different functional regimes [6, 9] or where, on the contrary, sustained oscillatory motion at low dissipation rates is required [8, 10, 15].