Introduction

Resilience, a system’s ability to retain its basic functionality when errors and failures occur, is a defining property of many complex systems1,2,3. Theoretical models of resilience loss and transitions between alternative states are used to study unanticipated and drastic changes. In real-world systems, many critical transitions are observed, including catastrophic shifts in ecological systems4,5, blackouts in power grids6, financial crises7, climate changes8, human depression9. These abrupt shifts may arise in the presence of alternative stable states. They can be modeled as critical transitions causing the resilience loss of the desired state, after which the systems switch from a functional to dysfunctional state10,11,12. Ecologists are particularly concerned about sudden critical switches between alternative stable states4,5. As the system approaches the tipping point, its behavior becomes barely predictable when the gradual change of some environmental factors leads to the drastic change of the system state. Once a system loses its resilience and becomes dysfunctional, restoring the environmental conditions only to those existing before the collapse is often insufficient. Instead, environmental conditions should be recovered to the critical point where the undesired state is destabilized and then resilience restoration would occur. Even though various restoration methods targeted at specific systems have been proposed, stochastic perturbations receive little attention for the recovery of multi-variable systems13,14,15,16,17,18. On the other hand, stability and resilience of stochastic dynamical systems containing only one variable has been extensively explored. In particular, it has been shown that noise can induce transitions between alternative stable states and the required time to transition has been established by computing the mean first passage time (MFPT)2,19,20,21. Those studies indicate that single-variable systems can switch between alternative stable states in the presence of noise.

Despite advances in understanding the macroscopic characteristics of resilience restoration, previous research has mostly focused on single-variable or low-dimensional systems, which do not account for an exceptionally large number of variables that in reality are needed to control the state of a complex system. Indeed, many real-world systems consist of numerous components connected via a complex set of weighted, often directed, interactions22. The complicated interactions may lead to phenomena not arising in single-variable systems. For example, in the ecosystems, the recovery (or extinction) of a species in one location can impact the states of this species in the neighboring locations, leading to a recovery (or extinction) over the entire system23. Accordingly, a full understanding of the system evolution, stability, and resilience cannot be gained without considering interactions among a sufficiently large amount of components. However, hindered by the high-dimensionality of interaction topology and the nonlinear evolution dynamics, few analyses of critical transitions and resilience restoration had been done directly on high-dimensional systems consisting of a great number of participants until the effective reduction theory was recently developed by Gao et al.3. This mean-field theory can be used to effectively reduce a multi-dimensional complex system to a one-dimensional system by capturing the average activities of the original system. Furthermore, Liang et al.24 designed a universal indicator for critical transitions in complex networks and concluded that noise compensates for the structural defects of complex networks, indicating that noise may alter the critical threshold. Jiang et al.25 studied mutualistic networks through dimensional reduction and claimed that the tipping point can be predicted accurately even in the presence of noise. Tu et al.26 developed an analytical framework for collapsing complex N-dimensional networked systems into an M + 1-dimensional manifold as a function of M effective control parameters with MN. While mean-field approaches may guide recovery strategies by indicating the conditions needed to destabilize undesired states, these approaches cannot accurately capture the transition pattern toward the desired state of spatially extended systems in stochastic environments. A recent study by Michaels et al.27 combined nucleation theory with local-scale positive feedback to understand transitions and resilience in ecological systems. The classical approach to homogeneous nucleation theory was originally developed to describe phase transformation in materials28,29,30,31,32, in particular in ferromagnetic33,34 and ferroelectric systems35,36. It was also applied to invasion phenomena in spatial ecological systems37,38,39,40. Korniss et al.38 and O’Malley et al.39 studied ecological invasion in spatially extended systems with competition. They discriminate between two fundamental modes of nucleating invasive clusters (single-cluster vs. multi-cluster) and their time-evolution and stochastic features.

In this work, we study the resilience restoration in spatially extended ecosystems, which focuses on a system’s ability and required time to recover to its desired state from the undesired one. As noise can induce transitions in single-variable systems, and environmental stochasticity is an inherent property of real-world ecosystems, we investigate resilience restoration by introducing stochastic perturbations into multi-variable systems, providing a theoretical understanding of critical transitions in spatially extended systems subject to environmental stochasticity. Here, we show that nucleation theory builds an elegant bridge between the noise-induced transition and the spread of such transition over the entire system. Our study reveals the crucial effects of noise strength and system size on transition features. Generally, the stronger noise triggers the transition faster, and the larger system takes less time to recover than the smaller system under the same intensity of noise. For large systems or under intense noise, there are multiple clusters nucleated almost simultaneously in the beginning, and these clusters spread out to their neighbors and finally to the entire system. Only one cluster arises for small systems or under weak noise, which expands until the whole system finishes transitions. Another substantial quantity is the time required to recover a degraded system, and it is determined by many factors, including system sizes, noise strengths, and dynamical functions. Our numerical simulations reveal that the transition times are narrowly centered at an average value for the multi-cluster mode, signaling a deterministic feature. While for the single-cluster mode, they vary stochastically for different noise realizations and universally follow an exponential distribution. Also, our study discovers that noise eventually eliminates the deterministic critical threshold, and the recovery of the entire system from the dysfunctional state is possible in the presence of perturbations as long as noise can trigger the transition for just one component. This scenario is likely to occur when the system is close to the deterministic threshold where the undesired state loses stability. The farther away the system is from this point, the more difficult it is for noise to induce the transition.

Results

Transition in single-variable systems and the average lifetime

The current analytical framework for noise-induced transitions is specifically targeted at the low-dimensional system consisting of only a few interacting components (or only one variable)12,19,41,42,43. It would be highly challenging to directly analyze the system consisting of many interacting components (for example, the square lattice). Before the investigation of multi-variable systems, it is helpful to understand the role of noise in single-variable systems and the possibility of transitions between alternative stable states.

$$\frac{{{{{{{{\rm{d}}}}}}}}x}{{{{{{{{\rm{d}}}}}}}}t}=f(x,\beta )+\eta (t).$$
(1)

For a single-dimensional system, the dynamics may follow the general form as Eq. (1), where f(x, β) governs the deterministic dynamics as the tunable parameter β captures the changing conditions, and η(t) is delta-correlated noise with zero mean and variance \(\langle \eta (t)\eta (t^{\prime} )\rangle ={\sigma }^{2}\delta (t-t^{\prime} )\), where σ is the standard deviation of the noise, which is referred to as noise strength. If the system has a fixed point, x0, it satisfies f(x0, β) = 0. This fixed point is stable if \({\left.\frac{\partial f(x,\beta )}{\partial x}\right|}_{{x}_{0}} < \, 0\), defined by the linear stability condition. These two equations enable us to derive the resilience function x(β), which represents all the possible steady states of the system as a function of β, as shown in Fig. 1a. This resilience function demonstrates that when the control parameter, β, is >\({\beta }_{{{{{{{{{\rm{c}}}}}}}}}_{2}}\), the system only has one stable fixed point, denoted as xH, indicating a resilient state. The system will always recover to the fixed point, xH, for any state perturbations. When the parameter is <\({\beta }_{{{{{{{{{\rm{c}}}}}}}}}_{1}}\), the system also has a single fixed point, xL, indicating a collapse of the system. The system is not restorable, unless we change the parameter β. In this work, we particularly focus on the parameter space where β is between \({\beta }_{{{{{{{{{\rm{c}}}}}}}}}_{1}}\) and \({\beta }_{{{{{{{{{\rm{c}}}}}}}}}_{2}}\) and close to one of the bifurcation points, such that the system has one unstable fixed point (the dashed line) and two stable fixed points, each with very different sizes of basin of attraction. In the absence of noise, to shift from xL to xH, the environmental conditions would need to be restored all the way to \({\beta }_{{{{{{{{{\rm{c}}}}}}}}}_{2}}\), to allow for a transition back to xH. However, noise of the appropriate intensity can trigger the transition without restoring the condition to \({\beta }_{{{{{{{{{\rm{c}}}}}}}}}_{2}}\). For example, for a system with β1 and the system is in the low state, this system can recover to the high state if the noise has a chance to push the system across the unstable fixed point. Furthermore, for two systems (the system 1 and the system 2) with parameters, β1 and β2 (β2 > β1), respectively, it is easier to restore the system 2, because the undesired state of the system 2 is closer to the unstable fixed point. Here, we introduce a normalized variable ρ(t) in Eq. (2) to describe the state behavior during the restoration process. Thus, the normalized stable fixed points are ρL = 0, ρH = 1 and the normalized unstable fixed point is ρu (ρu [0, 1]).

$$\rho (t)=\frac{x(t)-{x}_{{{{{{{{\rm{L}}}}}}}}}}{{x}_{{{{{{{{\rm{H}}}}}}}}}-{x}_{{{{{{{{\rm{L}}}}}}}}}}$$
(2)
Fig. 1: The transition in the single-variable system.
figure 1

a The resilience function of a general bistable system. For the bifurcation parameter \(\beta \in ({\beta }_{{{{{{{{{\rm{c}}}}}}}}}_{1}},{\beta }_{{{{{{{{{\rm{c}}}}}}}}}_{2}})\), there are two stable states (xL, xH) and one unstable state (xu). The initial stable state (xL) evolves to the unstable state (xu) by the aid of noise and is then naturally attracted to the other stable state (xH) by its deterministic dynamics. b and c display the evolution of the rescaled state ρ in the presence of noise. The time to transition (measured by the lifetime of the initial state), τ, changes with the system parameter β and noise strength σ (defined by the standard deviation of Gaussian noise). b As β2 is closer to the critical value \({\beta }_{{{{{{{{{\rm{c}}}}}}}}}_{2}}\) than β1, the unstable state \({\rho }_{{{{{{{{{\rm{u}}}}}}}}}_{2}}\) is lower, making the barrier in the landscape easier to cross in the presence of the same strength of fluctuations, and the lifetime τ2 is thus smaller than τ1. c The parameter β is the same, leading to the same landscape. In the presence of stronger noise σ2, it is easier to drive the system to get over the barrier, causing τ2 to be smaller than τ1. d shows the simulation results of the average lifetime 〈τ〉 under different values of β and different noise strengths. The dashed line is fitted based on Eq. (4).

In the following analysis, we focus on the case when the desired state ρH has a much larger basin of attraction than the undesired state ρL, suitable to examine the “one-way recovery” from ρL to ρH. Because of symmetry, the conclusions drawn from this study should be applicable to the transition from ρH to ρL when ρL has a larger basin of attraction. (see Supplementary Note 1 for the detailed comparisons of one-way transitions and stochastic switching between stable states). For the case that we consider throughout the manuscript, the value of the unstable state ρu is very close to ρL, increasing the chance for perturbations to push the system from the state ρL over the unstable fixed point ρu until the system gets attracted to the state ρH. It is noteworthy that the backward transition is highly improbable by the same level of perturbations because of the much stronger attraction of the state ρH. To quantify the time needed for the transition from ρL to ρH, the half lifetime, τ (mathematically, τ = {tρ(t) = 0.5}), can be safely used as an indicator of the degree of inertia associated with the transition from the undesired state to the desired one. One can choose any value as the cutoff as long as it is sufficiently larger than the unstable state ρu38,44. The lifetime τ is determined by the noise strength σ and the relative stability of alternative stable states controlled by β. Intuitively, larger noise strength indicates stronger fluctuations, which increases the chances of transition, making τ smaller (Fig. 1c). On the other hand, as β increases, the basin of attraction of the stable state ρH gets larger, making the transition from ρL to ρH easier so that τ typically decreases (Fig. 1b). To better illustrate the transition process, the underlying landscape picture45 is introduced, and the effective potential energy is provided by Eq. (3) with zero potential energy at x = 0. In the landscape representation, stable states are traditionally treated as valleys, and unstable states are pictured as hills4,46,47. The transition between stable states can be viewed as the transition from one shallow valley to a deeper valley by crossing the barrier.

$${V}_{{{{{{{{\rm{eff}}}}}}}}}(x)=-\int\nolimits_{0}^{x}\left[f(x^{\prime} )\right]{\mathrm {d}}x^{\prime}$$
(3)

The transition time from one stable state to the other is a random variable because of the stochastic fluctuations, but the average quantity, 〈τ〉, follows a certain law. Based on the derivations of the Kramers formula for the escape rate over a potential barrier by particles of Brownian motion48,49, the average transition time 〈τ〉 can be obtained through the analysis of the MFPT, which is given by Eq. (4). From the quantitative calculation, one can notice that 〈τ〉 increases exponentially with the potential energy difference ΔV = V(xu)−V(xL) between the low stable state and the unstable state (also interpreted as the barrier height) and decreases with noise intensity σ2, which is numerically verified in Fig. 1d. The analysis of single-variable systems provides theoretical support for our intuitive assumption that the low barrier height and strong noise facilitate transitions, leading to resilience restoration (see refs. 42,48 for derivation).

$$\langle \tau \rangle =\frac{2\pi }{\sqrt{V^{\prime\prime} ({x}_{{{{{{{{\rm{L}}}}}}}}})| V^{\prime\prime} ({x}_{{{{{{{{\rm{u}}}}}}}}})| }}{{{{{{{{\rm{e}}}}}}}}}^{2[V({x}_{{{{{{{{\rm{u}}}}}}}}})-V({x}_{{{{{{{{\rm{L}}}}}}}}})]/{\sigma }^{2}}$$
(4)

With the knowledge of the average lifetime 〈τ〉 for single-variable systems available, we are ready to investigate transitions in multi-variable (spatially extended) systems. Nucleation theory is utilized to analyze the generation and spread of the transition in multi-variable systems under external fluctuations.

Spatially extended system and nucleation theory

Generally, the evolution of a system that consists of N coupled components under external perturbations is described by Eq. (5). This study focuses on the spatially extended ecosystem, where one type of species is considered, and its density varies in two-dimensional space and is discretized according to the square lattice topology with periodic boundaries. The deterministic dynamics of each node follows the same self-dynamics F(xi) and the interaction G(xi, xj), and parameters of these functions are also set uniformly for all components. The element of the adjacency matrix A is either 0 or a positive value R, which decides the coupling strength between interacting elements. Additionally, to model the external fluctuations acting on the node i, delta-correlated Gaussian noise ηi(t) with zero mean and variance \(\langle {\eta }_{i}(t){\eta }_{j}(t^{\prime} )\rangle ={\sigma }^{2}{\delta }_{ij}\delta (t-t^{\prime} )\) is introduced, which is the same as the noise applied to the single-variable systems. This general framework can be used to describe a wide range of coupling systems under external perturbations.

$$\frac{{{{{{{{\rm{d}}}}}}}}{x}_{i}}{{{{{{{{\rm{d}}}}}}}}t}=F({x}_{i})+\mathop{\sum }\limits_{j=1}^{N}{A}_{ij}G({x}_{i},{x}_{j})+{\eta }_{i}(t)$$
(5)
$$\frac{{{{{{{{\rm{d}}}}}}}}{x}_{{{{{{{{\rm{eff}}}}}}}}}}{{{{{{{{\rm{d}}}}}}}}t}=F({x}_{{{{{{{{\rm{eff}}}}}}}}})+{\beta }_{{{{{{{{\rm{eff}}}}}}}}}G({x}_{{{{{{{{\rm{eff}}}}}}}}},{x}_{{{{{{{{\rm{eff}}}}}}}}})$$
(6)

Utilizing the dimensional reduction theory3, the deterministic evolution of multi-variable systems can be reduced to Eq. (6), containing only one variable, xeff. In the lattice, the fixed states and their stability for each component are proved to be the same as in the reduced one-dimensional system50,51. Hence, according to the analysis of single-variable systems, for the specific values of effective interaction strength (\(\beta \in ({\beta }_{{{{{{{{{\rm{c}}}}}}}}}_{1}},{\beta }_{{{{{{{{{\rm{c}}}}}}}}}_{2}})\)), each component in this system has two stable states and one unstable state. In the presence of noise, the transition from the low state xL to the high state xH is possible for every component. Once the first transition occurs to the node i, its neighbors will also recover through the interaction with it. To show the overall evolution properties of the entire system, the global state ρ(t) is defined in Eq. (7) by taking the average of the individual state value

$$\rho (t)={\langle {\rho }_{i}(t)\rangle }_{N}=\frac{1}{N}\mathop{\sum }\limits_{i=1}^{N}{\rho }_{i}(t).$$
(7)

The spread of such transition can be well described by the theory of homogeneous nucleation and growth in finite systems33,38,39, and this theory can also predict the spatial-clustering pattern formed during the spreading process. The transition from ρL to ρH occurs to some node at first, nucleating a cluster, and this cluster continues to expand until it fills the entire space, or the cluster’s edge reaches the edge(s) of other clusters that have already nucleated in the system. Homogeneous nucleation makes two assumptions38: nucleation occurs in a Poisson process with a constant rate I both temporally and spatially; once a cluster nucleates, it grows homogeneously with a constant radial velocity v. Since the interaction environments for all components are identical, and the perturbations they receive come from the same distribution, each node has the same chance to nucleate a cluster, which satisfies the assumptions of homogeneous nucleation.

As predicted by homogeneous nucleation theory, the restoration process exhibits different patterns for small systems and large systems when the nucleation rate I is fixed. Small systems exhibit the single-cluster pattern because the number of candidates is so limited that the first cluster nucleates and spreads out to the rest of the system before the second possible cluster emerges. Since the nucleation for a specific individual follows a Poisson process, the global state ρ is expected to evolve distinctly for different noise realizations. Also, the time to nucleate the first cluster, tn, and the lifetime, τ, are inherently random. We introduce the waiting time to quantify the time to the system recovery. Because the underlying process is modeled as a random Poisson process, the complementary cumulative probability distribution of waiting time Pnot is derived as an exponential function, which represents the probability that the global state ρ has not exceeded 0.5 by time t. (Note that our chosen conventional cut-off value 0.5 does not affect the findings.) The distribution of waiting time Pnot is expressed as

$${P}_{{{{{{{{\rm{not}}}}}}}}}(t)=\left\{\begin{array}{ll}1,\hfill\quad &t\le {t}_{{{{{{{{\rm{g}}}}}}}}}\\ {{{{{{{{\rm{e}}}}}}}}}^{-(t-{t}_{{{{{{{{\rm{g}}}}}}}}})/\langle {t}_{{{{{{{{\rm{n}}}}}}}}}\rangle },\quad &t \, > \, {t}_{{{{{{{{\rm{g}}}}}}}}}\end{array}\right.\ ,$$
(8)

where 〈tn〉 is the average time elapsing until the first cluster nucleates (i.e., the first transition occurs); tg represents the time required for the global state ρ to reach 0.5 after the first cluster emerges, and this time depends on the linear size of the system, tg ~ N1/2/v, where v is the constant radial velocity. Also, 〈tn〉 ~ (IN)−1, where I is the nucleation rate per unit area. The average transition time from the initial undesired state to the desired state or the average lifetime of the initial state is expressed as 〈τ〉 = 〈tn〉 + tg. For small system sizes or in the weak-noise limit, the dominant term in the lifetime is the nucleation time, hence 〈τ〉 ~ (IN)−1 (see Supplementary Note 3 for details).

In contrast, for large systems, more than one independent cluster nucleates and expands separately, leading to the multi-cluster mode. Spatial self-averaging reduces randomness of the global state ρ, making each individual τ closer to the average value and pushing Pnot closer to a step function. In the large system-size limit, the lifetime distribution is narrowly centered about the average. Based on Avrami’s Law, for sufficiently large systems28,29,30,31,35,36, the evolution of ρ can be expressed in a deterministic form as \(\rho =1-{{{{{{{{\rm{e}}}}}}}}}^{-\frac{\pi {v}^{2}I}{3}{t}^{3}}\). By setting ρ = 0.5 (without loss of generality), the average lifetime for the multi-cluster mode can be obtained as \(\langle \tau \rangle ={\left(\frac{3{{{{{{\mathrm{ln}}}}}}}\,2}{\pi {v}^{2}I}\right)}^{1/3}\). Then the evolution of ρ can be described by

$$\rho =1-{{{{{{{{\rm{e}}}}}}}}}^{-{\left(\frac{t}{\langle \tau \rangle }\right)}^{3}{{{{{{\mathrm{ln}}}}}}}\,2}.$$
(9)

Resilience restoration of mutualistic systems

To verify the predictions by nucleation theory about noise-induced transition patterns in systems with alternative stable states, we first study resilience restoration of the mutualistic system.

We use Eq. (10) as the deterministic dynamics to track the abundance of one species distributed among a square lattice in the mutualistic system52,53. The self-dynamics F(xi) describes that the growth of the species in each location follows the logistic law with the Allee effect, and the dynamics G(xi, xj) accounts for the mutualistic interaction between the species in two neighboring locations i and j through the interaction strength Aij defined in Eq. (5).

$$\begin{array}{ll}&F({x}_{i})={B}_{i}+{x}_{i}\left(1-\frac{{x}_{i}}{{K}_{i}}\right)\left(\frac{{x}_{i}}{{C}_{i}}-1\right)\\ &G({x}_{i},{x}_{j})=\frac{{x}_{i}{x}_{j}}{{D}_{i}+{E}_{i}{x}_{i}+{H}_{j}{x}_{j}}.\end{array}$$
(10)

Note that we use the same parameters as Ref. 3. The parameters are node-uniform and set as Bi = B = 0.1, Ci = C = 1, Di = D = 5, Ei = E = 0.9, Hj = H = 0.1, Ki = K = 5, and the interaction strength R = 1 (leading to the effective interaction strength βeff = 4). At some moment, if the species in all locations are trapped in the low stable state xL, they will stay at this state forever if there is no action or perturbation. It is, for sure, not desired from the ecological viewpoint. If one would like to keep the system always in the high stable state xH, a straightforward approach is to increase the interaction strength to ensure that βeff is larger than the critical bifurcation value \({\beta }_{{{{{{{{{\rm{c}}}}}}}}}_{2}}\). In this case, the system will be attracted to the high state no matter where it starts. Alternatively, noise has shown the ability to induce the transition between two stable states from the study of one-variable systems. We are particularly interested in how noise assists the resilience restoration (i.e., transferring the system from the undesirable state xL to the desired state xH).

Let us consider the case when all nodes in the system start from the low state xL, indicating a collapsed state. Observed from simulations, the proper noise can excite some node to xH, and such transition spreads out to its neighbors via interaction until the rest of the system completes transitions. According to homogeneous nucleation theory, for different system sizes and nucleation rates, two possible transition patterns are present. We successfully show the snapshots of two cluster modes by numerical simulations, the single-cluster and multi-cluster mode. One can notice that these two modes possess radically distinct properties. For the single-cluster mode (Fig. 2a), there is only one node that switches from xL to xH in the beginning, and the rest of nodes shift to xH through the interactions with the neighbors which have already transitioned; while for the multi-cluster mode (Fig. 2e), there is more than one node in the separate location that transfers to xH simultaneously. This is expected as for the large system, there are enough candidates to receive fluctuations, increasing the chance to induce independent transitions.

Fig. 2: Single-cluster and multi-cluster modes in the mutualistic system.
figure 2

a One snapshot for the state value ρi of each node under the noise strength σ = 0.1 (σ is defined by the standard deviation of noise distribution). The color scale is used to represent the values of normalized state ρi (defined in Eq. (2), and it is unitless) from the undesired state (ρi = 0) to the desired state (ρi = 1). Initially, all of the nodes are at the low state. At some time later, the transition to the high state occurs to one node, which is treated as a single cluster. Such transition then spreads out to its neighbors. b The evolution of the global state ρ for 100 realizations of the single-cluster mode. c The probability distribution of waiting time Pnot for the fixed system size and various noise strengths σ = 0.08, 0.09, 0.1. The single dots are simulation data, and different types of lines are obtained by linear fit according to Eq. (8). d The evolution of the average global state ρ using the same data as in c. e One snapshot shows the state ρi of each node for σ = 0.1. Different from a, the transition from the initial low state to the high state occurs at several separate nodes, and they expand independently, forming the multiple cluster. f The evolution of the global state ρ for 100 realizations, which are more centered around a certain value instead of being random in b. g The distribution Pnot for σ = 0.08, 0.09, 0.1, which approaches the step function as σ increases. h The evolution of the global state ρ averaged over 100 realizations using the same data as in g. The single dots are simulation data, and different types of lines are obtained by linear fit according to Eq. (9).

As predicted by nucleation theory, the evolution of ρ(t) for the single-cluster mode and multi-cluster mode differs a lot, and numerical results confirm the difference. Figure 2b, f display 100 realizations for system sizes N = 100 and N = 10,000 under the same intensity of noise. For the single-cluster mode (Fig. 2b), the evolution varies for individual realizations, so the transition times are different, indicating the uncertain evolution feature. In contrast, for the multi-cluster mode (Fig. 2f), the evolution of ρ(t) is similar for different realizations, implying that the evolution is deterministic in the infinite system-size limit. Following this, the waiting time distribution Pnot for two cluster modes is also verified (Fig. 2c). For the single-cluster mode, Pnot is initially constant and then decreases exponentially with respect to t verifying Eq. (8). The slope of the distribution gets more negative as noise becomes stronger suggesting a larger nucleation rate. For the multi-cluster mode, Pnot gets closer to a step function (Fig. 2g) as noise strength increases. This is because the larger nucleation rate induces more separate clusters for a given system size and thus leads to the more deterministic evolution by self-averaging. From the theoretical analysis, the global state ρ for the multi-cluster mode evolves predictably according to Eq. (9). Whereas, for the finite-size system, the evolution of the multi-cluster mode (Fig. 2h) is not perfectly deterministic, but still much less random than the single-cluster mode (Fig. 2d).

The cluster mode not only depends on the system size but also relies on the nucleation rate, which is decided by noise strength. Typically, large systems under strong noise belong to the multi-cluster mode, while small systems under weak noise exhibit the single-cluster mode. However, low nucleation rates resulting from weak noise can induce the single-cluster mode even for a very large system (Fig. 3a, b). Also, the average nucleation time 〈tn〉 = (NI)−1 for the single-cluster mode is validated. The average lifetime 〈τ〉 behaves differently for the two cluster modes and exhibits two regimes (Fig. 3c), and its value increases exponentially as σ−2 increases for both cluster modes as predicted by Eq. (15). For the given dynamics, 〈τ〉 entirely depends on the system size N and noise strength σ (Fig. 3c, d), and there is a decrease as N or σ increases. One can also notice that the slope of \({{{{{{\mathrm{ln}}}}}}}\,\langle \tau \rangle\) as a function of σ−2 for the single-cluster mode is larger than the slope for the multi-cluster mode.

Fig. 3: The influence of system size N and noise strength σ on transition modes and average lifetime 〈τ〉.
figure 3

Initially, all of the nodes are at the low state xL, and the time to switch to the high state xH is measured. a The average nucleation time 〈tn〉 changes with noise strength for different system sizes N = 9, 100, 900, 2500, 10,000. b The linear relationship between the average nucleation time 〈tn〉 and N−1. c Two regimes with different slopes of \({{{{{{\mathrm{ln}}}}}}}\,\langle \tau \rangle\) as a function of σ−2, which corresponding to two cluster modes. It shares the same legend as a. c and d summarize the effects of system size N and noise strength σ on the average lifetime 〈τ〉. The increase of noise strength lowers the average lifetime. For the single cluster mode, the larger system requires less time to complete transitions.

In accord with the scaling theory (see the “Methods” section, Eqs. (15)–(17)), the two distinct cluster-growth modes are separated by a crossover region centered around N1/2 ~ R0 (Fig. 4a). One should note that this crossover (centered around the dashed curve in Fig. 4a) is not a sharp transition separating the two cluster-growth modes. The gradual change of the background color (red-white-blue) is to qualitatively illustrate the continuous nature of the crossover from the single-cluster mode to the multi-cluster mode. The small system (Fig. 4b) or weak noise induces (Fig.  4c) the single-cluster mode, while the large system or relatively strong noise (Fig. 4d, e) produces the multi-cluster mode. According to the proposed scaling function, employing and plotting properly scaled variables, \(\langle \tau \rangle {{{{{{{{\rm{e}}}}}}}}}^{-\frac{c}{3{\sigma }^{2}}}\) vs. \({{{{{{{{\rm{e}}}}}}}}}^{\frac{c}{3{\sigma }^{2}}}/{N}^{\frac{1}{2}}\), we expect that all numerical data would collapse onto a single curve, capturing general nucleation behavior54.

Fig. 4: Crossover between two cluster modes for the sample mutualistic system.
figure 4

Initially, all of the nodes are at the low stable state xL, and they are driven to the high stable state xH in the presence of noise. a According to Eq. (15), two cluster modes are distinguished. The dashed curve is drawn according to the equation \({N}^{1/2}={{{{{{{{\rm{e}}}}}}}}}^{\frac{c}{3{\sigma }^{2}}}\), where c is a constant decided by the dynamics. The gradual change of the background color (red-white-blue) is to qualitatively illustrate the continuous nature of the crossover from the single-cluster mode to the multi-cluster mode. The dashed curve corresponds to the center of the crossover region (provided by the above formula), separating the two cluster-growth modes. b and c describe the single-cluster mode (in red), while d and e display the multi-cluster mode (in blue). b The distribution Pnot for the fixed noise strength σ = 0.1 and different system sizes N = 9, 16, 25, 36, 49, 64, 81, 100. c Pnot for the fixed weak noise σ = 0.06 and N = 100, 900, 2500, 10,000. In both b and c, the single dots are simulation data, and different types of lines are obtained by linear fit according to Eq. (8). d Pnot for the fixed noise strength σ = 0.1 and different system sizes N = 900, 2500, 10,000. e The evolution of the global state ρ using the same data as in d.

Nevertheless, observed in Fig. 5a, for the multi-cluster mode, 〈τ〉 is not precisely proportional to I−1/3. Therefore, the two transition modes cannot be scaled in a satisfactory fashion as the scaled data for the multi-cluster regime is not constant (Fig. 5b), which contradicts the assumption of Eq. (16) (see the “Methods” section). The deviation from Avrami’s Law suggests that the assumption(s) of homogeneous nucleation might be violated. For a large system subjected to relatively strong noise, which guarantees the multi-cluster mode, the nucleation rate changes in the beginning (Fig. 5c), defying the assumption of constant nucleation rate. The initial rise of the spatially distributed low state for the nodes which have not been driven to the high state indicates that the initial state is not the precise metastable state. In the presence of noise, the metastable state is a state distribution where all nodes are around the low state ρL, but some nodes are closer to the unstable state ρu and some are even below the state ρL. The system in the presence of noise needs time to reach the actual metastable state which is different from the mean-field low-stable state. To keep the nucleation rate constant, one should use the metastable configuration as the initial condition. However, as seen in Fig. 5c, some cluster have already emerged before the system reaches the metastable configuration indicated by the increase of the average low state and the nucleation rate, so that the preprocessing of the initial state is needed to forbid any transition before the metastable configuration is constructed. One can artificially prepare the system close to the metastable state by reverting the node back to ρL if any other sites nucleate during preprocessing.

Fig. 5: Scaling between two cluster modes in the mutualistic system.
figure 5

For ac, the system starts from the low state xL, and the time to reach the high state is characterized by τ. a The relationship of 〈τ〉 and \({{{{{{{{\rm{e}}}}}}}}}^{-\frac{c}{{\sigma }^{2}}}\) differs between two cluster modes, where c is a constant specific to the dynamics and σ is the standard deviation of noise. a, b, e, and f share the same legend. b The finite-size scaling is drawn by assuming the slope of multi-cluster mode in a is \(-\frac{1}{3}\). For c and d, the system size is set as N = 10,000 and the noise strength is σ = 0.08. c The nucleation rate increases before the average low-state nodes stabilizes. d The system starts to evolve from xL and the prepared state, respectively. The single dots are simulation data, and different types of lines are obtained by linear fit according to Eq. (9). The related uncertainty can be calculated by the standard deviation \({{{{{{{\rm{std}}}}}}}}=\sqrt{\frac{1}{n-2}\mathop{\sum }\nolimits_{i = 1}^{n}{({{{{{{\mathrm{log}}}}}}}\,(1-{\rho }_{{{{{{{{\rm{fitted}}}}}}}}})-{{{{{{\mathrm{log}}}}}}}\,(1-{\rho }_{{{{{{{{\rm{simulation}}}}}}}}}))}^{2}}\) between the fitted state and the simulated state, where n is the number of data for the linear fit. The uncertainties are 0.42 and 0.09 for the initial state being xL and the prepared state, respectively. With the slope being fitted, the global state evolution for the latter case agrees better with Eq. (9) than the former case. For eh, the system starts from the prepared metastable state, and the time to reach the state xH is recorded as τ. e The average lifetime 〈τ〉 for two cluster modes. f The finite-size scaling is consistent with the theoretical prediction in Eq. (17). g The nucleation rate takes less time to stabilize compared with c. h The evolution of the global state ρ for the multi-cluster mode when N = 10,000 and σ = 0.08, 0.085, 0.09, 0.095, 0.1. The uncertainties of linear fit are std = 0.09, 0.14, 0.13, 0.13, 0.15, respectively.

To gain further insight into the source of this discrepancy, we carried out simulations with the initial configurations being very close to the metastable state. In such a case, the nucleation rate I stabilizes much faster (Fig. 5g) compared with the system without preprocessing. Afterward, the nucleation rate is roughly constant, so homogeneous nucleation theory can be reliably applied. This leads to a better agreement between the simulation and the theory, as the evolution of ρ is closer to what Eq. (9) postulates (Fig. 5d, h), and the data from the two cluster modes follows the scaling function (Fig. 5e, f). It is expected that the average lifetime 〈τ〉 agrees better with Eq. (15) if the metastable state can be perfectly prepared.

Restoration of diffusion dynamics

To further validate the proposed theory, we adapt three well-studied ecological models exhibiting alternative stable states55,56 with diffusive interaction and then apply the above theory to investigate the transition features. The self-dynamics for three diffusion models are defined below.

The harvesting model in Eq. (11) describes the growing resource biomass with fixed grazing rate10. The first term on the right-hand side of Eq. (11) describes logistic growth, where r is the maximum growth rate, and K is the carrying capacity. The second term is the “Holling’s type III” consumption function57. The system transitions from an underexploited state to overexploited state as the harvesting rate β exceeds a certain critical value.

$$F({x}_{i})=r{x}_{i}\left(1-\frac{{x}_{i}}{K}\right)-\beta \frac{{x}_{i}^{2}}{{x}_{i}^{2}+1}$$
(11)

The eutrophication model in Eq. (12) describes the dynamics of nutrient concentration in the eutrophic lake58. The variable xi represents the density of phosphorus mass (nutrient) in the location i of the lake. The first term a on the right hand side of Eq. (12) is the nutrient loading rate, the second term describes nutrient loss processes with the rate r, and the last term accounts for recycling processes following a sigmoid function. As the maximum recycling rate β increases to the critical point, the lake transfers from oligotrophic to eutrophic.

$$F({x}_{i})=a-r{x}_{i}+\beta \frac{{x}_{i}^{8}}{{x}_{i}^{8}+1}$$
(12)

The vegetation-turbidity model in Eq. (13) describes the vegetation dynamics considering turbidity59. The variable xi represents the density of aquatic vegetation in the location i of the lake. The first term on the right-hand side of Eq. (13) characterizes the growth of vegetation with the maximum growth rate rv. The function E is an inverse Monod function and used to describe the vegetation effect on turbidity. Accordingly, the second term is a Hill function describing the sigmoidal decline of vegetation with turbidity. As the water becomes turbid, indicated by the background turbidity β, macrophytes suddenly decrease.

$$F({x}_{i}) = \, {r}_{{{{{{{{\rm{v}}}}}}}}}{x}_{i}-{r}_{{{{{{{{\rm{v}}}}}}}}}{x}_{i}^{2}\frac{{r}^{4}+{E}_{i}^{4}}{{r}^{4}}\\ {E}_{i} = \, \frac{{h}_{{{{{{{{\rm{v}}}}}}}}}\beta }{{h}_{{{{{{{{\rm{v}}}}}}}}}+{x}_{i}}$$
(13)

All three models can exhibit alternative stable states with the properly chosen bifurcation parameter β as illustrated in Fig. 7a, e, i. The transition from the low stable state to the high stable state is possible in the presence of noise for such single-variable systems. Likewise, the underlying topology is also a square lattice with periodic boundaries. The interaction dynamics is defined in Eq. (14), which represents the diffusive process between adjacent neighbors, and the interaction strength R determines the uniform diffusion rate. The species density at each location varies according to the internal dynamics as defined in Eqs. (11)–(13), and it is also influenced by dispersion to or immigration from neighbors and stochastic environmental fluctuations.

$$G({x}_{i},{x}_{j})={x}_{j}-{x}_{i},$$
(14)

Once the system degrades to a malfunctioning state, resilience restoration is required. In the presence of noise, each component is likely to be driven from the undesired state to the functional stable state, and then the entire system undergoes substantial changes due to the transition of one or a few nodes. Nucleation theory can be employed as well to study the overall transition features. The results we collected from three diffusion models are similar to those obtained from the mutualistic system and thus verify the predictions by nucleation theory. We consider the case when the undesired state has a much smaller basin of attraction than the desired state so that noise can drive the system from the initial undesired state to the functional state, resulting in resilience restoration.

Take the harvesting model as an example to illustrate the successful application of nucleation theory to resilience restoration. Two cluster-growth modes are observed and separated by a crossover around N1/2 ~ R0 (Fig. 6a). Similar to the mutualistic system, the large system or strong noise produces multi-cluster mode; conversely, the small system or weak noise induces single-cluster mode. For the small system (N = 100 in the example), there is only one cluster formed during the transition, exhibiting the single-cluster pattern. The individual lifetime τ in Fig. 6b varies a lot for different realizations, indicating a stochastic feature. As derived above, the distribution of waiting times Pnot follows an exponential function after a certain period tg, observed in Fig. 6c,d. If the system is exposed to weak noise which means a low nucleation rate, it is very likely to enter the single-cluster regime even the size is sufficiently large (Fig. 6d). For the large system (like N = 10,000) with proper intensity of noise, more than one node in the separate location is recovered simultaneously, presenting a multi-cluster pattern. Spatial-averaging reduces randomness so that the individual lifetime τ is more centered about a certain value (Fig. 6e). The evolution is much more deterministic than the system in a single-cluster mode. The global state ρ evolves approximately as Eq. (9) predicts (Fig. 6f). If the applied noise is strong enough, the moderate-sized system can still exhibit the multi-cluster mode (Fig. 6g).

Fig. 6: Single-cluster and multi-cluster modes in the harvesting system.
figure 6

The parameters are set as r = 1 (defined as the maximum growth rate), K = 10 (defined as the carrying capacity), the diffusion rate R = 0.02, and the bifurcation parameter β = 1.8. Initially, all of the nodes are at the low stable state ρL, and they are driven to the high stable state ρH in the presence of noise. a Two insets describe the snapshots of individual normalized state values ρi for the single-cluster and multi-cluster mode, respectively. They are separated by a crossover region centered around the curve \({N}^{1/2}={{{{{{{{\rm{e}}}}}}}}}^{\frac{c}{3{\sigma }^{2}}}\), where c is a constant decided by the dynamics, and σ is the standard deviation of noise (noise strength). As in Fig. 4, the gradual change of the background color (red-white-blue) is to qualitatively illustrate the continuous nature of the crossover from the single-cluster mode to the multi-cluster mode. bd are about the single-cluster mode. b 100 realizations of the global state evolution (state ρ changes with time t) for the system size N = 100 and the noise strength σ = 0.045. c The distribution of waiting time Pnot for the fixed system size N = 100 and the varied noise strengths σ = 0.04, 0.043, 0.045. d Pnot for the fixed weak noise σ = 0.035 and different system sizes N = 100, 900, 2500, 10,000. eg correspond to the multi-cluster mode. e 100 realizations of the global state evolution for the system size N = 10,000 and the noise strength σ = 0.045, which are more centered around a certain value instead of being random in b. f The evolution of ρ averaged over 100 realizations for different noise strengths σ = 0.04, 0.043, 0.045. g The evolution of the global state ρ averaged over 100 realizations for the fixed strong noise σ = 0.045 and large system sizes N = 900, 2500, 10,000.

As seen in Fig. 7, the system size and noise strength decide the recovery time and the cluster mode. Similarly, the average lifetime 〈τ〉 of three diffusion models displays two distinct regimes. One is the single-cluster and the other is the multi-cluster regime (Fig. 7a, d, g). The slope of \({{{{{{\mathrm{ln}}}}}}}\,\langle \tau \rangle\) versus σ−2 reveals which mode is active. If the system starts from the undesired stable state, the scaling between two cluster modes deviates a little from the theoretical prediction (Fig. 7b, e, h). If the system starts from the prepared state, resembling the metastable configuration, the scaling agrees well with the designed scaling function (Fig. 7b, e, h). Overall, the conclusions of the single-cluster and multi-cluster transition are validated in three diffusion models.

Fig. 7: Average lifetime 〈τ〉 and the scaling results for three diffusion models.
figure 7

The diffusion rate is set as R = 0.02. ad harvesting model, r = 1 and K = 10; eh eutrophication model, a = 0.5 and r = 1; il vegetation model, r = 1, rv = 0.5, hv = 0.2. a, e, and i are the resilience diagrams. These models exhibit alternative stale states for a β (1.79, 2.60), e β (0.86, 6.35), and i β (2.59, 3.64). The arrows represent transitions from the low stable state to the high stable state. In simulation, the bifurcation parameter β takes values of 1.80, 6.00, 2.60 for a, e, and i, respectively. For b, f, and j, the system starts from the undesired states xL, and the average lifetime 〈τ〉 changes with N and σ. For e, g, and k, the system starts from the undesired states xL, the lifetimes of two clusters and the crossover are shown in the scaling form. For d, h, and l, the system starts from the prepared metastable states, the lifetimes of two clusters and the crossover are shown in the scaling fashion.

Discussion

We have utilized nucleation theory to analyze the noise-induced resilience restoration in ecosystems where the desired state has a much larger basin of attraction than the undesired state has. This is a general theory, and we successfully apply it to four ecological models, revealing the transition features. During the restoration process, homogeneous nucleation theory distinguishes two different cluster modes: the single-cluster and multi-cluster transition modes. We also derive the formulas for the recovery time under different conditions and propose a scaling function that collapses all the data onto one universal line.

The two cluster modes possess quite distinct features. The individual lifetime is random for the single-cluster phase, and the waiting time before the transition follows an exponential distribution. In contrast, for the multi-cluster mode, the lifetime is less random and centered about its average value so that the evolution of the global state ρ is more deterministic. Which cluster mode the system follows is decided by its size and noise strength, and the crossover region is theoretically derived and can separate two phases. Generally, the large system subjected to strong noise presents the multi-cluster mode, and the small system with weak noise displays the single-cluster regime. One quantity of interest for resilience restoration is the recovery time, which also depends on the system size and the noise strength. The rise of noise strength increases the nucleation rate, diminishing 〈τ〉. There is no finite-size effect when noise is strong enough; that is, 〈τ〉 is the same for different system sizes. The decrease of noise strength reveals the size effect, where larger systems take less time to complete transitions than smaller systems on average. Due to the distinct evolution features, the relationship between 〈τ〉 and σ varies for two cluster modes. What can be clearly seen in Fig. 3 and Fig. 7a, d, g, is that 〈τ〉 exhibits two distinctive regimes, corresponding to two cluster modes. The scaling between two cluster modes is proposed according to Avrami’s Law. The deviation observed in numerical simulation can be corrected by preparing the initial state close to metastable configurations to satisfy two homogeneous nucleation assumptions.

Employing the nucleation theory, we successfully extend the noise-induced transition in single-variable systems to spatially extended multi-variable systems. Our framework is useful to predict critical transitions and guide the resilience restoration in the general dynamical systems presenting alternative stable states. One may wonder how the mean-field theory works in noisy environments as the noise-induced transition in single-variable systems has been well explored. The mean-field approach makes a satisfactory prediction of the system state when the system is close to the stable states. Unfortunately, it cannot capture the transition features observed in spatially-extended systems, including the average lifetime, the dependence on the system size, and the spatial-clustering patterns (see Supplementary Note 2 for the results of mean-field theory and the comparisons with the nucleation approach.). Therefore, it is still an open question whether the mean-field theory can be used to study transitions in noisy environments. One may need to develop other dimension reduction approaches for this problem. Also, there are further questions to be addressed. For example, we analyze the transition in the lattice model. In reality, the interaction relationship in ecosystems exhibits various structures. In addition, the interaction strength between components in the real-world complex systems varies, which may add to the difficulty of analysis. Furthermore, we focus on the one-way transition, which requires that the system be close to the theoretical bifurcation point where the basin of attraction of the undesired state vanishes. For the case when two alternative stable states have basins of attraction of similar sizes, stochastic switching (namely back-and-forth switching) between states may arise, which is beyond the scope of this study. In summary, network topology (in addition to spatial structure), coupling strength, and stochastic switching are of great interest to be investigated in future studies.

Methods

Scaling law of single-cluster and multi-cluster modes

According to Avrami’s Law and homogeneous nucleation in finite systems33,38,39, the average lifetime of two transition modes is summarized as

$$\langle \tau \rangle \sim \left\{\begin{array}{ll}\frac{1}{IN},\quad &{N}^{\frac{1}{2}}\ll {R}_{0}\quad (\,{{\mbox{single-cluster mode}}}\,)\\ {I}^{-\frac{1}{3}},\quad &{N}^{\frac{1}{2}}\gg {R}_{0}\quad (\,{{\mbox{multi-cluster mode}}}\,)\end{array}\right.\ ,$$
(15)

where \({R}_{0} \sim {(\frac{v}{I})}^{1/3} \sim {I}^{-1/3}\) is the typical distance between separate clusters (and N1/2 is the linear size of the two-dimensional lattice). Transition patterns for different system sizes and nucleation rates are classified into two distinct cluster nucleation modes, separated by a crossover region centered around the curve, N1/2 ~ R0. Small systems or low nucleation rates induce the single-cluster mode, while large systems or high nucleation rates exhibit the multi-cluster mode.

By constructing a scaling function54 with the following asymptotic behavior:

$$S(u) \sim \left\{\begin{array}{ll}{u}^{2},\quad &u\gg 1\quad (\,{{\mbox{single-cluster mode}}}\,)\\ {{{{{{{\rm{const.}}}}}}}},\quad &u\ll 1\quad (\,{{\mbox{multi-cluster mode}}}\,)\end{array}\right.\ ,$$
(16)

where u = R0/N1/2 ~ v1/3/(I1/3N1/2) ~ I−1/3N−1/2, one can capture the average lifetime of any system size and nucleation rate (including the crossover between the single-cluster and multi-cluster regimes),

$$\langle \tau \rangle ={I}^{-\frac{1}{3}}S\left({R}_{0}/{N}^{\frac{1}{2}}\right)={I}^{-\frac{1}{3}}S\left({I}^{-\frac{1}{3}}{N}^{-\frac{1}{2}}\right)\ .$$
(17)

Motivated by the study on the average transition time 〈τ〉 for single-variable systems [Eq. (4)], the relationship between local nucleation rate and noise strength in spatially extended systems is expected to scale as

$$I \sim {{{{{{{{\rm{e}}}}}}}}}^{-\frac{c}{{\sigma }^{2}}},$$
(18)

where c is a constant specific to the given dynamics and can be empirically fitted in the weak-noise case. In turn, the average lifetime 〈τ〉 for different system sizes and noise strength can be described by a universal scaling function: employing Eqs. (17) and (18), when plotting \(\langle \tau \rangle {{{{{{{{\rm{e}}}}}}}}}^{-\frac{c}{3{\sigma }^{2}}}\) vs. \({{{{{{{{\rm{e}}}}}}}}}^{\frac{c}{3{\sigma }^{2}}}/{N}^{\frac{1}{2}}\), all curves should collapse on the same curve S(u).