After stating that we are PhD students working at The Center for the Study of Complex Systems (CSCS) at the University of Michigan a common question we both get is, "What is complex systems?" Easy question, right? Just describe the focus of CSCS. This turns out to be a surprisingly difficult task. CSCS doesn't have a single focus and complex systems is a broad and interdisciplinary subject. The definition of what a complex system is varies based on who you ask and what you read. This is the motivation behind this article. To start, here is our attempt at a rough definition. A complex system is a set of interacting parts that collectively form interesting global structures and patterns. The phenomenon where higher order behavior arises from its components is thought of as emergence. Emergence is one of the key characterstics of complex systems. We will describe more characterstics in the following section. Some common examples include the brain, an economy, immune system, and ecosystems.
In this article we will to describe some common characteristics of complex systems. We will explore some of these characteristics in the context of the flocking behavior of birds.
An exact definition of a complex system does not exist. This is due to the numerous disciplines the study covers. Here at the UM, CSCS core faculty spans sociology, physics, math, political science, economics, engineering, school of information, and public policy. The list grows even larger when you include affiliated faculty members. That being said, there are some common characteristics of complex system that exist among these various areas of study. Here is a list of common features and their descriptions:
NonLinearity: A sytem exhibits nonlinearity when it's behavior can not be fully understood by inspecting it's individual parts alone. Another way of stating this is that a change on the component level doesn't result in a proportional change on the system level.
Phase Transitions The phase of the system describes a setting in which properties that parameterize the system have some uniform characteristics. A phase transiton occurs when properties of the system change their behavior. For example, when condensation occurs and a gas (a phase) turns into a liquid (a phase) a phase transiton has occured. Phase transitions can occur suddenly based on a small changes on the component level. This happens when the system is close to a tipping point.
Self Organization: Self organization is a process linked to emergence (mentioned earlier). A process is said to self organize when order emerges from a previously disordered sytem without any external control. This process happens spontaneously and sometimes unpredictiable (think chaos theory). A particular type of self organization, that is of high interest in complex systems is collective behavior. This is when the individual components collaborate to instill some structure. Collective behavior exist in a wide context, organels in a cell coopoerate to achive desired functionality just like a groups of peoples work together to meet some desired goal.
We will now discuss flocking to illustrate the features of a complex system. This is now a canonical complex system. Craig Reynolds (1987) produced perhaps the firstwidely known simulation of flocking. The model used three simple rules: seperation, cohesion, and alignment. These rules were similar to those used in a earlier simulation done by Aoki (1982) for modeling fish schools. A quantitative study of flocking was introduced by Tamas Vicsek (1995) using methods from statistical physics. The model studied in Vicsek's 1995 paper is know widely known as the "Vicsek model". We will discuss the Craig Reynold's model and Vicsek's model here.
Population

Seperation

Cohesion

Alignment

Craig Reynold's Boid simulations can be summarised by the three simple local rules:
Seperation: Avoid collisions with your neighbors.
Cohesion: Although keep close to your neighbors.
Alignment: Move in the general direction as your neighbors.
These rules are implimented by the following update scheme: $$ \mathbf{v}_{desired} = \mathbf{v}_{seperation} + \mathbf{v}_{cohesion} + \mathbf{v}_{alignment}$$ $$ \mathbf{r}_{i} (t + \Delta t) = \mathbf{r}_{i} (t) + \Delta t v_{desired} $$ While the update scheme gives the exact dynamics of the model. We can look at the three local rules and get a qualitative understanding of selforganization. Notice when you click rerun, with the following parameter settings: Population = 80, Seperation = 15, Cohesion = 40, Alignment = 20, that all of the 'boids' (birds) are randomly orgainzed at the beginnig. As the simulation runs you notice some emergence take place and we start to see selforganization. The biods start to move in a similar direction. How quick we go from a random orientation to self organization depends on the parameter values. In some cases, selforgainization may not occur or has a long time horizon, for exmaple try these parameter settings: Population = 80, Seperation = 15, Cohession = 5, Alignment = 5. A fun game you could play with friends (or yourself) is to set various parameter values and guess if selforgainzation will emerege and for an even more difficult challenge you can estimate the time horizon.
The Vicsek model [3] is described by the following update rules: $$\theta_{i} (t + \Delta t) = \langle \theta \rangle_{ r_{i}r_{j} < r } + \Delta \theta_{i}(t)$$ $$ \mathbf{x}_{i} (t + \Delta t) = \mathbf{x}_{i} (t) + v \Delta t \begin{pmatrix} \cos\theta_i(t) \\ \sin\theta_i(t) \end{pmatrix} $$ where $\theta$ is the orientation, $\mathbf{x}_{i}$ is the position of the $i$th bird (or particle), $\langle \theta \rangle_{ \mathbf{x}_{i}\mathbf{x}_{j} < r }$ is the average angle of all neighboring birds within a radius $r$ (specifically, $\langle \theta \rangle_{ r_{i}r_{j} < r } =\arctan \left(\frac{\langle \sin \theta \rangle_{ \mathbf{x}_{i}\mathbf{x}_{j} < r } }{\langle \cos \theta \rangle_{ \mathbf{x}_{i}\mathbf{x}_{j} < r }}\right) $), $\Delta \theta_{i}(t)$ is a random number drawn uniformly from the interval $[\eta/2,\eta/2]$, $v$ is the speed of an individual bird, and $\Delta t$ is the time step between updates.
It is useful to specify an order parameter for complex systems that undergo phase transitions. An order parameter is a macroscopic quantity that is an indicator of order of the system. Typically there are two phases, a disordered and ordered phase. An order parameter may take the value 0 say for the disordered system and 1 for the ordered system. The values inbetween 0 and 1 may represent a system in transition or in a 'hybrid' state.
Population $N$

Speed $v$

Noise $\eta$

For the Vicsek model, the order paramter $ \varphi $ is $$ \varphi = \frac{1}{v N} \left\sum_{i=1}^{N}\mathbf{v}_{i}\right$$ where $N$ is the number of birds and $\mathbf{v}_{i} = v\begin{pmatrix} \cos\theta_i(t) \\ \sin\theta_i(t) \end{pmatrix}$ is the velocity of an individual bird. The order parameter is simply the ratio of the group speed divided by the indiviudal speed. This order paramter indicates if the flock is disordered ($\varphi = 0$) or ordered ($\varphi \sim 1$) when the birds are flying in the same general direction as a whole.
Simulation 2 is running the Vicsek model. Modify the parameters with the sliders to see how the system behaves under different parameter choices and observe the order parameter. Although it may be hard to tell, the relationship between these parameter choices do not produces a linear changes to the order parameter $\varphi$. This is due to the nonlinearity of the system  one of the core characteristics of complex systems mentioned earlier. Instead of a linear relationship, we have a scaling law. Vicsek et al. showed that the relationship between $\varphi$ and the density of particles $\rho = N/L^2$ (where $L$ is the domain box length) is given by $$ \varphi \sim (\rho  \rho_{c}(L))^{\delta} $$ where $\rho_{c}(L)$ is the critical transition density, and $\delta$ is a critical exponent.
Flocking behavior as modeled here can exhibit many of the features of Complex systems. We explored nonlinearity, selforganization, and phase transitions in the above two models of flocking. We hope that this demonstration helps with understanding the ideas behind complex systems and their interesting behaviors.
The code in the simulations used the library P5.js. The code was modified from examples provided on the P5.js/processing website . We thank the Processing organization and Daniel Shiffman for providing valuable online resources.