1 Introduction

Social sciences, such as sociology, demography, and economics, show paradigmatic aspects of complex phenomena, in which nonlinear social interaction between human individuals or groups play a fundamental role [13]. Examples include populations migrations, emergence of social clashes, market instability in non-equilibrium economics and collective opinion formation [4, 5]. Opinion formation of individuals is a typical example that can be examined and investigated by means of suitable mathematical models. Generally speaking, this subject is concerned with understanding social-political phenomena through the use of analytic models which, it is hoped, lend insight into why outcomes look the way they do and not some other way. Examples of such phenomena include which parties or candidates are elected at certain times, and how a structured society orients its opinion with respect to a specific issue.

The literature relating the modeling approaches of the above mentioned issues is pretty diversified, ranging from application of methods from statistical mechanics [6], nonlinear dynamics [7] and agent-based network modeling [8]. Among other approaches, modeling based on kinetic theory has proven particularly useful in depicting nonlinear issues related to the complexity of social phenomena [9, 10]. In this paper we introduce a model of formation and evolution of opinions based on the kinetic theory of active particles (KTAP). Such a theory provides a general mathematical structure enabling the derivation of models of large systems of interacting entities characterized by their ability to express strategies toward the reaching of specific goals. The KTAP received a general version relative to linearly additive interactions, along with various applications, in [11], whereas an extension to non-additive and non local interactions, modeled by methods of the stochastic game theory, is presented in [1214]. The KTAP has revealed useful in the modeling of vehicular traffic, pedestrian crowds, swarms and flocking and of biological systems, including their evolutive aspects [1518], as well as on the modeling of social and political phenomena [1921]. We refer to [1] for a comprehensive and updated bibliography.

The aim of this paper is to introduce a model of formation and evolution of opinions based on the KTAP. The paper is organized as follows. In Sect. 2 we introduce the basic mathematical structure of the KTAP. In Sect. 3 we specialize the previously introduced structure to the case of opinion formation, writing down a model of structured populations whose opinions concerning a given issue evolve according nonlinear interactions among individuals inspired to stochastic game theoretical tools. In Sect. 4 we furnish the outcomes of numerical experiments that, though referred to a purely model situation not related with real data, are anyhow able to enlighten the response of the method under controlled specific circumstances. Finally, Sect. 5 contains general issue concerning in-progress refinements and generalization of the present modeling approach.

2 Mathematical structure

The KTAP is concerned with modeling of large populations of interacting individuals that show aspects characteristic of complexity. Though there is not a universally accepted definition of complexity, the different existing ones share a number of common issue [22, 23]. Among others, the ability of individuals to express a strategy, the emergence of collective behaviors, a dynamics presenting large deviations characterized by fluctuations and loss of stability. Such issues are intimately related with nonlinear and nonlinearly additive interaction rules, with time-evolving dependence, and possibly with multiscale (microscopic-macroscopic) aspects.

In the KTAP, the overall state of a system made up by a large number of interacting individuals, called active particles, is described by the distribution function \(f(t,\mathbf{x},\mathbf{v},\mathbf{u})\), where \(t\) is the time, \(\mathbf{x}\) and \(\mathbf{v}\) are respectively the position and velocity, and where \(\mathbf{u}\) is a (possibly vector-valued) variable, termed activity, that summarizes the non-mechanical state of the individuals (e.g., biological, social, etc.). All together, the variables \(\{\mathbf{x},\mathbf{v},\mathbf{u}\}\) represent the microscopic state of active particles [24]. The relevance of the mechanical components \(\mathbf{x}\) and \(\mathbf{v}\) of the microstate depends upon the specific issue. Actually, in opinion formation modeling the velocity \(\mathbf{v}\) of active particles does not play any significant role, while the spatial variable \(\mathbf{x}\) can be aggregated in such a way that the probability distribution assumes the form \(f_i(t,\mathbf{u})\), where the time \(t\in [0,T)\), \(T>0\), the activity \(\mathbf{u}\in D_{\mathbf{u}}\) and the index \(i=1,\ldots ,n\), \(n>1\), represents the nodes where we assume the interacting entities are localized.

In order to manage the complexity of the phenomena treated, in the KTAP the overall system is partitioned into functional subsystems whose elements share one or more distinctive characters of their attitude (social, biological, etc.). For example, in the modeling of immune response the cells belonging to the same subsystems might have the ability to react to the same antigens. In the present approach to modeling of opinion formation the functional subsystems collect together individuals that collectively share a common general orientation with respect to a specific issue. More specifically, the activity \(\mathbf{u}\) is meant as a set \(u_{j}\in [0,1]\), \(j=1,\ldots ,m\), \(m\ge 1\), where the index \(j\) labels the mainstream orientation of each functional subsystem while, for each fixed \(j\), \(u_j\) describes the fine social attitude of individuals. According to this scheme, the overall systems will be characterized by a set of distribution functions \(f_{ij}(t,u)\), where \(f_{ij}(t,u)du\) is the number of active particles belonging to the \(i\)-th node (spatial property), \(j\)-th functional subsystem (collective orientation) in the elementary microstate volume \(u,u+du\). The active particles are in general allowed to interact both within the same functional subsystem and with particles of different subsystems. The interactions are in general nonlocal and nonlinearly additive, and are modeled according probabilistic transition rules. These rules can evolve in time due to some learning ability of active particles and to their adaptation to the outer environment.

The evolution of the probability distribution is obtained by a balance of particles within elementary volumes of the space of microscopic states, the inflow and outflow of particles being related to the interactions among individuals. Introducing the notation \(\mathbf{f}=\{f_{ij},\,i=1\ldots ,n;\,j=1,\ldots ,m\}\), where \(f_{ij}\) is the distribution function relative to the \(j\)-th subsystem of the \(i\)-th node, the general framework reads:

$$\begin{aligned} \partial _tf_{ij}(t,u)=J_{ij}^{(in)}[t,u,\mathbf{f}]-J_{ij}^{(out)}[t,u,\mathbf{f}],\quad i=1,\ldots ,n;\,j=1,\ldots ,m\,, \end{aligned}$$
(1)

where \(J_{ij}^{(in)}\) and \(J_{ij}^{(out)}\) are the “collisional” operators representing the inflow and outflow, respectively, of individuals in the \(j\)-th functional subsystem of the \(i\)-th node. Such operators depend, in general, also on the functions \(f_{ij}\) themselves, so that (1) is a system of nonlinear differential equations. Interactions involve three types of particles, named test, candidate, and field particles. More precisely, the test particle, with activity \(u\), is a generic representative entity of the functional subsystem under consideration; candidate particles, with activity \(u_*\), are the particles which can gain the test state \(u\) as consequence of the interactions; field particles, with activity \(u^*\), are the particles whose presence triggers the interactions of the candidate particles. According to these considerations, the terms at r.h.s. of (1) read:

$$\begin{aligned}&J_{ij}^{(in)}[t,u,\mathbf{f}]\nonumber \\&\quad =\displaystyle \sum _{h=1}^n\displaystyle \sum _{p,k=1}^m\int \limits _{D_u}\int \limits _{D_u}\eta _{iphk}[\mathbf f ](u_*,u^*)\mathcal {B}_{iphk}^{ij}[\mathbf f ](u_*\rightarrow u|u^*,u_*) f_{ip}(t,u_*)f_{hk}(t,u_*)du^*du_*,\nonumber \\&J_{ij}^{(out)}[t,u,\mathbf{f}]\\&\quad =f_{ij}(t,u)\displaystyle \sum _{h=1}^n\displaystyle \sum _{k=1}^m\int \limits _{D_u}\eta _{ijhk}[\mathbf f ](u,u^*)f_{hk}(t,u^*)du^*,\qquad i=1,\ldots ,n;\,j=1,\ldots ,m.\nonumber \end{aligned}$$
(2)

Here \(\eta _{iphk}\) represents the encounter rate (frequency of mutual interactions) between the candidate individual of the \(i\)-th node, \(p\)-th functional subsystem (an \((i,p)\) particle) and the field particle of the \(h\)-th node, \(k\)-th functional subsystem, \(\mathcal {B}_{iphk}^{ij}\) is the probability density that the \((i,p)\) candidate particle with activity \(u_*\) falls into the node-subsystem \((i,j)\) with state \(u\) after interacting with a \((h,k)\) field particle having activity \(u^*\).

The mathematical structure (1, 2) is relative to a closed system, where only interactions among individuals belonging to different nodes-subsystems are considered and in which the total number of active particles is preserved. As a consequence, denoted by \(N_{ij}(t)=\int _{D_u}f_{ij}(t,u)du\) the number of \((i,j)\) individuals at time \(t\), the conservation condition \(\sum _{i=1}^n\sum _{j=1}^mN_{ij}(t)=N(0)\) holds, where \(N(0)\) is the total number of individuals in the whole system at time \(t=0\). The previous condition permits to normalize the distribution function \(\mathbf{f}\) with respect to the constant quantity \(N(0)\), that is, instead of the previous defined \(\mathbf{f}\) we can consider the normalized distribution function \(\hat{\mathbf{f}}=\mathbf{f}/N(0)\). In this way the distribution function assumes in our case the role of a probability density, though this is not the general case in the KTAP. To avoid useless heavy notation, from now on we still denote as \(\mathbf{f}=\{f_{ij},\,i=1\ldots ,n;\,j=1,\ldots ,m\}\) the normalized distribution functions. Thus, the conservation condition becomes:

$$\begin{aligned} \displaystyle \sum _{i=1}^n\displaystyle \sum _{j=1}^mN_{ij}(t)=1. \end{aligned}$$
(3)

The system (1, 2) has to be implemented with initial values \(\mathbf{f}(0)=\{f(0)_{ij},\,i=1\ldots ,n;\,j=1,\ldots ,m\}\) of the distribution functions for each subsystem in each node. Well-posedness of the initial value problem related to the framework (1) has been studied both in the case of linear and nonlinear interactions. For this issue we refer to [25] and therein cited references. As discussed in [21], a solution to (2) is a function \(\mathbf{f}\) whose components \(f_{ij}\) belong to the space \(C^1\left( 0,T;L^1_w(D_u)\right) \), where \(L^1_w(D_u)\) is the Banach space of summable functions on \(D_u\) with respect to a suitable positive weight \(w\). In that paper the global in time existence and uniqueness has been proven, while in [26] the case in which the encounter rate \(\eta \) depends on the constant number density \(N\) has been studied.

3 Modeling opinion formation

The system (1, 2) provides the framework to model large systems of interacting individuals. The aim of this section is to explain the way in which such a structure is able to model the complexity features related to the formation and evolution of opinions in a structured population. Assume we wish to test how the opinion concerning a specified issue (immigration policy, homosexual marriage, etc.) evolves in time according to the population “structure”, in the present study limited to its geographic distribution and its political orientation (in broad sense). The space variable is summarized in the nodes distribution, each node identifying a geographic area (north, center, south, for example, when referring to Italy). In each node we have a number of functional subsystems, each corresponding to the node population subset of people whose initial leaning is the same. More precisely, for each fixed node \(i\), the subsystem’s label \(j\) is numbered from \(j=1\), the most conservative, to \(j=m\), the most progressive sub-population according to their general political orientation. Moreover, the activity \(u\) in the functional subsystem \((i,j)\) is initially distributed from low (close to 0) to high values (close to 1), corresponding to the individuals ranging from the mostly adverse to the mostly favourable to the given issue. In other words, while the partition in subsystems (index \(j\)) reflects the mainstream sociopolitical collocation of individuals, and is initially basically independent on the specific issue, the activity distribution inside any functional subsystem is related to the finer orientation of the corresponding individuals with respect to the topic under consideration. Assuming that \(u\in D_u=[0,1]\), Fig. 1 shows an example of an initial distribution \(f_{ij}(0,u)\) corresponding to a functional subsystem in which the individuals are mostly “open minded”.

Fig. 1
figure 1

Example of initial distribution function \(f_{ij}(0,u)\)

3.1 Encounter rate

The function \(\eta _{iphk}[\mathbf{f}]\) describes the encounter rate between an individual belonging to the \(j\)-th subsystem of the \(i\)-th node ( a \((i,j)\) active particle) with any other active particle in the \(k\)-th subsystem of the \(h\)-th node [\((h,k)\) particle]. It is worth noticing that encounters between two particles belonging to the same node and/or to the same subsystem are not excluded. In our model we assume the following expression of the encounter rate:

$$\begin{aligned}&\displaystyle \eta _{ijhk}[f](u_*,u^*)\nonumber \\&\quad \!=\!\eta ^0\Lambda _{ijhk}\exp \Big (-\displaystyle |u_*-u^*|\!-\!||f_{ij}(t,u_*)-f_{hk}(t,u^*)||\!-\!|\mathcal {S}_{ij}(t,f)\!-\!\mathcal {S}_{hk}(t,f)|\Big ).\nonumber \\ \end{aligned}$$
(4)

Here:

  1. (i)

    \(\eta _0\) is a constant, which has to be estimated;

  2. (ii)

    \(\displaystyle \Lambda _{ijhk}\) has the form:

    $$\begin{aligned} \displaystyle \Lambda _{ijhk}=\frac{1+\delta _{ih}(n-1)}{n(|j-k|+1)} \end{aligned}$$

    where \(\delta _{ih}\) is the Kronecker delta. If \(i=h\) (i.e. interaction between individuals belonging to subsystems of the same node), then the encounter rate scales as \({1}/\left( |j-k|+1\right) \), that is, it depends only on the relative distance between the two subsystems. Otherwise, if \(i\ne h\), then \(\displaystyle \Lambda _{ijhk}={1}/\left( n(|j-k|+1)\right) \) and it takes into account also the total number of nodes: the more the nodes, the lower the probability of interaction;

  3. (iii)

    The hierarchic distance \(|u_*-u^*|\) measures the distance in activity between the interacting individuals. The choice of the metric to measure the hierarchic distance (hereafter called hd) has to be made according the modeling needs. Here we compare the values of \(u^*\) and \(u_*\) with respect to the middle value (\(1/2\)) of the activity as follows:

    $$\begin{aligned} u_*{\left\{ \begin{array}{ll} \ge \displaystyle \frac{1}{2} {\left\{ \begin{array}{ll} u^*\ge \displaystyle \frac{1}{2} &{}\quad hd\sim \displaystyle \frac{\min (u_*,u^*)}{\max (u_*,u^*)}|u_*-u^*|,\\ u^*<\displaystyle \frac{1}{2} &{}\quad hd\sim u_*-u^*,\\ \end{array}\right. }\\ <\displaystyle \frac{1}{2} {\left\{ \begin{array}{ll} u^*\ge \displaystyle \frac{1}{2} &{}\quad hd\sim u^*-u_*,\\ u^*<\displaystyle \frac{1}{2} &{}\quad hd\sim {1}/\left( |u^*-u_*|\right) .\\ \end{array}\right. }\\ \end{array}\right. } \end{aligned}$$

    In the first case (\(u^*,u_*\ge 1/2\)) both the candidate and the field particles have high activity; this means they are both opened to exchange ideas and confront their relative opinions, giving rise to a high encounter rate. On the other hand, if the candidate has activity lower than the the field’s, then the encounter rate has to be low. Hence, putting this modified hd in the negative exponential model we are introducing, we have essentially what we have described. In the second case (\(u_*\ge 1/2,u^*<1/2\)) the encounter rate depends only on the activity difference: morally, the more the candidate is active and the field is static, the lower the rate, and converse. The same happens in the third case, exchanging the role of candidate and field. In the last case, when both of the particles have activity less than \(1/2\), meaning that they are both static, then the encounter rate is expected to be very low.

  4. (iv)

    \(||f_{ij}(t,u_*)-f_{hk}(t,u^*)||\) measures how much distant the distribution of the particles are. We say that two subsystems are affine if the have similar distributions functions. Hence, if two subsystems are affine, they encounter each other more frequently with respect to subsystems that have totally different distribution functions. As discussed in [27], different possible choices for this norm are possible; here we make use of the \(L^\infty \) one.

  5. (v)

    The quantity:

    $$\begin{aligned} \displaystyle \mathcal {S}(t,f)= {\displaystyle \int \limits _0^1(u-\bar{u})^3f(t,u)du}\Big /{\left( \displaystyle \int \limits _0^1(u-\bar{u})^2f(t,u)du\right) ^{3/2}} \end{aligned}$$

    is the skewness of the distribution function, where \(\bar{u}(t)=\int _0^1uf(t,u)du\) is the mean of \(f(t,u)\) and where suitable indexes have to be used. It measures the asymmetry of the function. To see how it could influence the encounter rate let us make a practical example. Consider first the distribution functions shown in Fig. 2 relative to two different subsystems. The distribution function in Fig. 2a has skewness \(-1.0739\), while the one in Fig. 2b has skewness \(1.0061\). The corresponding subsystems have distribution concentrated on different points (they have different means), so the general opinion orientation of their components are different, leading to a small encounter rate. On the other hand, in Fig. 2c we have o distribution with skewness \(-1.0730\) , while the one Fig. 2d has skewness \(-1.0849\): the relative difference is small and the encounter rate is large. In the first example (Fig. 2a, b) we can see also how the skewness gives account of the “conformism” of the individuals: the function in (b) is wider around its mean, hence the skewness is larger (in absolute value) because there are more particles near the mean, which represents the “general” thinking of the subsystem as a whole.

Fig. 2
figure 2

Influence of skewness on the encounter rate

3.2 Transition probability densities

The function \(\mathcal {B}_{iphk}^{qj}[f](u_*\rightarrow u|u^*,u_*)\) models the probability that an active particle (individual) in the subsystem \(p\) of the node \(i\) with activity \(u_*\) goes to the subsystem \(j\) of the node \(q\) with activity \(u\) after the interaction with a particle of the subsystem \(k\) with activity \(u^*\) of the \(h\) node.

After the interaction, the particles may manifest a different behavior (may change their opinion) both due to their own characteristics and to the general trend of the subsystems. Among all the possible types of interaction, we focus on the following ones:

  1. 1.

    Cooperative: this type of interaction tends to decrease the difference in the states of interacting particles, due to a sort of dragging effect. A candidate particles either increases its activity, taking advantage of its interaction with a field particle having a higher state, or decreases it interacting with a candidate particle with a lower state.

  2. 2.

    Competitive: the effect of this kind of interaction is to increase the activity difference between the interacting particles, due to a kind of driving back effect. A candidate particle either increases its activity when meets a field particle with a lower state or decreases its activity encountering a field particle with a higher state.

  3. 3.

    Hiding-learning: in this case, the particle with the higher state tries increasing its activity distance from the other. In the meanwhile, the latter attempts to reduce such a distance by a learning process.

The output resulting from the interaction between two active particles is not determined a priori, i.e. the modified behavior is known only in probability. Hence, \(\mathcal {B}\) is a stochastic matrix, whose expression takes account of possible irrational components of the particles’ behavior belonging to the overall system.

In order to have an effective model for the matrix \(\mathcal {B}\), we must consider the different sources of nonlinearities arising from the interactions details. Among others:

  • Threshold: the interaction’s output depends on the a threshold on the distances between the particles; the nature of this distance could be different, e.g. physical, ideological, political;

  • Domain of influence: the candidate particle can interact only with a certain number of field particles, within a possible varying domain of interaction. The number of field particles involved depends on the details (shape, symmetry, sharpness) of the corresponding distribution functions.

The strong assumption made in this work is that a particle does not change its node, assumption compatible with the meaning of geographic location of nodes. Consequently, the transition probability is modeled by the function \(\mathcal {B}_{iqhk}^{ij}\). Moreover, we assume also that when \(h \ne i\) (candidate and field individuals belonging to different nodes), then \(\mathcal {B}_{iqhk}^{ij}\) is a scale factor of \(\frac{1}{n}\) with respect to the corresponding transition probability with \(h = i\) (same node). Taking into account all the possible encounters between different particles, the following normalization condition for the multidimensional stochastic array \(\mathcal {B}\) must hold:

$$\begin{aligned} \sum _{h=1}^n\sum _{j,k,q=1}^m{\mathcal B}_{iqhk}^{ij}=1\,. \end{aligned}$$
(5)

As we previously wrote, we assume that any term of the type \(\mathcal {B}_{iqhk}^{ij}\) , that is the transition probability that a \((i,q)\) individual falls into \((i,j)\) after the interaction with a \((h,k)\) one, is exactly \(1/n\) of the corresponding term \(\mathcal {B}_{iqik}^{ij}\), corresponding to the interaction just described but between subsystems belonging to the same node, that is, \(\mathcal {B}_{iqhk}^{ij}=(1/n)\mathcal {B}_{iqik}^{ij}\), whatever the indices. Then, from (5) we get:

$$\begin{aligned}&\displaystyle \sum _{j,k,q=1}^m\left( \mathcal {B}_{iqik}^{ij}+\sum _{\begin{array}{c} h=1\\ h\ne i \end{array}}^n\mathcal {B}_{iqhk}^{ij}\right) =\displaystyle \sum _{j,k,q=1}^m\left( \mathcal {B}_{iqik}^{ij}+\displaystyle \frac{1}{n}\sum _{\begin{array}{c} h=1\\ h\ne i \end{array}}^n\mathcal {B}_{iqik}^{ij}\right) \nonumber \\&\quad =\displaystyle \sum _{j,k,q=1}^m\left( \mathcal {B}_{iqik}^{ij}+\displaystyle \frac{n-1}{n}\mathcal {B}_{iqik}^{ij}\right) =\displaystyle \frac{2n-1}{n}\sum _{j,k,q=1}^m\mathcal {B}_{iqik}^{ij}=1. \end{aligned}$$
(6)

Now, we count all the possible interactions of a given \((i,j)\) active particle with all the other particles, both in the same and in different nodes, that is, we enumerate all the possible terms in the transition probability array \(\mathcal {B}\). Thus, we have \(m!/(m-1)!=m\) terms of the type \(\mathcal {B}_{ijij}^{ij}\), corresponding to the interaction between a \((i,j)\) candidate and a \((i,j)\) field, with output as a \((i,j)\) test particle (permutations with two repetitions), \(m!/(m-2)!=m(m-1)\) terms of the type \(\mathcal {B}_{ijij}^{iq}\) (resp. \(\mathcal {B}_{ijik}^{ij}\)) , corresponding to the interaction between a \((i,j)\) candidate and a \((i,j)\) (resp. \((i,k)\)) field, with output as a \((i,q)\) (resp. \((i,j)\)) test particle (permutations with one repetition), and \(m!/(m-3)!=m(m-1)(m-2)\) terms of the type \(\mathcal {B}_{ijik}^{iq}\), corresponding to the interaction between a \((i,j)\) candidate and a \((i,k)\) field, with output as a \((i,q)\) test particle (permutations without repetitions). These considerations hold for interactions of \((i,j)\) individuals with active particles belonging to all the other \(n-1\) nodes, whatever the indices. Then, we finally get:

$$\begin{aligned}& m\mathcal {B}^{ij}_{ijij}+m(m-1)\mathcal {B}^{iq}_{ijij}+m(m-1)\mathcal {B}^{ij}_{ijik} +m(m-1)(m-2)\mathcal {B}^{iq}_{ijik}\nonumber \\&\quad +\displaystyle \frac{m(n-1)}{n}\Big [\mathcal {B}^{ij}_{ijhj}+(m-1)\mathcal {B}^{iq}_{ijhj} +(m-1)\mathcal {B}^{ij}_{ijhk}+(m-1)(m-2)\mathcal {B}^{iq}_{ijhk}\Big ]=1,\nonumber \\ \end{aligned}$$
(7)

where the first row of (7) refers to the interactions within the same node, while in the second row interactions between different nodes are accounted. We assign a probability \(P\) to the first case, and \(1-P\) to the second one. For example, when \(P=1\) we are considering the case in which the interactions happen only on the same node.

Keeping in mind the previous normalization, we are in position to write a first model for the matrixFootnote 1 \(\mathcal {B}\). As previously stated, since the interacting particles do not change node, from now on the index \(i\) will be suppressed. We have:

$$\begin{aligned} \mathcal {B}_{jk}^q= {\left\{ \begin{array}{ll} k = j &{} {\left\{ \begin{array}{ll} q=j &{} \mathcal {B}^j_{jj}=\alpha \\ q \ne j &{} \mathcal {B}^q_{jj}=\tilde{\alpha }\\ \end{array}\right. }\\ k \ne j &{} {\left\{ \begin{array}{ll} q=j &{} \mathcal {B}^j_{jk}=\xi \\ q\ne j &{} \mathcal {B}^q_{jk}=\tilde{\xi } \end{array}\right. }\\ \end{array}\right. } \end{aligned}$$

where \(0<\alpha ,\tilde{\alpha },\xi ,\tilde{\xi }<1\). The parameters \(\alpha ,\tilde{\alpha }\) model the probability of transitions when the interacting subsystem are the same, while \(\xi \) and \(\tilde{\xi }\) model the transition probability between two different subsystems. Giving a weight \(P_1\) to the first case and \(P-P_1\) to the second, from (7) we get:

$$\begin{aligned} m\alpha +m(m-1)\tilde{\alpha }=P_1 \end{aligned}$$

and, solving for \(\tilde{\alpha }\):

$$\begin{aligned} \tilde{\alpha }=\Big (\frac{P_1}{m}-\alpha \Big )\frac{1}{m-1} \end{aligned}$$
(8)

In order to have this probability greater than zero, the parameter \(\alpha \) cannot be chosen freely, rather it has to satisfy the following constraint:

$$\begin{aligned} \alpha \le \frac{P_1}{m} \end{aligned}$$

Performing a similar calculation for the other part we have:

$$\begin{aligned} m(m-1)\xi +m(m-1)(m-2)\tilde{\xi }=P-P_1 \end{aligned}$$

and then:

$$\begin{aligned} \tilde{\xi }=\Big (\frac{(P-P_1)}{m(m-1)}-\xi \Big )\frac{1}{m-2} \end{aligned}$$
(9)

with the constraint:

$$\begin{aligned} \xi \le \frac{(P-P_1)}{m(m-1)} \end{aligned}$$

In case of different nodes (i.e. in modeling \(\mathcal {B}^{iq}_{ijhk}\)), the model and the calculation are very similar, except for the presence of a factor \(\frac{n-1}{n}\).

$$\begin{aligned} \mathcal {B}_{ijhk}^{iq}= {\left\{ \begin{array}{ll} k = j &{} {\left\{ \begin{array}{ll} q=j &{} \mathcal {B}^{ij}_{ijhj}=\underline{\alpha } \\ q \ne j &{} \mathcal {B}^{iq}_{ijhj}=\underline{\tilde{\alpha }}\\ \end{array}\right. }\\ k \ne j &{} {\left\{ \begin{array}{ll} q=j &{} \mathcal {B}^{ij}_{ijik}=\underline{\xi }\\ q\ne j &{} \mathcal {B}^{iq}_{ijik}=\underline{\tilde{\xi }} \end{array}\right. }\\ \end{array}\right. } \end{aligned}$$

Assigning probability \(P_2\) to the case \(k=j\) and consequently \(1-P-P_2\) to the case \(k\ne j\), we have:

$$\begin{aligned} \begin{array}{lll} \displaystyle \underline{\tilde{\alpha }}=\Big (\frac{P_2n}{(n-1)m}-\alpha \Big )\frac{1}{m-1} &{}&{}\displaystyle \underline{\alpha }\le \frac{P_2n}{m(n-1)}\\ \displaystyle \underline{\tilde{\xi }}=\Big (\frac{n(1-P-P_2)}{m(m-1)(n-1)}-\xi \Big )\frac{1}{m-2}&{}&{}\quad \displaystyle \underline{\xi }\le \frac{n(1-P-P_2)}{m(m-1)(n-1)} \end{array} \end{aligned}$$

In an opinion formation framework, we can try to write the probability transition densities taking into account some characteristic of the phenomenon considered. The activity variable \(u\) represents the individual political opinion, while \(f_{ij}\) represents the general trend of the subsystem \(j\) of the node \(i\) regarding a particular issue. Moreover, if we assume that the interactions occur between particles of the same node, it means that in the model described before \(P=1\), hence \(P_2=0\).

In this framework, the transition probability models the possibility that an individual changes (or not) its mind after the interaction with another individual. For example, let’s consider the encounter between two individuals, one pro gay marriage and one against it: the matrix \(\mathcal {B}\) models the probability that the first one changes its opinion concerning this issue after the encounter. In order to model the matrix \(\mathcal {B}\) in an opinion formation process, we considerFootnote 2 the center of mass of the \(j\)-th and \(k\)-th subsystems:

$$\begin{aligned} g[j,k](t,u_*,u^*) = \frac{jf_{ij}(t,u^*)+kf_{ik}(t,u_*)}{f_{ij}(t,u^*)+f_{ik}(t,u_*)}. \end{aligned}$$
(10)

The quantity \(g[j,k]\) is a numberFootnote 3 which has the role to take into account how much strong the “attraction” towards the interaction state is. In this way, we can consider the relative distance between the candidate particle’s subsystem and the center of mass of interacting subsystems. For example, the distance between the \(p\)-th subsystem and the center of mass \(g[j,k]\) is:

$$\begin{aligned} d_{gp}=|p-g[j,k]|. \end{aligned}$$

The strength of interaction that we assume in the model has the form:

$$\begin{aligned} \xi = \frac{\varepsilon }{|u_*-u^*|+1}, \end{aligned}$$

and

$$\begin{aligned} \tilde{\xi } = \frac{\delta }{(d_{gj}+\omega )(|u_*-u^*|+1)}, \end{aligned}$$

where \(\omega \) takes into account if \(j\), \(q\) or \(k\) are “boundary subsystems”, that is, subsystems with label \(j=1\) or \(j=m\), and \(\delta \) and \(\varepsilon \) are suitable parameters lying in the interval \([0,1]\). For sake of simplicity, let’s represent the subsystems as massive points of different size on a line; we explain the role of \(\omega \) when \(j\), \(q\) or \(k\) are subsystems on the node’s boundary.

figure a

As we stated before, \(\mathcal {B}_{jk}^{q}\) represents the probability to go from \(j\)-th subsystem to \(q\)-th subsystem after the interaction with the \(k\)-th. In this case the center of mass, simply denoted by \(g\), is close to \(k\), while \(j\) and \(q\) are distant: going from \(j\) to \(q\) is not very reasonable, hence the probability has to decrease with the distance from the center of mass. Thus, \(\omega = d_{gq}\) and

$$\begin{aligned} \mathcal {B}_{jk}^{q} = \frac{\delta }{(d_{gj}+d_{gq})(|u_*-u^*|+1)}. \end{aligned}$$

A different situation is depicted in the following picture:

figure b

so that the probability to pass for \(j\) to \(q\) depends also on the relative distance between \(j\) and \(q\) themselves. Consequently \(\omega = d_{j,q}\) and

$$\begin{aligned} \mathcal {B}_{jk}^{q} = \frac{\delta }{(d_{gj}+d_{j,q})(|u_*-u^*|+1)}. \end{aligned}$$

It could happen that \(q=k\), and we have the following picture’s situation:

figure c

In this case \(\omega =0\) and

$$\begin{aligned} \mathcal {B}_{jk}^{k} = \frac{\delta }{d_{jq}(|u_*-u^*|+1)}. \end{aligned}$$

Remark 1

Notice that it does not matter if the subsystem is a left or a right boundary one, the transition probability depends only on the distance from the node’s center of mass. Moreover, the position of the latter (at right or left of the “more massive” subsystem) does not affect the transition probability.

Remark 2

In case of \(j\), \(q\) or \(k\) being “non-boundary” subsystems, we assume that \(\omega =0\).

Hence, the array \(\mathcal {B}\) has the following aspect:

$$\begin{aligned} \mathcal {B}_{jk}^q= {\left\{ \begin{array}{ll} k = j &{} {\left\{ \begin{array}{ll} q=j &{} \displaystyle \mathcal {B}^j_{jj}=\frac{P_1}{m}-(m-1)\tilde{\alpha } \\ q \ne j &{} \displaystyle \mathcal {B}^q_{jj}=\tilde{\alpha }\le \frac{P_1}{m(m-1)}\\ \end{array}\right. }\\ k \ne j &{} {\left\{ \begin{array}{ll} q=j &{} \displaystyle \mathcal {B}^j_{jk}=\frac{1-P_1}{m(m-1)}-\frac{\delta }{(d_{gj}+\omega )(|u_*-u^*|+1)}\\ q\ne j &{} \displaystyle \mathcal {B}^q_{jk}=\frac{\delta }{(d_{gj}+\omega )(|u_*-u^*|+1)} \end{array}\right. }\\ \end{array}\right. } \end{aligned}$$
(11)

with

$$\begin{aligned} \frac{1-P_1}{m(m-1)}-P_1\le \frac{\delta }{(d_{gj}+\omega )(|u_*-u^*|+1)}\le \frac{1-P_1}{m(m-1)} \end{aligned}$$

The only parameters to be set up are three, namely the weight \(P_1\), the probability \(\tilde{\alpha }\) and the constant \(\delta \). Observe that they must satisfy the relative constrains.

4 Numerical results

In this section we report the results of numerical experiments performed on the opinion formation model introduced in Sect. 3. In order to solve the differential equations’ system:

$$\begin{aligned} {\left\{ \begin{array}{ll} \displaystyle \frac{\partial }{\partial t}f(t,u) = y(f(t,u))\\ f(0,u) = F(u) \end{array}\right. } \end{aligned}$$
(12)

in the interval \([0,T]\) we use a forward Euler scheme. Considering the subdivision of the time interval in the nodes \(\{0=t_0, t_1,t_2,\dots ,t_n=T\}\), where \(t_{i+1}-t_i=\varDelta t>0\), we have:

$$\begin{aligned} f(t_{k+1},u) = y(f(t_k,u))\varDelta t + f(t_k,u) \text{; } f(t_0,u) = F(u) \end{aligned}$$

In our model, the right hand side of the differential equation is represented by sums of double integrals. Each integral is computed with the composite Simpson formula:

$$\begin{aligned} \int \limits _a^b f(x) dx \sim \frac{\varDelta x}{3}\left( f_0 +4f_1+2f_2+\dots +2f_{2m-2}+4f_{2m-1}+f_{2m}\right) \end{aligned}$$

where \(f_i = f(x_i)\), with and approximation error of \(\displaystyle \frac{b-4}{180}(\varDelta x)^4 f^{(4)}(\eta )\), \(\eta \in [a,b]\). The integration interval is divided in \(2m+1\) nodes as \([a,b]=\{a = x_0, x_1, \dots , x_{2m+1}=b\}\), \(\varDelta x = x_{i+1}-x_i\). Since the r.h.s. of (12) looks:

$$\begin{aligned} \sum _{i,j}\sum _{h,k}\int \int \limits _{Du^2} \eta \mathcal {B}f_{ij}f_{hk}du^*du_* \end{aligned}$$

we first compute \(\int _{Du}\eta \mathcal {B}f_{ij}f_{hk}du^*= F_{ij,hk}(u_*)\), then evaluate \(\int _{Du}F_{ij,hk}(u_*)du_*\) and sum all over the suitable indexes.

4.1 Numerical experiments

In the first of our experiments, the Italian regional areas are represented by three nodes: north, center and south. Each node is divided in three subsystems, grouping the progressive, the moderate and the conservative individuals, respectively. In Fig. 3 we show the experiment’s initial data, in which only one subsystem shows an a priori opinion (more conservative) different from that of the other ones (mostly progressive).

Fig. 3
figure 3

Initial situation. On the \(rows\) there are the geographic nodes, while on the \(columns\) the parties are represented. In this case, we can see that only the first subsystem in the first node has an initial general orientation pretty different from the others. In each graph, the activity \(u\) is on the \(x\) axis, while on the \(y\) axis there are the values of the function \(f_{ij}(0,u)\) (\(i,j=1,2,3\))

The values of parameters we set for the numerical computations are the following:

  • \(\delta = 10^{-m}\) (to obtain the right normalization for the \(\mathcal {B}\));

  • \(P_1 = 1\),

  • \(\tilde{\alpha }=0.1594\).

In Fig. 4 and 5 we present the results relative to the \(f_{11}\) and \(f_{22}\) distributions. In details, Fig. 4 shows the evolution in time of the distribution functions of the most conservative (\(i=1\), \(j=1\)) subsystem in the north and of the “moderate” (\(i=2\), \(j=2\)) one in the center. The initial very conservative attitude of the (1,1) individuals smooths down, as is reported in Fig. 5, while the (1,2) individuals shows a trend towards a bimodal distribution (see Fig. 4 \(_{\,2}\)), corresponding to an increase of the moderate fraction in the subsystem’s population.

Fig. 4
figure 4

3D plots of the \(f_{11}(t,u)\) and \(f_{22}(t,u)\) distribution functions corresponding to initial data as in Fig. 3

Fig. 5
figure 5

Evolution of the \(f_{11}\) function at steps \(t = 10,30,40,50\), from left to right and from \(top\) to \(bottom\). We initially notice a slight movement to the \(right\), due to the fact that all the rest of the population has a strongly different position about this particular issue. Letting the model evolve in time, a more effective shift is observed

In the second experiment we test the consistence of the model starting from an initial situation in which all the distribution functions are uniform. This basically means that in principle none of the individuals has a particular orientation with respect to the specific issue, irrespective of their node-subsystem. For example, in Fig. 6 we plot the time evolution of the function \(f_{32}\). As result of mutual interactions, an opinion structure emerges, differentiating the orientation of individuals.

Fig. 6
figure 6

Evolution (\(t = 0, t = 3, t = 6.5, t = 10\)) of the distribution \(f_{32}\) when all the initial \(f_{ij}\) are uniform distributions (no individual has any particular orientation with respect to the specific issue). As time goes on, as a result of mutual interactions a structured trend emerges

5 Conclusions and perspectives

The kinetic theory of active particles has shown its ability to model large living-social systems that exhibit complex characters. In this paper we use the KTAP to describe how a collective opinion related to specific issues forms and evolves in time as consequence of mutual interactions of individuals, located in a network, grouped in functional subsystems according their common strategy. The network structure has been introduced here to mimic the geographic distribution of interacting individuals. In Sect. 3 we show how the number of nodes in the network influences the model, in particular the transition probabilities, suggesting that a population with a richer spatial structure will possibly give rise to a more detailed opinion structure. The evolution of the subsystems’ distribution functions, obtained as a balance equations over the microstates, shows how the details of transition probability densities, modeled as stochastic games played among interacting individuals, are able to capture some basic features of opinion formations, revealing the emergence of structures in the distribution functions of functional subsystems that correspond to cooperative/competitive processes as well as learning characters in the individuals exchange of ideas. The arising of such collective behaviors is strictly related to the strong nonlinearities appearing in the r.h.s of (2), as discussed in [27]. It is worth to stress that in the present paper only “spontaneous” mutual interactions govern the evolution of opinions trend and that no comparison has even been attempted with real data. In a forthcoming paper we introduce the “pressure” of external agents having the specific goal to bias individuals opinion toward their proper interests, as in an election campaign or in advertising, and analyze the results of the KTAP based modeling approach with the existing literature [2830].