We developed a generative in silico framework to investigate interactions among large-scale neural dynamics, peripheral physiology, and metabolic energy regulation. The model combines networks of coupled nonlinear neural oscillators with a simulated cardiac signal and a dynamical energy variable that both constrains and is modulated by neural activity. Simulations were implemented in Python using standard scientific computing libraries, including NumPy, SciPy, and scikit-learn18.
The framework generates synthetic populations in which subject-level variability in age, coupling strength, and noise produces heterogeneous patterns of brain–body–energy coordination. This approach allows systematic examination of how emergent system dynamics relate to metabolic stability and cognitive proxy measures.
Network construction
Structural connectivity was modeled using multiple canonical network topologies to ensure that results were not dependent on a specific architecture. Small-world networks were generated using the Watts–Strogatz procedure21. Because larger networks were not tested, conclusions about network-size robustness are limited to the 40–120-node range. Baseline Watts–Strogatz networks were generated with degree parameter k = 6 and rewiring probability p = 0.20. Network sizes of 40, 80, and 120 nodes were selected to assess the sensitivity of the model results to network scale while allowing repeated stochastic realizations across network conditions. Connectivity was normalized by the spectral radius to maintain comparable dynamical scaling across network sizes. Each network was subsequently symmetrized and constrained to have zero diagonal entries. Independent network realizations were generated using network-specific random seeds. In addition, random networks were constructed as sparse symmetric matrices, and lattice networks were generated with regular nearest-neighbour connectivity. All adjacency matrices were symmetrized, had zero diagonal entries, and were normalized by the magnitude of their largest eigenvalue to maintain comparable dynamical regimes across network sizes. The graph Laplacian was computed from each normalized connectivity matrix and used to define coupling between neural populations:
$$ \tilde{W} = \frac{W}{{{\text{max}}\left| {\lambda \left( W \right)} \right| + \epsilon }},L = D – \tilde{W}, D_{ii} = \mathop \sum \limits_{j} \tilde{W}_{ij} . $$
(1)
Each adjacency matrix \(W\) was normalized by its spectral radius, \(\max \left| {\lambda \left( W \right)} \right|\), to place networks of different sizes and topologies on a comparable coupling scale. The degree matrix \(D\) was defined by \(D_{ii} = \sum\nolimits_{j} {\tilde{W}_{ij} }\), and the graph Laplacian was calculated as \(L = D – \tilde{W}\). The Laplacian was used to model diffusive coupling between neural oscillators.
Peripheral physiological dynamics
Peripheral physiology was represented by a stochastic cardiac oscillator. The oscillator phase evolved at a constant intrinsic frequency with small Gaussian perturbations:
$$ \phi \left( {t + {\Delta }t} \right) = \phi \left( t \right) + 2\pi f{\Delta }t + \xi \left( t \right), $$
(2)
where \(\xi \left( t \right) \sim {\mathcal{N}}\left( {0,\sigma^{2} } \right)\). The observable cardiac signal was defined as:
$$ h\left( t \right) = {\text{sin}}\left( {\phi \left( t \right)} \right). $$
(3)
This signal provided a time-varying input to the neural dynamics and contributed to metabolic energy production, thereby linking peripheral physiology with neural activity and energetic regulation. Respiration was modeled as a stochastic sinusoidal oscillator representing a low-frequency physiological rhythm. The oscillator had a baseline frequency of 0.25 Hz, and its phase was updated at each simulation step using the fixed frequency and additive Gaussian phase noise (SD = 0.005). The resulting signal served as the respiration time series and was incorporated into the brain dynamics via a body-coupling term, alongside the cardiac signal.
Neural dynamics
Neural activity was simulated using a network of coupled Stuart–Landau nonlinear oscillators. Each node \(z_{i} \left( t \right)\) followed:
$$ \dot{z}_{i} = \left( {0.02 + i\omega_{i} – \left| {z_{i} } \right|^{2} } \right)z_{i} – G\mathop \sum \limits_{j} L_{ij} z_{j} + \left( {K_{b} h\left( t \right) + K_{e} E\left( t \right)} \right)z_{i} + \sigma \eta_{i} \left( t \right), $$
(4)
where \(\omega_{i}\) are intrinsic frequencies, \(G\) is the global coupling strength, and \(\eta_{i} \left( t \right)\) is complex Gaussian noise22.
Neural activity was quantified as power \(p_{i} \left( t \right) = \left| {z_{i} \left( t \right)} \right|^{2}\), and global activity was defined as:
$$ P\left( t \right) = \frac{1}{N}\mathop \sum \limits_{i} \left| {z_{i} \left( t \right)} \right|^{2} . $$
(5)
Energy dynamics
Metabolic energy availability was modeled as a dynamical variable representing the balance among production, consumption, and decay9,23.
$$ \frac{dE}{{dt}} = \left( {0.4 + 0.2\,h\left( t \right)} \right) – 0.05\,P\left( t \right) – \gamma E\left( t \right). $$
(6)
Energy production is driven by cardiac input; neural activity determines consumption; and \(\gamma \) controls age-dependent decay. Energy feeds back into neural dynamics through multiplicative modulation, producing bidirectional brain–body–energy coupling.
Age-dependent parameterization
To capture lifespan variability, key parameters were modulated as smooth functions of age. Global coupling followed a midlife peak:
$$ G\left( a \right) = G_{0} {\text{exp}}\left( {\frac{{\left( {a – 40} \right)^{2} }}{{2\sigma_{a}^{2} }}} \right), $$
(7)
while noise and decay increased with age:
$$ \sigma \left( a \right) = \sigma_{0} + \alpha a,\gamma \left( a \right) = \gamma_{0} + \beta a. $$
(8)
Age was sampled between 20 and 80 years continuously, producing inter-individual variability without discrete grouping.
Simulation procedure and dataset generation
Simulations were performed across multiple network sizes, topologies, coupling strengths, and random seeds. For each subject, neural and physiological initial conditions were randomly assigned, and the coupled differential equations were integrated using Euler–Maruyama updates with a fixed time step \(\Delta t = 0.05\).
This procedure produced large synthetic datasets spanning heterogeneous dynamical regimes, reducing sensitivity to initial conditions and specific network instantiations.
Global brain dynamic signal
The global brain dynamic signal was calculated to represent the overall temporal activity of the simulated brain network. Each brain node was modeled as a complex oscillator, and its instantaneous activity was defined as:
$$ P_{i} \left( t \right) = \left| {z_{i} \left( t \right)} \right|^{2} $$
(9)
where zi(t) is the complex state of node i at time t. The global brain signal was then computed as the average activity across all N brain nodes:
$$ B\left( t \right) = \frac{1}{N}\mathop \sum \limits_{i = 1}^{N} P_{i} \left( t \right) $$
(10)
where B(t) represents the whole-network brain activity over time. This global signal captures the emergent slow brain fluctuations in the activity of the simulated brain network and was used as the primary measure of brain dynamics.
Brain body dynamic model
In this framework, the brain–body system is conceptualized as a dynamically coupled neurophysiological system in which neural activity interacts bidirectionally with cardiac, respiratory, and energetic/metabolic processes.
The two-coupling metrics were used as complementary measures that reflect the distinct objectives of the models: phase-based brain–body coupling in the initial model and rank-based brain–coordination.
First, brain–body coupling was quantified as phase coherence between global neural activity and the peripheral physiological signals24:
$$ C_{hb} = \left| {\left\langle {e^{{i\left( {\theta_{P} \left( t \right) – \theta_{h} \left( t \right)} \right)}} } \right\rangle_{t} } \right|. $$
(11)
To assess the robustness of the findings to parameter choices, metric specification, and potential nonlinear relationships, brain–body coupling was quantified using non-parametric Spearman rank correlations that captured monotonic associations between global neural activity and cardiac and respiratory dynamics, as well as coupling between the two physiological oscillators (Tables 2, S3, S4, and Fig. S4). Specifically,
$$ \begin{aligned} \rho_{BH} & = {\text{Spearman}}\left( {P\left( t \right),H\left( t \right)} \right), \\ \rho_{BR} & = {\text{Spearman}}\left( {P\left( t \right),R\left( t \right)} \right), \\ \rho_{HR} & = {\text{Spearman}}\left( {H\left( t \right),R\left( t \right)} \right), \\ \end{aligned} $$
(12)
where \(H\left( t \right)\) and \(R\left( t \right)\) represent cardiac and respiratory activity, respectively. These three pairwise associations were combined into a composite brain–body coordination index:
$$ C_{{{\text{BB}}}} = \sqrt {\frac{{\rho_{BH}^{2} + \rho_{BR}^{2} + \rho_{HR}^{2} }}{3}} . $$
(13)
A measure of neural predictability was computed from the temporal variability of global activity:
$$ D_{P} = \frac{1}{{{\text{Var}}\left( {{\Delta }P\left( t \right)} \right)}}. $$
(14)
Energy efficiency and stability were summarized using the mean and variance of the energy trajectory:
$$ \mu_{E} = \left\langle {E\left( t \right)} \right\rangle_{t} ,\sigma_{E} = {\text{std}}\left( {E\left( t \right)} \right). $$
(15)
Synthetic cognitive-like measures
Cognition was operationalized using three complementary proxies to assess robustness and avoid circularity. In the primary formulation, cognition emerged from brain–body–energy interactions, integrating energy availability, variability, and physiological modulation (Figs. 1, 2). Two synthetic cognitive outcomes were defined to probe distinct aspects of the generative model. CogEnergy combined global coupling strength with summary statistics of the energy process (mean and variability), providing an energy-sensitive performance proxy that reflects joint neural–energetic dynamics. CogIndependent served as a control outcome, derived primarily from the simulated cardiac signal with added stochastic noise, and was designed to be only weakly coupled to brain and energy dynamics. Together, these measures allow comparison of energy-dependent and peripheral-driven variability25 based solely on neural system structure and dynamics. In this formulation, cognition was defined as:
$$ G_{{{\text{cog}}}} = 0.6\,G + 0.4\,D_{P} , $$
(16)
where G denotes the age-modulated coupling strength and D P represents neural predictability (Supplementary Fig. S1).
The third formulation was introduced to minimize circularity with energy-like variables and to assess the robustness of mediation effects across alternative outcome definitions under both ablation and perturbation conditions (Table S1). Cognitive performance was defined as the predictive accuracy of neural activity for an independent external signal. Specifically, a linear decoder was trained to predict the external state x from a time-lagged embedding of global neural activity b, and performance was quantified as the inverse mean-squared prediction error:
$$ C_{{{\text{cog}}}} = \left( {\frac{1}{T – 2}\mathop \sum \limits_{t = 2}^{T} \left( {x_{t} – \hat{x}_{t} } \right)^{2} + \epsilon } \right)^{ – 1} ,\hat{x}_{t} = \beta_{1} b_{t – 1} + \beta_{2} b_{t – 2} . $$
(17)
Predictive self-consistency model
To approximate a predictive dimension of brain computational resources, we introduce a novel active-inference-inspired proxy or Predictive Model based on neural self-predictability. Global neural activity was used to predict its future state with a simple autoregressive model, conceptually related to prior formulations of predictive coding, forward modelling, and dynamical inference in neural systems26.
First, global activity was defined as:
$$ P\left( t \right) = \frac{1}{N}\mathop \sum \limits_{i} \left| {z_{i} \left( t \right)} \right|^{2} . $$
(18)
A linear model was then trained to predict future activity:
$$ \hat{P}\left( {t + 1} \right) = \beta_{0} + \beta_{1} P\left( t \right) + \beta_{2} P\left( {t – 1} \right). $$
(19)
\(Predicitve model \) was quantified as inverse prediction error:
$$ {\text{MSE}} = \frac{1}{T}\mathop \sum \limits_{t} [\hat{y}\left( t \right) – y\left( t \right)]^{2} . $$
$$ Predictive\;self – Consistency\;model = \frac{1}{{{\text{MSE }}\left( {\hat{P}\left( {t + 1} \right),P\left( {t + 1} \right)} \right) + \epsilon }}. $$
(20)
This measure captures the degree to which neural dynamics contain structured temporal regularities that support accurate self-prediction and is interpreted as a surrogate of inference-like processing rather than a full variational free-energy formulation.
External prediction-based cognitive proxy
To further assess robustness and reduce circularity, we implemented an external-world prediction task. A stochastic nonlinear process generated an exogenous signal independent of the brain–body–energy system:
$$ x\left( {t + 1} \right) = 0.95\,x\left( t \right) + \epsilon \left( t \right). $$
(21)
Global neural activity was used to predict future states of this external signal:
$$ \hat{x}\left( {t + 1} \right) = {\mathcal{F}}\left( {P\left( t \right),P\left( {t – 1} \right)} \right), $$
(22)
where \({\mathcal{F}}\) is a linear regression model trained per subject. Cognitive performance was quantified as the inverse of the mean-squared prediction error. This proxy is fully independent of energy dynamics and physiological variables.
Statistical analysis
Associations between model-derived variables and cognitive measures were assessed using Pearson and Spearman correlation. Significance was evaluated using permutation testing, where outcome variables were randomly shuffled to generate null distributions.
Mediation analyses were performed using regression-based indirect effect models of the form \(X \to E \to Y\), where \(X \) denotes brain–body coupling or neural predictability and \(Y\) denotes cognitive outcomes. Indirect effects were estimated using bootstrap resampling, with confidence intervals derived from empirical distributions. Mediation was assessed using a standard causal framework in which each predictor was related to the mediator (a path), the mediator was related to the outcome while controlling for the predictor (b path), and the indirect effect was computed as the product of these paths (a × b). The direct effect (c′ path) represents the residual association between predictor and outcome after accounting for the mediator. Indirect and direct effects were estimated using linear regression models combined with nonparametric bootstrap resampling (1000 iterations) to obtain robust estimates and 95% confidence intervals (Fig. 2). In the Robustness analysis in Table S2, to quantify mediation, we implemented a regression-based indirect-effect framework in which energy served as a mediator between the predictors (brain–body coupling and neural predictability) and the cognitive outcomes. Indirect effects were computed as the product of regression coefficients along the paths X → E and E → Y. Uncertainty was assessed using nonparametric bootstrap resampling (2000 iterations) to obtain 95% confidence intervals. Statistical significance of mediation effects was evaluated by comparison to permutation-based null distributions. In addition, permutation tests (200 iterations) were used to estimate null distributions of indirect effects, and Z-scores were computed relative to these distributions.
Robustness was evaluated across network topologies, network sizes, parameter perturbations, and ablation conditions. The Brain Body, Predictive Model, and Null models were compared within a unified simulation framework by extracting three distinct signals from the same synthetic subjects Table S1: (i) brain–body coupling (Brain Body coherence between neural activity and heart-rate–like oscillations), (ii) neural predictive stability (Predictive Model derived from temporal smoothness of population activity), and (iii) a randomized control signal (Null, generated as Gaussian noise). All variables were standardized before analysis to ensure comparability across metrics. For each condition (Baseline, Perturbation, and Ablation), we computed four primary outcome measures: (1) the Pearson correlation (r) between each model signal and cognitive performance, (2) a mediation effect quantifying the indirect pathway from model signal to cognition through an internal energy variable, calculated as the product of linear regression coefficients for model → energy and energy → cognition paths, (3) a permutation-based null distribution of mediation values obtained by randomly shuffling observations 200 times to estimate chance-level effects (Null Mean and Null Std), and (4) a bootstrap confidence interval (2000 resamples) for the mediation estimate to assess robustness. Statistical significance was determined by whether the bootstrap confidence interval excluded zero (CI_excludes_0). Together, this framework allows a direct comparison of the Brain Body, Predictive Model, and Null conditions in terms of their predictive associations with cognition, their energy-mediated influences, and their deviations from the randomized baseline structure across baseline, perturbation, and ablation regimes.
Age-related trajectories
Age-related trajectories were examined using 5-year age bins spanning 20–85 years. For each age bin, the indirect association between each predictor (Brain-Body Model and Predictive Model) and Energy Efficiency, as well as the cognitive-energy outcome (CogEnergy), was estimated using a product-of-correlations approach. Specifically, the indirect effect was calculated as the Pearson correlation between the predictor and Energy Efficiency multiplied by the correlation between Energy Efficiency and CogEnergy. Uncertainty was quantified using 2000 bootstrap resamples with a fixed random seed, with 95% confidence intervals derived from the 2.5th and 97.5th percentiles of the bootstrap distributions. A Null Model was evaluated using the same procedure and served as the reference distribution. Predictor-specific bootstrap effects were compared with the corresponding null distribution, and age-specific p-values were corrected for multiple comparisons across age bins using the Benjamini–Hochberg false discovery rate (FDR) procedure, with an adjusted significance threshold of q < 0.05. Significant positive and negative local extrema were identified from the FDR-significant trajectories using peak detection and interpreted as lifespan peaks and troughs, respectively. The stability of the age-specific trajectories was additionally assessed using five-fold cross-validation with shuffled splits and a fixed random seed. For each fold, the indirect effect was recalculated within each age bin, and the mean and standard deviation across folds were used to characterize cross-validation stability. Energy Efficiency trajectories were summarized using age-bin means with 95% confidence intervals based on the standard error (Fig. 3) and using non-parametric methods (Fig. S4).
Age-bin predictive analysis
Predictive relationships between physiological, brain-dynamic, and cognitive variables were evaluated across the lifespan using age-stratified analyses. Participants were divided into 5-year age bins spanning approximately 20–85 years, and bins containing fewer than 20 participants were excluded from predictive modelling. Two cognitive outcomes were examined: CogEnergy and CogIndependent. Nine predictor models were compared, including individual Brain–Heart, Brain–Respiration, Heart–Respiration, Brain–Body, Global Signal, predictive model, and Energy Efficiency measures, as well as integrated physiological and full Brain–Body/Active Inference models. When a directly measured Global Signal variable was unavailable, a proxy was calculated by multiplying Brain–Body coupling and Energy Efficiency. For each age bin and outcome, predictive performance was estimated using Ridge regression (α = 1.0) preceded by standardization of predictor variables. Model performance was evaluated using 5-fold cross-validation with shuffled folds and a fixed random seed. Cross-validated coefficient of determination (R2), root mean squared error (RMSE), and mean absolute error (MAE) were calculated and averaged across folds. Age-specific models with fewer than 20 complete observations were not evaluated. Uncertainty in cross-validated R2 was estimated using 500 bootstrap iterations. For each iteration, participants were resampled with replacement, and the complete 5-fold cross-validation procedure was repeated. The 95% confidence interval was defined by the 2.5th and 97.5th percentiles of the bootstrap distribution. To characterize the relative contribution of individual predictors, standardized Ridge regression coefficients (β) were additionally estimated within each age bin. Predictors and outcomes were standardized before fitting the Ridge model, allowing coefficients to be compared across variables and age groups. Mean absolute standardized coefficients across age bins were used as a summary measure of predictor importance. Models were ranked according to their mean R2 across available age bins, and the best-performing model was identified separately for each age bin and cognitive outcome. Predictive trajectories, confidence intervals, model-by-age performance, standardized coefficients, and predictor importance were visualized using lifespan curves, heatmaps, and coefficient plots (Table S4).
Parameter sensitivity analysis
We tested the robustness of the model-derived age-dependent effects using a prespecified one-at-a-time sensitivity analysis, varying each parameter while keeping all others at their baseline values. The tested ranges were: \(K_{{{\text{BODY}}}}\) and \(K_{{{\text{ENERGY}}}}\), 0.025–0.075; coupling scale, 0.50–1.50; modulation amplitude, 0.40–0.80; modulation peak age, 30–50 years; modulation width, 20–40 years; baseline noise, 0.010–0.030; age-dependent noise slope, 0.0002–0.0006; baseline decay, 0.010–0.030; age-dependent decay slope, 0.00015–0.00045; basal energy production, 0.30–0.50; cardiac energy production, 0.10–0.30; energy consumption, 0.025–0.075; cardiac frequency, 0.90–1.50; cardiac phase noise, 0.005–0.015; intrinsic growth, 0.010–0.030; lower and upper intrinsic frequencies, 6–10 and 10–14, respectively; integration time step, 0.025–0.10; and simulation duration, 300–700 time units. Network robustness was assessed by varying network size (40–160 nodes), small-world degree (4–10), rewiring probability (0.05–0.40), random-network threshold (0.80–0.95), and network topology (small-world, random and lattice). For each sensitivity condition, age-dependent indirect effects were estimated in 5-year age bins using the product-of-coefficients mediation effect (\(ab\)), with energy efficiency as the mediator. Ninety-five percent confidence intervals were obtained from non-parametric bootstrap resampling. Statistical significance was assessed using permutation tests in which the outcome was randomly permuted relative to the predictor and mediator; \(P\) values were calculated as \(\left( {k + 1} \right)/\left( {N_{{{\text{perm}}}} + 1} \right)\) and corrected across age bins using the Benjamini–Hochberg false-discovery rate (\(q < 0.05\)). Peak age was defined as the age bin corresponding to the most negative FDR-significant indirect effect. Robustness was quantified across sensitivity conditions by the proportion of conditions yielding a detectable peak and the absolute deviation from the prespecified peak age. Peaks were considered robust when detected in ≥ 90% of conditions with a median absolute deviation ≤ 5 years.
Robustness analyses
To assess whether the observed age-dependent patterns were specific to a particular parameterization or metric construction, we evaluated the model across multiple configurations. These included variations in network size and topology (lattice, small-world, and random networks), neural–body and neural–energy coupling strengths, stochastic realizations, and simulation conditions. Brain–body coordination was additionally quantified using two complementary formulations: phase-based coherence between global neural activity and the physiological oscillator, and non-parametric Spearman rank coupling between global neural, cardiac, and respiratory activity. We further evaluated the model under stochastic perturbations to physiological inputs and coupling parameters, as well as under an ablation condition in which explicit energy feedback was removed. The persistence of qualitative age-dependent patterns across these configurations was used as a robustness criterion. These analyses were designed to evaluate sensitivity to model specification and parameterization, rather than to establish a biological mechanism.