1 Introduction

Opinions are mental representations of the individual’s beliefs, constructed by inference processes mostly done with incomplete information. We are interested on the process of opinion formation in a population of individuals, represented by a set of agents \(\{a:1\le a\le M\},\) interacting within a society where there are some rules (also represented by an agent, B) that determine whether a social issue (represented by \({\textbf{S}}\)) is socially acceptable or not. We say that the label B assigns to an issue \({\textbf{S}}\) is \(\sigma _{B}({\textbf{S}})\) that is either 1 (acceptable, legal, fashionable) or \(-1\) (not acceptable, illegal, unfashionable). In similar way we state that the opinion of individual a on issue \({\varvec{S}}\) is \(\sigma _{a}({\textbf{S}})\), either 1 or \(-1.\) Modeling opinions with binary variables [1] is consistent with the observation that most people opt for one out of two opposite positions while answering questions with high social impact [2].

In the presented scenario we understand the opinion formation process in agent a as the process where a learns how to classify issues \({\textbf{S}}\) like B (otherwise a wouldn’t know how to behave properly in the society ruled by B). If the agents are rational (i.e., Bayesian [3]) two noninteracting agents should, upon receiving the same complete information, reach the same opinion, disregarding their priors (see Ref. [4], Theorem 1). Therefore, a model of the opinion formation process of rational agents in a society with rules must consider an interaction mechanism between agents as a means for the emergence of different social positions [5,6,7,8,9,10,11,12,13,14]. There is a body of evidence supporting the effect of social influence on opinion formation process [15,16,17,18,19,20,21]; as a consequence, to model the agents’ interactions, we follow social impact theory [22, 23] assuming that the interaction between an agent and its neighbors has a strength proportional to the credibility, number and proximity of the neighbors to the agent [24,25,26] (see Sect. 2 for details).

There are several studies on the effects of external influences on the opinion formation process in voters models [27, 28] and the influence of adverts on the formation of opinions [29]; in particular in Refs. [30, 31] it is concluded that, given a particular measure, periodic advert campaigns are the most effective. Therefore, we increase the complexity of our model by adding a (small) periodic term to the interaction of the agents with the society as a whole, to emulate the effects of an advert campaign in favor of the position hold by B. Keeping the magnitude of this term smaller than the magnitude of the typical inter-agent interaction allows us to characterize the advert campaign as a perturbation.

In recent a works [32, 33] we introduced the above-mentioned concepts to explain the opinion formation process in a society of interacting agents where there is a rule B that indicates the social position. The social position, originally supposed to be fixed, was allowed to evolve [34], and then reinforced by a perturbation (i.e. an added term, small in magnitude when compared with the strength of other interactions) representing an official publicity campaign [35]. In the present article we complete this effort by studying the effects of delay of information in the interaction between agents.

Models for opinion formation process consider inter-agent interactions as means for the emergence of different social positions. The model we present in this article differs from the classical Deffuant model of opinion dynamics [36, 37], where the interaction between voters takes place if the difference between the variables that indicate the opinions of the interacting agents is bellow a given threshold (bounded confidence model). In our model the interaction is between connected neighbors that learn to have an opinion; the stronger the connection the larger the influence peers have in the local neighborhood, opening the possibility for the emergence of local consensuses opposed to the social status quo. Our model differs also from models that consider opinions as continuous variables [38, 39]; the evolution of the connections between agents [40,41,42] has not been considered either.

Several opinion formation models consider a time delay in the macroscopic description of the system [43,44,45,46] for instance as a means to describe a mechanism for observed instabilities in the dynamics of democratic political systems [47,48,49]. In the present model, interactions are based on the perception agents have on past positions of their neighbors, which motivates the introduction of a time delay \(\tau \). We expect this approach to be also analytically tractable, thus facilitating a more direct and thorough analysis.

The article is organized as follows. In Sect. 2 we discuss our model and we present the differential equations that rule the time evolution of the parameters of the system. The derivation of the set of differential equations can be found in Appendix A. By building on the results presented in Appendix B, we solve the system of differential equations for constant (zero frequency) and periodic (non-zero frequency) perturbations in Sect. 3. This enables us to plot the phase diagram of the system, based on the amplitude of the perturbation and the initial condition for the most conservative agent. We present our final discussions in Sect. 4.

2 The Model

Let us suppose we have a population of M agents \(\{a\}_{a=1}^{M},\) living in a society with a set of rules B, also represented as an agent. We represent the topology of the society by a directed graph \({\varvec{G}}=\{\{a\},\{\eta _{a,b}\}\}\) where \(\{a\}\) is a set of vertexes associated with the agents and \(\{\eta _{a,b}\}\) is a set of strengths \(\eta _{a,b}\) that represent the influence of agent b on agent a. Self-influence effects are neglected, i.e. \(\eta _{a,a}=0.\) The neighborhood of a is defined as \({\mathbb {N}}_{a}=\{c\in [M]:\eta _{a,c}>0\}\) [2].

B determines whether a social issue \({\textbf{S}}\in \{-1,+1\}^{N}\) is acceptable \(\sigma _{B}({\textbf{S}})=1\) or not \(\sigma _{B}({\textbf{S}})=-1.\)Footnote 1 With the end to give an internal structure to the opinion variables and to make the mathematical description of the system tractable we provide the agents (a and B alike) with a perceptron [50]. In this form we introduce an adaptive, cognitive mechanism for the formation of opinions [51,52,53,54]. Each perceptron is characterized by an internal representation vector (\(\textbf{B}\in {\mathbb {R}}^{N}\) for the social rule \(\textbf{J}_{a}\in {\mathbb {R}}^{N}\) for the agents) such that the labels become \(\sigma _{B}(\textbf{S})=\textrm{sgn}(\textbf{B}\cdot \textbf{S})\) and the opinions become \(\sigma _{a}(\textbf{S})=\textrm{sgn}(\textbf{J}_{a}\cdot \textbf{S}),\) where \({\textbf{V}}\cdot {\textbf{S}}\equiv \sum _{i=1}^{N}V_{i}S_{i}\) for all \(\textbf{V}\in {\mathbb {R}}^{N}\), and \(\textrm{sgn}(x)=1\) if \(x>0\), \(-1\) if \(x<0\), and 0 if \(x=0\).Footnote 2

In the current scenario we consider all internal representations, \(\textbf{B}\) and \(\{\textbf{J}_{a}\}\), to evolve over time. To make the evolution happen we consider the sampling \({\mathbb {S}}=\{(\sigma _{B,n},\sigma _{{\mathbb {N}}_a,n},{\textbf{S}}_n))\}_{n=1}^{T}\), where \(\sigma _{B,n}=\textrm{sgn}(\textbf{B}\cdot \textbf{S}_n)\), \(\sigma _{{\mathbb {N}}_a,n}=\{\sigma _c({\textbf{S}}_{n-m}):c\in {\mathbb {N}}_a\}\) is the information agent a receives from its neighbors, with a delay \(m<n\), \(\textbf{S}_n\) belongs to \(\{-1,+1\}^{N}\) and it has been drawn according to the probability \({\mathcal {P}}({\textbf{S}})=\prod _{j=1}^{N}{\mathcal {P}}(S_{j})=\prod _{j=1}^{N}\{\frac{1}{2}\delta _{S_{j},+1}+\frac{1}{2}\delta _{S_{j},-1}\}.\) The symbol \(\delta _{A,B}=1\) if \(A=B\) and 0 otherwise, is the Kronecker delta. We are assuming that the entries of the vectors \({\textbf{S}}\) are independent and identically distributed (iid) variables with the same probability to have the value \(+1\) or \(-1\). The length of the sampling \({\mathbb {S}}\) is typically assumed to be \(T=\alpha N\) where \(\alpha \in {\mathbb {R}}\) is independent of N.

In an online scenario, elements of the sampling \({\mathbb {S}}\) are taken one at a time, applied to the internal-representation update algorithms, and then discarded. The update algorithms for the internal representations of \(\{a\}\) and B are:

$$\begin{aligned} {\textbf{J}}_{a,n+1}= & {} {\textbf{J}}_{a,n}+\psi _{a,n}\frac{\sigma _{B,n}\mathbf {S_n}}{\sqrt{N}}+ f_n\frac{\vert {\textbf{J}}_{a,n}\vert }{\sqrt{N}}\sqrt{\frac{1+R_{a,n}}{N(1-R_{a,n})}}P_n{\varvec{b}}_n\end{aligned}$$
(1)
$$\begin{aligned} {\textbf{B}}_{n+1}= & {} {\textbf{B}}_n+\frac{\lambda _o}{\sqrt{N}}f_n{\textbf{L}}_n, \end{aligned}$$
(2)

where \(\psi _{a,n}\) is the learning amplitude, \(f_n\) is the annealing factor, \(R_{a,n}\) is the parameter we will use to describe the evolution of the system, and it is defined as:

$$\begin{aligned} R_{a,n}= & {} \frac{{\textbf{J}}_{a,n}\cdot {\textbf{B}}_n}{\vert {\textbf{J}}_{a,n}\vert \vert {\textbf{B}}_n\vert }, \end{aligned}$$
(3)

\(P_n\) is a suitable periodic function, \({\varvec{b}}_n\) is a vector of length one in the direction of \({\textbf{B}}_n\), \(\lambda _o\) is the rate of change of the rule B, and \({\textbf{L}}_n\) is the average projection of the vectors \(\{{\textbf{J}}_{a,n}\}\) onto the plane perpendicular to \({\textbf{B}}_n\). In order to facilitate the reading of this manuscript, we have left the full details for the development of the equations of motion from these update algorithms for Appendix A. Here, we will only make a mention about the learning amplitude \(\psi _{a,n}\) and the periodic function \(P_n\). The last term to the right-hand side of Eq. (1) corresponds to the modeling of the publicity campaign, that favors the increment of the \({\textbf{J}}_{a,n}\) in the direction of \({\textbf{B}}_n\). The magnitude of this term is small when compared to the second term, and given that \(P_n\) is periodic, this term is treated as a periodic perturbation (the perturbation character of this term is explicitly used in Sect. 3). The construction of the learning amplitude \(\psi _{a,n}\) is inspired from social impact theory [22, 23], and involves a corroboration mechanism [55, 56] done with delayed information from the neighbors.

The relevant parameter of the system is \(R_{a,n}\), defined in Eq. (3). This quantity is the projection of the normalized vector \({\textbf{J}}_{a,n}\) onto the direction of \({\textbf{B}}_n\), i.e. is the cosine of the angle \(\theta _{a,n}\) between \({\textbf{J}}_{a,n}\) and \({\textbf{B}}_n\), \(R_{a,n}=\cos (\theta _{a,n})\). It is also known as the overlap between the \({\textbf{J}}_{a,n}\) and \({\textbf{B}}_n\). \(R_{a,n}\) represents the level of agreement of agent a with the social rule B at time n. Following the techniques presented in Appendix A and considering the large N limit we finally obtain that, for a pair of interacting agents, the evolution of the agreement in continuous time is:

$$\begin{aligned} {\dot{R}}_{a}= & {} -\frac{\sum _{b\in {\mathbb {N}}_a}\eta _{a,b}-2}{2}(1-R_{a}^{2})+\lambda _{o}\sqrt{1-R_{a}^{2}}\nonumber \\+ & {} \left[ \frac{1}{2}\sum _{b\in {\mathbb {N}}_{a}}\eta _{a,b}\Theta ({\overline{R}}_{b}-R_{a})\left( \sqrt{1-R_{a}^{2}}{\overline{R}}_{b}-\sqrt{1-{\overline{R}}_{b}^{2}}R_{a}\right) +P(t)\right] \sqrt{1-R_{a}^{2}}.`\nonumber \\ \end{aligned}$$
(4)

In the case of only two interacting agents we have that

$$\begin{aligned} {\dot{R}}_{a}= & {} -\frac{\eta _{a,b}-2}{2}(1-R_{a}^{2})+\lambda _{o}\sqrt{1-R_{a}^{2}}+\nonumber \\+ & {} \left[ \frac{\eta _{a,b}}{2}\Theta ({\overline{R}}_{b}-R_{a})\left( \sqrt{1-R_{a}^{2}}{\overline{R}}_{b}-\sqrt{1-{\overline{R}}_{b}^{2}}R_{a}\right) +P(t)\right] \sqrt{1-R_{a}^{2}}. \end{aligned}$$
(5)

with

$$\begin{aligned} \frac{\textrm{d}V(R_{a})}{\textrm{d}R_{a}}=\frac{\eta _{a,b}-2}{2}(1-R_{a}^{2})-\lambda _{o}\sqrt{1-R_{a}^{2}}, \end{aligned}$$
(6)

and P(t) is the continuous time version of the periodic perturbation representing the publicity campaign in favor of B, and \({\overline{R}}_{b}=R_{b}(t-\tau )\) where \(\tau \) is the continuous-time delay. The equation for \(R_b\) is obtained by switching indexes a and b on Eq. (5).

According to [34] and given the constant \(\kappa _{o}\approx 1.12282,\) if the interaction \(\eta _{a,b}\) is chosen to be:

$$\begin{aligned} \eta _{a,b}=2(\kappa _{o}\lambda _{o}+1), \end{aligned}$$
(7)

the system described by Eq. (5) becomes bi-stable, with stable points at \(R_{a}=1\) and \(R_{a}=-\sqrt{1-\kappa _{o}^{-2}},\) i.e.

$$\begin{aligned} \left. \frac{\textrm{d}V}{\textrm{d}R_{a}}\right| _{R_{a}=1}= & {} \left. \frac{\textrm{d}V}{\textrm{d}R_{a}}\right| _{R_{a}=-\sqrt{1-\kappa _{o}^{-2}}}=0\end{aligned}$$
(8)
$$\begin{aligned} V(1)= & {} V\left( -\sqrt{1-\kappa _{o}^{-2}}\right) . \end{aligned}$$
(9)

\(R_{a}=1\) is the stable point at which the system converges if the agents, at the end of the opinion formation process, classify strings in agreement with B, and \(R_{a}=-R_{o}=-\sqrt{1-\kappa _{o}^{-2}}\) is the stable point at which the system converges if the agents classify strings mostly differently to B. Due to these properties, we dubbed these points as the conservative stable point and the non-conservative stable point respectively. In consequence the conservative basin is defined as the interval \((R_{o},1),\) and the non-conservative basin is the interval \((-1,R_{o}).\) A sketch of the phase space of this system is presented in Fig. 1.

Fig. 1
figure 1

Phase space representation for the system with potential (6), in the by-stable regime determine by the conditions (8) and (9)

Let us define \(\vert {\mathbb {N}}_{a}\vert \) as the cardinality of the set \({\mathbb {N}}_{a}\). By defining the population averages:

$$\begin{aligned} \nu\equiv & {} \frac{1}{M}\sum _{a=1}^{M}\vert {\mathbb {N}}_{a}\vert \end{aligned}$$
(10)
$$\begin{aligned} \eta\equiv & {} \frac{1}{M(M-1)}\sum _{a\ne b=1}^{M}\eta _{a,b}, \end{aligned}$$
(11)

and assuming that the fluctuations

$$\begin{aligned} \Delta \nu= & {} \sqrt{\frac{1}{M}\sum _{a=1}^{M}\vert {\mathbb {N}}_{a}\vert ^{2}-\nu ^{2}}\end{aligned}$$
(12)
$$\begin{aligned} \Delta \eta= & {} \sqrt{\frac{1}{M(M-1)}\sum _{a\ne b=1}^{M}\eta _{a,b}^{2}-\eta ^{2}}, \end{aligned}$$
(13)

are sufficiently small, the evolution of the agreement \(R_{a}\) of agent a, in the neighborhood \({\mathbb {N}}_{a}\), and effective interaction \(\nu \eta =(\kappa _{o}\lambda _{o}+1)\) is given by:

$$\begin{aligned} {\dot{R}}_{a}= & {} -\frac{\nu \eta -2}{2}(1-R_{a}^{2})+\lambda _{o}\sqrt{1-R_{a}^{2}}\nonumber \\{} & {} + \left[ \frac{\eta }{2}\sum _{b\in {\mathbb {N}}_{a}}\Theta ({\overline{R}}_{b}-R_{a})\left( \sqrt{1-R_{a}^{2}}{\overline{R}}_{b}-\sqrt{1-{\overline{R}}_{b}^{2}}R_{a}\right) +P(t)\right] \sqrt{1-R_{a}^{2}}. \end{aligned}$$
(14)

The objective of our investigation is to study the effects of a periodic perturbation on the opinion formation process in a community of interacting agents, when the system is in a bi-stable regime and the initial condition locates the agents in the basin of the stable non-conservative point \(-R_{o},\) and there is a time delay \(\tau \) in the communication between agents. For such a scenario we can translate the equation in overlaps (14) into an equation in phases: where \(\theta _{a}(0)\in (\phi _{o},\pi )\), \(\phi _{o}\equiv \arccos (R_{o})=1.0987(1),\) and \(P(t)\equiv \lambda _{o}Ap(\omega t)\ge 0\) is a periodic perturbation with amplitude \(\lambda _{o}A\) and frequency \(\omega \). By re-scaling the time \((1+\lambda _{o}\kappa _{o})t\rightarrow t\) and the frequency \((1+\lambda _{o}\kappa _{o})^{-1}\omega \rightarrow \omega \) we obtain:

$$\begin{aligned} {\dot{\theta }}_{a}=-\frac{1}{\nu }\sum _{c\in {\mathbb {N}}_{a}}\Theta (\theta _{a}-{\overline{\theta }}_{c})\sin (\theta _{a}-{\overline{\theta }}_{c})+\Lambda \left[ \kappa _{o}\sin \theta _{a}-1-Ap(\omega t)\right] , \end{aligned}$$
(15)

where \(\Lambda \equiv (1+\lambda _{o}\kappa _{o})^{-1}\lambda _{o}.\) The first term of the right-hand-side of (15) is the average interaction over the neighborhood of the agent, the second term is a perturbation mainly proportional to the rate of change of B.

In the phase description given by Eq. (15) the conservative basin is defined by \((0,\phi _{o})\) and the non-conservative basin by \((\phi _{o},\pi ).\)

3 Solution of the System (15)

3.1 Solution for the Perturbed System with Two Agents

The two-agent problem is the simplest case of interacting agents learning from the rule B. It has been observed in [35] that the agent with the smallest phase dictates the behavior of the system, in particular it is remarked that, when all the agents are initially in the non-conservative basin, it is sufficient to convince the most conservative (the one with the smallest initial phase) to direct them all to the conservative basin. We analyze here the two-agent problem in order to use the behavior of the agent with the smallest phase to explain the expected behavior of larger societies.

Let us consider the problem of two agents perturbed with a constant perturbation (or zero-frequency periodic perturbation) with initial conditions such that \(\theta _{<}=\min \{\theta _{a}(0),\theta _{b}(0)\}\in \left( \phi _{o},\pi -\phi _{o}\right) \) and \(\theta _{>}=\max \{\theta _{a}(0),\theta _{b}(0)\}\in \left( \theta _<,\pi \right) .\) Without lose of generality we assume that \(\theta _{>}=\theta _{a}(0)\) and \(\theta _{<}=\theta _{b}(0).\) Then, for all \(0<t<\tau \) we have that the evolution of the system is ruled by the equations:

$$\begin{aligned} {\dot{\theta }}_{a}= & {} \Lambda \left( \kappa _{o}\sin \theta _{a}-1\right) -\Theta (\theta _a-{\overline{\theta }}_b)\sin [\theta _{a}(t)-{\overline{\theta }}_b]-\Lambda A\end{aligned}$$
(16)
$$\begin{aligned} {\dot{\theta }}_{b}= & {} \Lambda \left( \kappa _{o}\sin \theta _{b}-1\right) -\Theta (\theta _b-{\overline{\theta }}_a)\sin [\theta _{b}(t)-{\overline{\theta }}_a]-\Lambda A, \end{aligned}$$
(17)

which can be simplified into

$$\begin{aligned} {\dot{\theta }}_{a}= & {} \Lambda \left( \kappa _{o}\sin \theta _{a}-1\right) -\sin [\theta _{a}(t)-\theta _{<}]-\Lambda A\end{aligned}$$
(18)
$$\begin{aligned} {\dot{\theta }}_{b}= & {} \Lambda \left( \kappa _{o}\sin \theta _{b}-1\right) -\Lambda A. \end{aligned}$$
(19)

Let us define \(\kappa _A\equiv (1+A)^{-1}\kappa _o\), and \(\phi _A\equiv \arcsin (\kappa _A^{-1})\). The numerical integration of (16) and (17) for values of the amplitude \(A>\kappa _o-1\) and initial condition \(\theta _<\in (\phi _o,\pi )\) or for values of the amplitude \(A<\kappa _o-1\) and initial condition \(\theta <\in (\phi _o,\phi _A)\), produce curves with a pattern similar to the one presented in Fig. 2. Observe that the integration of Eqs. (16) and (17) is valid until the correspondent phase crosses over \(\phi _o\), entering the basin correspondent to the stable point 0, where the correct equations to be used are obtained from (14).

Fig. 2
figure 2

Typical behavior of the solution of the numerical integration of the Eqs. (16) and (17) either for values of the amplitude \(A>\kappa _o-1\) and initial condition \(\theta _<\in (\phi _o,\pi )\) or for values of the amplitude \(A<\kappa _o-1\) and initial condition \(\theta <\in (\phi _o,\phi _A)\) Both curves approach 0 asymptotically after crossing over \(\phi _o\). For the definition of the time \(t_C\) see Eqs. (23) and (25)

For values of the amplitude \(A<\kappa _o-1\) and \(\theta _< \in (\pi -\phi _A,\pi )\) the general behavior of the numerical solution to (16) and (17) is represented in Fig. 3. In all cases the curves approach asymptotically \(\pi -\phi _A\).

Fig. 3
figure 3

Typical behavior of the solution of the numerical integration of the Eqs. (16) and (17) for values of the amplitude \(A<\kappa _o-1\) and initial condition \(\theta _< \in (\pi -\phi _A,\pi )\) Both curves approach \(\pi -\phi _A\) asymptotically

The integration of \(\theta _{b}\), Eq. (19), is straightforward:

$$\begin{aligned} \tan \frac{\theta _{b}}{2}= & {} \frac{\tan {\displaystyle \frac{\pi -\phi _{A}}{2}}\left| \tan {\displaystyle \frac{\phi _{A}}{2}}-\tan {\displaystyle \frac{\theta _{<}}{2}}\right| \textrm{e}^{\Lambda _{A}t}}{\left| \tan {\displaystyle \frac{\phi _{A}}{2}}-\tan {\displaystyle \frac{\theta _{<}}{2}}\right| \textrm{e}^{\Lambda _{A}t}-\left| \tan {\displaystyle \frac{\pi -\phi _{A}}{2}}-\tan {\displaystyle \frac{\theta _{<}}{2}}\right| }\nonumber \\{} & {} -\frac{\tan {\displaystyle \frac{\phi _{A}}{2}}\left| \tan {\displaystyle \frac{\pi -\phi _{A}}{2}}-\tan {\displaystyle \frac{\theta _{<}}{2}}\right| }{\left| \tan {\displaystyle \frac{\phi _{A}}{2}}-\tan {\displaystyle \frac{\theta _{<}}{2}}\right| \textrm{e}^{\Lambda _{A}t}-\left| \tan {\displaystyle \frac{\pi -\phi _{A}}{2}}-\tan {\displaystyle \frac{\theta _{<}}{2}}\right| } \end{aligned}$$
(20)

if \(\kappa _{A}>1,\theta _{<}\notin (\phi _{A},\pi -\phi _{A}),\)

$$\begin{aligned} \tan \frac{\theta _{b}}{2}= & {} 1+\frac{\tan {\displaystyle \frac{\theta _{<}}{2}}-1}{1+{\displaystyle \frac{\Lambda \kappa _{o}}{2}}t\left( \tan {\displaystyle \frac{\theta _{<}}{2}}-1\right) } \end{aligned}$$
(21)

if \(\kappa _{A}=1,\) and

$$\begin{aligned} \tan \frac{\theta _{b}}{2}= & {} \kappa _{A}+\sqrt{1-\kappa _{A}^{2}}\tan \left[ \mathrm {\arctan }\left( \frac{\tan {\displaystyle \frac{\theta _{<}}{2}}-\kappa _{A}}{\sqrt{1-\kappa _{A}^{2}}}\right) -\frac{\Lambda _{A}t}{2}\right] \end{aligned}$$
(22)

if \(\kappa _{A}<1,\) where \(\Lambda _{A}\equiv \Lambda \sqrt{\left| \kappa _{o}^{2}-(1+A)^{2}\right| }.\) Observe that in (20), we have explicitly avoided the discussion of the initial condition \(\theta _{<}\in (\phi _{A},\pi -\phi _{A}).\) The results presented correspond to an asymptotic decaying behavior. In particular, the phase \(\theta _{b}\) would cross over the conservative basin at time \(t_{C}\), i.e. \(\theta _{b}(t_{C})=\phi _{o},\) in the following cases:

$$\begin{aligned} \Lambda _{A}t_{C}= & {} {\displaystyle 2}\ln \left[ \frac{\left( {\displaystyle \tan }{\displaystyle \frac{\phi _{A}}{2}}-{\displaystyle \tan }{\displaystyle \frac{\phi _{o}}{2}}\right) \left( {\displaystyle \tan }{\displaystyle \frac{\pi -\phi _{A}}{2}}-{\displaystyle \tan }{\displaystyle \frac{\theta _{<}}{2}}\right) }{\left( {\displaystyle \tan }{\displaystyle \frac{\phi _{A}}{2}}-{\displaystyle \tan }{\displaystyle \frac{\theta _{<}}{2}}\right) \left( {\displaystyle \tan }{\displaystyle \frac{\pi -\phi _{A}}{2}}-{\displaystyle \tan }{\displaystyle \frac{\phi _{o}}{2}}\right) }\right] , \end{aligned}$$
(23)

if \(\kappa _{A}>1\;\textrm{and}\;\phi _{o}<\theta _{<}<\phi _{A},\)

$$\begin{aligned} \Lambda \kappa _{o}t_{C}= & {} {\displaystyle 2}\left( {\displaystyle \frac{1}{1-\tan {\displaystyle \frac{\theta _{<}}{2}}}}-{\displaystyle \frac{1}{1-\tan {\displaystyle \frac{\phi _{o}}{2}}}}\right) , \end{aligned}$$
(24)

if \(\kappa _{A}=1\;\textrm{and}\;\phi _{o}<\theta _{<}<\frac{\pi }{2},\) and

$$\begin{aligned} \Lambda _{A}t_{C}=2\left\{ \arctan \left( \frac{\tan {\displaystyle \frac{\theta _{<}}{2}}-\kappa _{A}}{\sqrt{1-\kappa _{A}^{2}}}\right) -\arctan \left( \frac{\tan {\displaystyle \frac{\phi _{o}}{2}}-\kappa _{A}}{\sqrt{1-\kappa _{A}^{2}}}\right) \right\} , \end{aligned}$$
(25)

if \(\kappa _{A}<1\;\textrm{and}\;\phi _{o}<\theta _{<}<\pi .\)

The cross-over time \(t_C\) is finite and only present if the amplitude A and the initial condition \(\theta _<\) are such that the agents, although initially in the non-conservative basin \((\phi _o,\pi )\) would cross over the conservative basin \((0,\phi _o)\) at times \(t\ge t_C\). If the amplitude \(A<\kappa _o-1\) and initial condition \(\theta _<>\phi _A\) the agent remain in the non-conservative basin. We present a density plot of \(t_{C}\) as a function of A and \(\theta _{<}\) in Fig. 4.

Fig. 4
figure 4

The cross-over time \(t_{C}\), given by Eqs. (23,25), as a function of the initial condition \(\theta _{<}\) and the amplitude A. The darker the color the shorter it takes for the agent with the lower phase to reach the cross-over point \(\phi _{o}.\) In the non-conservative region, defined for \(A<\kappa _o-1\) and \(\theta _<>\phi _A\), the cross-over time \(t_C\) is not defined (Color figure online)

The behavior of the phases that remain in the non-conservative basin is as follows: if \(A<\kappa _o-1\) and \(\pi -\phi _{A}<\theta _{<}\) the phases converge to \(\pi -\phi _{A}\) asymptotically. If \(A<\kappa _o-1\) and \(\phi _A<\theta _<<\pi -\phi _{A}\) the phases converge to \(\pi -\phi _{A}\) oscillatorily (see Fig. 5).

Fig. 5
figure 5

Oscillatory behavior of the solutions of Eqs. (16) and (17) for values of \(A<\kappa _o-1\) and \(\phi _A<\theta _<<\pi -\phi _A\). Both trajectories converge to \(\pi -\phi _A\). In the inset we have a detail for just a few oscillation cycles

The behavior in the area determined by \(\kappa _{A}>1\) and \(\phi _{A}<\theta _{<}<\pi -\phi _{A}\) can be approximated, following an argument similar to the one presented in Appendix B, by:

$$\begin{aligned} \theta _{a}(\tau t)\approx & {} x_{A}(\left\lfloor t\right\rfloor ;\theta _{a,0})\;\left[ 1-\textrm{mod}\left( \left\lfloor t\right\rfloor ,2\right) \right] +x_{A}(\left\lfloor t\right\rfloor ;\theta _{b,0})\;\textrm{mod}\left( \left\lfloor t\right\rfloor ,2\right) \end{aligned}$$
(26)
$$\begin{aligned} \theta _{b}(\tau t)\approx & {} x_{A}(\left\lfloor t\right\rfloor ;\theta _{a,0})\;\textrm{mod}\left( \left\lfloor t\right\rfloor ,2\right) +x_{A}(\left\lfloor t\right\rfloor ;\theta _{b,0})\;\left[ 1-\textrm{mod}\left( \left\lfloor t\right\rfloor ,2\right) \right] , \end{aligned}$$
(27)

where \(\left\lfloor t\right\rfloor \in {\mathbb {Z}}\) and \(\left\lfloor t\right\rfloor \le t<\left\lfloor t\right\rfloor +1\), and

$$\begin{aligned} \tan \frac{x_{A}(t;x_{0})}{2}= & {} \frac{{\displaystyle \tan \frac{\pi -\phi _{A}}{2}\left( \tan \frac{x_{0}}{2}-\tan \frac{\phi _{A}}{2}\right) }\textrm{e}^{\Lambda _{A}t}}{{\displaystyle \left( \tan \frac{x_{0}}{2}-\tan \frac{\phi _{A}}{2}\right) }\textrm{e}^{\Lambda _{A}t}+\tan {\displaystyle \frac{\pi -\phi _{A}}{2}-\tan {\displaystyle \frac{x_{0}}{2}}}}\nonumber \\{} & {} +{\displaystyle \frac{\tan {\displaystyle \frac{\phi _{A}}{2}}\left( \tan {\displaystyle \frac{\pi -\phi _{A}}{2}}-\tan {\displaystyle \frac{x_{0}}{2}}\right) }{{\displaystyle \left( \tan \frac{x_{0}}{2}-\tan \frac{\phi _{A}}{2}\right) }\textrm{e}^{\Lambda _{A}t}+\tan {\displaystyle \frac{\pi -\phi _{A}}{2}-\tan {\displaystyle \frac{x_{0}}{2}}}}}. \end{aligned}$$
(28)

These solutions are similar to the ones presented in Fig. 9. Observe that for sufficiently long times:

$$\begin{aligned} x_{A}(t;x_{0})\approx \pi -\phi _{A}-2\frac{1-\tan {\displaystyle \frac{\phi _{A}}{2}}}{1+\left( \tan {\displaystyle \frac{\pi -\phi _{A}}{2}}\right) ^{2}}\frac{\tan {\displaystyle \frac{\pi -\phi _{A}}{2}}-\tan {\displaystyle \frac{x_{0}}{2}}}{\tan {\displaystyle \frac{x_{0}}{2}}-\tan {\displaystyle \frac{\phi _{A}}{2}}}\textrm{e}^{-\Lambda _{A}t}, \end{aligned}$$
(29)

which indicates that the envelope (28) converges towards \(\pi -\phi _{A}\).

It is important to note that, in the absence of delay and by applying the observation that the order of the phases is preserved, i.e. if \(\theta _{<}=\theta _{b}(0)<\theta _{a}(0)=\theta _{>},\) then \(\theta _{b}(t)<\theta _{a}(t)\) for all t,  the phases of the undelayed system satisfy the following expressions \(\theta _{a(b)}(t)=x_{A}(t;\theta _{>(<)}).\) The fundamental difference between delayed and non-delayed systems for \(0\le A\le \kappa _{o}-1\) and \(\phi _{A}<\theta _{<}<\pi -\phi _{A}\) is that the relaxation time of the exponential decay in the delayed system is equal to the relaxation time of the undelayed system times \(\tau .\)

To illustrate this change of behavior we present the result of the integration of Eqs. (16) and (17) in Fig. 6 for unperturbed (\(A=0\)) systems. The dashed curve corresponds to a system without delay, the full curve corresponds to a system with a delay \(\tau =30,\) with \(\Lambda =0.01\) in both cases.

Fig. 6
figure 6

Integration of Eqs. (16) and (17) for a system without delay (dashed curve) and for a system with delay \(\tau =30.\) Both systems are unperturbed (\(A=0\)) and with \(\Lambda =0.01.\) Only the curves for \(\theta _a\) are presented

3.2 General Periodic Perturbation

Consider the system of equations at \(t<\tau \):

$$\begin{aligned} {\dot{\theta }}_{a}= & {} \Lambda \left( \kappa _{o}\sin \theta _{a}-1\right) -\sin [\theta _{a}(t)-\theta _{<}]-\Lambda Ap(\omega t)\end{aligned}$$
(30)
$$\begin{aligned} {\dot{\theta }}_{b}= & {} \Lambda \left( \kappa _{o}\sin \theta _{b}-1\right) -\Lambda Ap(\omega t), \end{aligned}$$
(31)

with \(\theta _{a}(0)=\theta _{>}\in (\phi _{o},\pi ),\) \(\theta _{b}(0)=\theta _{<}\in (\phi _{o},\pi -\phi _{o})\) and where \(p(\omega t)\) is a periodic function with period \(2\pi /\omega ,\) satisfying that \(0\le p(\omega t)\le 1\) for all t. Let as suppose that we can expand the perturbation in the following way:

$$\begin{aligned} p(\omega t)=\sum _{\ell =0}^{\infty }b_{\ell }\cos \left( \ell \omega t\right) , \end{aligned}$$
(32)

therefore we can compute the average perturbation as:

$$\begin{aligned} {\overline{p}}(\omega )\equiv & {} \frac{1}{\tau }\int _{0}^{\tau }\textrm{d}s\,p(s)=b_{0}+\sum _{\ell =1}^{\infty }b_{\ell }\,\textrm{sinc}(\ell \omega \tau ), \end{aligned}$$
(33)

where

$$\begin{aligned} \textrm{sinc}(x)\equiv \frac{\sin (x)}{x}. \end{aligned}$$
(34)

\({\overline{p}}(\omega )\) approaches \(b_{0}\) for sufficiently large values of the frequency \(\omega .\) Therefore, we can obtain a crude estimate of the agent’s behavior by approximating the system formed by Eqs. (30) and (31) by:

$$\begin{aligned} {\dot{\theta }}_{a}= & {} \Lambda \left( \kappa _{o}\sin \theta _{a}-1\right) -\sin [\theta _{a}(t)-\theta _{<}]-\Lambda A{\overline{p}}(\omega )\end{aligned}$$
(35)
$$\begin{aligned} {\dot{\theta }}_{b}= & {} \Lambda \left( \kappa _{o}\sin \theta _{b}-1\right) -\Lambda A{\overline{p}}(\omega ). \end{aligned}$$
(36)

We observe that the phase diagram of the system in the plane \((\theta _{<},A),\) where \(\theta _{<}\) is the initial condition of the initially smallest phase and A is the amplitude of the perturbation, is presented in Fig. 7 a). There are three different behaviors in the system, depending on the values of the parameters \(\theta _{<}\) and A. The system may decay towards the conservative fixed point \(\theta =0\) (a), or decay to the non-conservative point \(\theta =\pi -\phi _{A}\) in a monotonous way, (e) and (c), or oscillatory way, (b) and (d). Region (b) corresponds to a perturbation \(p(\omega t)=1\) (or zero frequency limit). Region (d) corresponds to a perturbation with a very high frequency (\(\omega \rightarrow \infty \)). Observe that this region is obtain by scaling the vertical axis \(A\rightarrow A/b_{0},\) where \(b_{0}\) is the high-frequency limit of the average (33). Perturbations with finite values of \(\omega \) would produce a phase diagram with an oscillatory behavior region in between regions (b) and (d).

The line separating regions (a) and (b) is given by \(\kappa _{o}\sin \theta _{0}-1-A=0\), the one separating regions (b) and (c) is given by \(\kappa _{o}\sin (\pi -\theta _{<})-1-A=0.\) Equivalently, the line separating regions (a) and (d) is given by \(\kappa _{o}\sin \theta _{<}-1-Ab_{0}=0\), the one separating regions (d) and (e) is given by \(\kappa _{o}\sin (\pi -\theta _{0})-1-Ab_{0}=0.\) In Fig. 7b) we present the distribution of unstable fixed points (dashed lines) and stable points (full line) in a system with a perturbation of frequency \(\omega \), that fixes the value of the parameter \(a_{0}\in (0,b_{0}).\) The arrows indicate the direction of evolution of the system at constant A,  from \(\theta (0)=\theta _{<}\) to \(\theta (\infty )=0\) or \(\pi -\phi _{A}.\)

Fig. 7
figure 7

(a Phase diagram for the system described by Eqs. (35) and (36) in the plane \((\theta _{<},A).\) There are three different behaviors in the system, depending on the values of the parameters \(\theta _{<}\) and A. The system may decay towards the conservative fixed point (a), decay inside the non-conservative basin (e) and (c) or present an oscillatory decay towards the non-conservative fixed point (b) and (d). Region (b) corresponds to a perturbation \(p(\omega t)=1\) (or zero frequency limit). Region (d) corresponds to a perturbation with a very high frequency (\(\omega \rightarrow \infty \)). Observe that this region is obtain by scaling the vertical axis \(A\rightarrow A/b_{0},\) where \(b_{0}\) is the high-frequency limit of the average (33). Perturbations with finite values of \(\omega \) would produce a phase diagram with an oscillatory behavior region in between regions (b) and (d). The line separating regions (a) and (b) is given by \(\kappa _{o}\sin \theta _{0}-1-A=0\), the one separating regions (b) and (c) is given by \(\kappa _{o}\sin (\pi -\theta _{<})-1-A=0.\) Equivalently, the line separating regions (a) and (d) is given by \(\kappa _{o}\sin \theta _{0}-1-Ab_{0}=0\), the one separating regions (d) and (d) is given by \(\kappa _{o}\sin (\pi -\theta _{<})-1-Ab_{0}=0.\) b) The fixed points of the system are represented by the dark dashed lines (unstable points) and by the grey (orange on line) thick lines (stable points). The arrows indicate the direction of flow, at constant A, for a given value of the initial condition \(\theta _{<}.\) The number \(a_{0}\in [b_{0},1]\) depends on the frequency of the perturbation (Color figure online)

Observe that the previous analysis is based on the values of the effective amplitude of the perturbation (\(A{\overline{p}}(\omega )\)) and the initial position of the smallest phase \(\theta _{<}\). Following [35] we hypothesize that the phase space presented in Fig. 7 is also valid for a system with \(M>2\) interacting agents.

It is also important to note that, in the analysis presented in [35], the parameter consider is the expected value of the smallest initial phase, which is a parameter drawn from a distribution that depends on M. In that scenario, the larger the number of agents M the closer the initial smallest phase to the instable point \(\phi _{o},\) and therefore the smallest the minimal amplitude of the perturbation A to convince the most conservative agent to cross over the boundary between basins. In the present scenario, the parameter considered is the smallest initial phase \(\theta _{<}\) itself. In this manner, the analysis we present here corresponds to all possible values of the parameters \(\theta _{<}\) and A, not the most likely ones. Finally, the approach presented in [35] considers a smooth, periodic perturbation \(\nu (t)\), with at least two continuous derivatives and satisfying the constraints \(\nu (0)={\dot{\nu }}(0)=0.\) In the present approach we cannot consider such constraints because would render meaningless the analysis of the constant perturbation (\(\omega =0\)).

3.3 Study of the Oscillatory Phase Under a General Periodic Perturbation

In this section we focus on the solution to the system of differential Eqs. (30) and (31) with an initial condition such that \(\phi _{A}<\theta _{<}<\pi -\phi _{A}.\) In this case we have an oscillatory decay towards an asymptotic non-conservative behavior. In particular we want to explore the dependency of the critical amplitude (\(A_{C}\)) on the frequency of the perturbation \(\omega .\) The critical amplitude is the value of A over the line separating the regions (a) and (d) in Fig. 7.

With this end we propose a perturbative solution to (30) and (31) of the form \(\theta _{a(b)}(t)=\theta _{a(b)}(t;A=0)+A\delta _{a,b}(t),\) where the \(\theta _{a(b)}(t;A=0)\) are given by (26) and (27). The equations for the \(\delta _{a(b)}\) are

$$\begin{aligned} {\dot{\delta }}_{a(b)}= & {} -\left[ 1-\Lambda \kappa _{0}\cos \theta _{a(b)}\right] \delta _{a(b)}+{\overline{\delta }}_{b(a)}-\Lambda p(\omega t), \end{aligned}$$
(37)

and their solution can be approximated by the expression:

$$\begin{aligned} \delta _{a(b)}(t)\approx & {} -\Lambda (n+1)\sum _{\ell =0}^{\infty }b_{\ell }\left| \frac{\textrm{sinc}\left[ \frac{n+1}{2}(\ell \omega \tau +\phi _{\ell })\right] }{\textrm{sinc}\left[ \frac{1}{2}(\ell \omega \tau +\phi _{\ell })\right] }\right| \cos \left( \ell \omega t-\Psi _{\ell ,n}\right) ,\end{aligned}$$
(38)
$$\begin{aligned} \Psi _{\ell ,n}\equiv & {} \phi _{\ell }+\frac{n}{2}(\ell \omega \tau +\phi _{\ell }) \end{aligned}$$
(39)

where \(\phi _{\ell }\equiv \arctan (\ell \omega )\) and \(n\equiv \left\lfloor t/\tau \right\rfloor .\) Observe that \(\delta _{a(b)}\) is identical for all agents (independent of the index a(b)) and it presents a strong correlation with modes associated with the natural frequency of the system (\(\Omega =\pi /\tau \)). To illustrate this point we present a plot of \(A_{C}(\omega )\) for the perturbation \(p(\omega t)=\frac{1}{2}-\frac{1}{2}\cos (\omega t)\) in Fig. 8.

Fig. 8
figure 8

Critical amplitude \(A_{C}\) as a function of the frequency \(\omega \) (in units of \(\pi /\tau \)) for the perturbation \(p(\omega t)=\frac{1}{2}-\frac{1}{2}\cos (\omega t)\)

4 Discussion

We analyzed the effects of a perturbation on the opinion formation process in a population of adaptive agents. The scenario considered is anisotropic since the agents interact with a set of rules B that determine the socially acceptable position. It was also assumed that the perception an agent had on a peer’s position about a social issue may not be up to date, hence a time delay \(\tau \) was considered. A periodic perturbation was added to the model to mimic the action of a publicity campaign in pro of the official position represented by B.

In the microscopic model we chose to represent the internal state of the agents by a perceptron that is trained with a Hebbian algorithm (40). The rule B was also represented by a perceptron that learns from the average public opinion (44). By applying statistical mechanics techniques and the Markov approximation we obtained the large system-size limit of these equations. The dynamical system ruled by the differential equations so obtained presents two stable points, one that represents the conservative position agents express when mostly follow B,  and other, dubbed non-conservative, that represents the attitude of agents following their peers.

By setting the system parameters in such a way that the conservative and non-conservative fixed points are equally likely (bi-stable regime), we studied the time evolution of the system of delayed differential equations (15) representing the process of opinion formation, under the action of a small periodic perturbation representing an official publicity campaign. The initial conditions set for most of this study locate the agents in the basin of attraction of the non-conservative point.

We found out that the perturbed system presents three different behaviors, depending on the values of the initial condition of the smallest phase \(\theta _{<}\), and the value of the perturbation’s amplitude A. For small values of \(\theta _{<}\) and sufficiently large A the system decays towards the conservative fixed point, for sufficiently large \(\theta _{<}\) and sufficiently small A the system decays towards the non-conservative fixed point, and for intermediate values of \(\theta _{<}\) and sufficiently low values of A the system presents damped oscillations that decay towards the non-conservative point. The time the system needs to cross-over to the conservative basin, Eqs. (2325) is presented in Fig. 4. The emergence of this oscillatory behavior for \(A<\kappa _{o}-1\) and \(\phi _{A}<\theta _{<}<\pi -\phi _{A}\) is due to the presence of the delay in the exchange of information between peers. The presence of this delay increases the relaxation time towards the fixed point \(\pi -\phi _{A}\) by a factor of \(\tau .\)

The frequency of the perturbation produces quantitative changes in the phase diagram of the system, without altering the qualitative distribution of the regions (see Fig. 7). We also observe that the perturbations consider in this approach are different from the periodic perturbation \(\nu (t)\) considered in [35], which satisfy the constraints \(\nu (0)={\dot{\nu }}(0)=0.\) Such constraints were imposed to permit the relaxation at short times in the low frequencies regime. In our present approach we make use of the constant perturbation as the limit of a very low frequency. Is the perturbation is initially zero, it should remain so in the limit of the frequency going to zero, rendering our analysis meaningless.

The asymptotic behavior observed on the non-conservative phases can be represented by a monotonous decay towards \(\pi -\phi _{A}\) for \(\kappa _{A}>1\) and \(\theta _{<}>\pi -\phi _{A}\) (region (c)-(e)) and by an oscillatory decay towards \(\pi -\phi _{A}\) for \(\kappa _{A}>1\) and \(\phi _{A}<\theta _{<}<\pi -\phi _{A}\) (region (b)-(d)), thus, the transition from phase (b)-(d) to (c)-(e) can be characterized by the value of the imaginary part of the exponent, responsible for the oscillations of period \(2\tau \) observed in region (b)-(d). This is not a phase transition in the sense that there is a non-analyticity in the free energy of the system (which has not been defined) but a change in the asymptotic behavior of the system.

The role played by the parameter \(\Lambda \), which has absorbed the parameter \(\lambda _{o}\) that controls the update of the rule B through the wisdom-of-the-crowd effect, is to provide a suitable scale to the relaxation and oscillation processes studied [Eqs. (2325), (26) and (27)], without changing the asymptotic values reached by the average agreement \(R_{a}\). If no update rule on B is considered (\(\lambda _{o}=0\)), the four fixed points of the potential (6) get reduced to two (see Ref. [32]) and the complexity of the dynamical processes analyzed is lost.

Interactions among spatially distributed agents are subjected to a time delay. Any physical interaction propagates at a finite speed. The most salient effect of the time delay in the agent-agent interaction is observed in the phase-space region where \(\phi _{A}<\theta _{<}<\pi -\phi _{A}.\) In this region the system oscillatory decays towards the non-conservative point. As it is shown in Fig. 6, the presence of the delay retards the decay towards the correspondent fixed point. Similar effects have been observed in [46].

Our model, in its current form, is related to the scenario presented in [57], where an analysis on an anti-drug campaign focussed on adolescents is presented. In our model B represents the government, the agents are the school attending teenagers, and the issues opinions are formed over is the use of drugs. It was found that exposure to social interaction about campaign messages can affect behavior, and such interactions are favored if the intensity of the campaign is not perceived as oppressive (low A in our model).

Finally, we presented a short analysis of the perturbative solution to the system with a perturbation \(p(\omega t)=\frac{1}{2}[1-\cos (\omega t)].\) The value of the critical amplitude \(A_{C}\) has been numerically computed as a function of \(\omega \) an plot in Fig. 8. We observe that \(A_{C}(\omega )\le \lim _{\omega \rightarrow \infty }A_{C}(\omega )=A_{C}(0)/b_{0}\), thus partially validating the phase diagram presented in Fig. 7.