5D Library › 五节点循环网络动力学、黄经历表与多尺度振子扰动 · English

第二章 五节点循环有向图:循环矩阵谱、Hopf 分岔与对数和

一个只有结构的模型

五个节点排成一个环。每个节点从它的前一个节点获得增长(生成),被隔一个位置的节点抑制(隔一抑制)。这个有向图的形状在中国传统中被称为「相生」与「相克」;本书只使用它的图结构,不对它在任何领域的解释作任何主张——这里没有医学、命理或物质世界的预言,只有一个五阶循环矩阵及其动力学。

另一个更为人熟知的五节点环是「石头-剪刀-布-蜥蜴-史波克」:每个选项胜两个、负两个,是一个零和(反对称)的锦标赛。它是本章模型的一个特例,后面会看到,正是这个特例才拥有守恒量。

循环矩阵:对称性直接给出全部特征值

推导

生成-抑制环。 设循环移位算子 (S𝒙)i=xi−1(S\mathbf{x})_i = x_{i-1}。节点 ii 从 i−1i-1 获得 c1c_1,被 i−2i-2 抑制 c2c_2,自身饱和 μ\mu: A=c1S−c2S2−μI.A = c_1 S – c_2 S^2 – \mu I . 任何循环矩阵都以傅里叶向量 𝒗k=(ωjk)j\mathbf{v}_k = (\omega^{jk})_j(ω=e2πi/5\omega = e^{2\pi i/5})为特征向量。由 S𝒗k=ω−k𝒗kS\mathbf{v}_k = \omega^{-k}\mathbf{v}_k 得 λk=c1ω−k−c2ω−2k−μ,k=0,…,4,\lambda_k = c_1 \omega^{-k} – c_2 \omega^{-2k} – \mu, \qquad k = 0,\dots,4 , 与 c1ωk−c2ω2k−μc_1 \omega^{k} – c_2 \omega^{2k} – \mu 是同一组数(k→−kk \to -k 重新编号)(Davis 1979; Gray 2006)。

推导

复制子动力学与 Hopf 条件。 在单纯形上考虑 ẋi=xi((A𝒙)i−𝒙⊤A𝒙).\dot x_i = x_i\big((A\mathbf{x})_i – \mathbf{x}^{\top}A\mathbf{x}\big) . 均匀状态 xi=1/5x_i = 1/5 是平衡点,它在单纯形切空间上的雅可比矩阵恰为 A/5A/5,特征值 λk/5\lambda_k/5,k=1,…,4k = 1,\dots,4 (Hofbauer and Sigmund 1998)。实部 Re⁡λ1=c1cos⁡72∘+c2cos⁡36∘−μ\operatorname{Re}\lambda_{1} = c_1\cos 72^\circ + c_2\cos 36^\circ – \mu 最先越过零,临界值 μc=c1cos⁡72∘+c2cos⁡36∘\mu_c = c_1\cos 72^\circ + c_2\cos 36^\circ。若此时 Im⁡λ1≠0\operatorname{Im}\lambda_1 \neq 0,就是 Hopf 分岔 (Kuznetsov 2004)。

推导

# Chapter 2. p04: The five-node generation-inhibition ring as a circulant.
# Node i receives c1 from its predecessor i-1 (generation) and loses c2
# to node i-2 (inhibition, skipping one); mu is self-limitation. With
# the cyclic shift (S x)_i = x_{i-1}, the interaction matrix is
#     A = c1 S - c2 S^2 - mu I .
# Every circulant has the Fourier vectors v_k = (w^{jk}), w = e^{2 pi i/5},
# as eigenvectors; S v_k = w^{-k} v_k, so
#     lambda_k = c1 w^{-k} - c2 w^{-2k} - mu,   k = 0..4
# (the same set as c1 w^k - c2 w^{2k} - mu, relabelled k -> -k).
# For the replicator dynamics on the simplex, the uniform state is an
# equilibrium and its Jacobian on the simplex has eigenvalues lambda_k/5,
# k = 1..4. Modes 1 and 4 cross the imaginary axis first, at
#     mu_c = c1 cos 72 + c2 cos 36   (degrees),
# a Hopf bifurcation unless Im lambda_1 = 0, i.e. c2 / c1 = sin 72 /
# sin 36 = 1.618 (the golden ratio), where the crossing is real.
import cmath
import math

W = cmath.exp(2j * math.pi / 5)

def matrix(c1, c2, mu):
    a = [[0.0] * 5 for _ in range(5)]
    for i in range(5):
        a[i][(i - 1) % 5] += c1
        a[i][(i - 2) % 5] -= c2
        a[i][i] -= mu
    return a

def lam(c1, c2, mu, k):
    return c1 * W ** (-k) - c2 * W ** (-2 * k) - mu

if __name__ == "__main__":
    c1, c2, mu = 1.0, 0.5, 0.5
    a = matrix(c1, c2, mu)
    print("c1 = {}, c2 = {}, mu = {}".format(c1, c2, mu))
    print("   k   lambda_k (formula)        |A v - lambda v|")
    for k in range(5):
        v = [W ** (j * k) for j in range(5)]
        av = [sum(a[i][j] * v[j] for j in range(5)) for i in range(5)]
        lk = lam(c1, c2, mu, k)
        err = max(abs(x - lk * y) for x, y in zip(av, v))
        print("   {}   {:+.4f} {:+.4f}i          {:.1e}".format(
            k, lk.real, lk.imag, err))
    print("\nHopf threshold and period at threshold:")
    print("   c1     c2     mu_c     Im lambda_1   period (time units)")
    for c1, c2 in ((1.0, 0.0), (1.0, 0.5), (1.0, 1.0), (1.0, 1.618),
                   (0.5, 1.0)):
        muc = (c1 * math.cos(math.radians(72))
               + c2 * math.cos(math.radians(36)))
        im = lam(c1, c2, muc, 1).imag
        per = 2 * math.pi * 5 / abs(im) if abs(im) > 1e-3 else float("inf")
        print("   {:4.2f}   {:5.3f}  {:6.4f}    {:+9.4f}     {:>9}".format(
            c1, c2, muc, im, "{:.2f}".format(per) if per < 1e9 else
            "none"))
    print("   golden ratio sin 72 / sin 36 = {:.6f}".format(
        math.sin(math.radians(72)) / math.sin(math.radians(36))))
    print("\nReading: the whole spectrum follows from the ring's symmetry -")
    print("no eigen-solver is needed. Generation and skip-one inhibition")
    print("both destabilise mode 1; self-limitation above mu_c restores")
    print("the uniform state. At c2/c1 = 1.618 the two couplings cancel in")
    print("the imaginary part and no oscillation is born.")
# c1 = 1.0, c2 = 0.5, mu = 0.5
#    k   lambda_k (formula)        |A v - lambda v|
#    0   +0.0000 +0.0000i          0.0e+00
#    1   +0.2135 -0.6572i          1.6e-16
#    2   -1.4635 -1.0633i          3.1e-16
#    3   -1.4635 +1.0633i          5.0e-16
#    4   +0.2135 +0.6572i          5.6e-16
#
# Hopf threshold and period at threshold:
#    c1     c2     mu_c     Im lambda_1   period (time units)
#    1.00   0.000  0.3090      -0.9511         33.03
#    1.00   0.500  0.7135      -0.6572         47.81
#    1.00   1.000  1.1180      -0.3633         86.48
#    1.00   1.618  1.6180      -0.0000          none
#    0.50   1.000  0.9635      +0.1123        279.86
#    golden ratio sin 72 / sin 36 = 1.618034
#
# Reading: the whole spectrum follows from the ring's symmetry -
# no eigen-solver is needed. Generation and skip-one inhibition
# both destabilise mode 1; self-limitation above mu_c restores
# the uniform state. At c2/c1 = 1.618 the two couplings cancel in
# the imaginary part and no oscillation is born.

程序把公式给出的五个特征值逐一代回矩阵核对,残差都在 1e-16 量级:不需要任何数值特征值算法,环的对称性已经给出了全部谱。c1=1c_1 = 1、c2=0.5c_2 = 0.5、μ=0.5\mu = 0.5 时,模 1 与模 4 的实部是 +0.2135,均匀状态不稳定。

这里有一处需要对提纲作的修正:没有自身饱和(μ=0\mu = 0)时,只要 c1,c2>0c_1, c_2 > 0,均匀状态总是不稳定的,因为 Re⁡λ1=c1cos⁡72∘+c2cos⁡36∘>0\operatorname{Re}\lambda_1 = c_1\cos 72^\circ + c_2\cos 36^\circ > 0。生成与隔一抑制都推动模 1 失稳;Hopf 分岔需要第三个参数 μ\mu 才会出现。阈值表给出 μc\mu_c 与阈值处的振荡周期:只有生成时 μc=0.3090\mu_c = 0.3090,周期 33.03;c2=0.5c_2 = 0.5 时 μc=0.7135\mu_c = 0.7135,周期 47.81;c1=c2=1c_1 = c_2 = 1 时 μc=5/2\mu_c = \sqrt{5}/2。

当 c2/c1=sin⁡72∘/sin⁡36∘=1.618c_2/c_1 = \sin 72^\circ/\sin 36^\circ = 1.618——黄金比——时,两种耦合在虚部中恰好抵消:Im⁡λ1=0\operatorname{Im}\lambda_1 = 0,越过阈值的是一个实特征值,没有振荡诞生,表中周期一栏为「none」。黄金比在这里不是装饰:它是正五边形几何中 cos⁡36∘\cos 36^\circ 与 cos⁡72∘\cos 72^\circ 的关系的直接后果。

分岔的类型与守恒量

推导

# Chapter 2. p05: Replicator dynamics on the ring: Hopf and the log-sum.
#     dx_i/dt = x_i ((A x)_i - x.A x),   A = c1 S - c2 S^2 - mu I
# integrated in log coordinates u_i = ln x_i (x = softmax u), RK4, step
# 0.1, which keeps every x_i positive however close it comes to 0.
# A. c1 = 1, c2 = 0.5, so mu_c = 0.7135 (p04). For mu below mu_c the
#    uniform state loses stability; the oscillation's size (max x - min
#    x over the cycle) is measured after 4,000 time units, from a small
#    and a large starting perturbation. A supercritical Hopf has
#    size^2 / (mu_c - mu) tending to a constant.
# B. The quantity H = sum_i ln x_i. Its rate is
#        dH/dt = sum_i (A x)_i - 5 x.A x .
#    For an antisymmetric (zero-sum) ring, A = c1 (S - S^T) - c2 (S^2 -
#    S^2T), both terms vanish and H is conserved. For the ring above it
#    is not.
import math

def soft(u):
    m = max(u)
    e = [math.exp(a - m) for a in u]
    s = sum(e)
    return [a / s for a in e]

def ring(c1, c2, mu, anti=False):
    a = [[0.0] * 5 for _ in range(5)]
    for i in range(5):
        a[i][(i - 1) % 5] += c1
        a[i][(i - 2) % 5] -= c2
        a[i][i] -= mu
        if anti:
            a[i][(i + 1) % 5] -= c1
            a[i][(i + 2) % 5] += c2
    return a

def rhs(u, a):
    x = soft(u)
    ax = [sum(a[i][j] * x[j] for j in range(5)) for i in range(5)]
    m = sum(p * q for p, q in zip(ax, x))
    return [v - m for v in ax]

def step(u, a, h):
    k1 = rhs(u, a)
    k2 = rhs([p + h / 2 * q for p, q in zip(u, k1)], a)
    k3 = rhs([p + h / 2 * q for p, q in zip(u, k2)], a)
    k4 = rhs([p + h * q for p, q in zip(u, k3)], a)
    return [p + h / 6 * (q + 2 * r + 2 * s + t)
            for p, q, r, s, t in zip(u, k1, k2, k3, k4)]

def settle(a, eps, burn=4000.0, look=400.0, h=0.1):
    u = [eps * math.cos(2 * math.pi * i / 5) for i in range(5)]
    for _ in range(int(burn / h)):
        u = step(u, a, h)
    size, low = 0.0, 1.0
    for _ in range(int(look / h)):
        u = step(u, a, h)
        x = soft(u)
        size, low = max(size, max(x) - min(x)), min(low, min(x))
    return size, low

if __name__ == "__main__":
    c1, c2 = 1.0, 0.5
    muc = (c1 * math.cos(math.radians(72))
           + c2 * math.cos(math.radians(36)))
    print("A. mu_c = {:.4f}".format(muc))
    print("   mu_c - mu   size (start 0.01)  size (start 0.5)"
          "  size^2/(mu_c-mu)  min x")
    for d in (0.2, 0.1, 0.05, 0.02, 0.01, -0.02):
        s1, _ = settle(ring(c1, c2, muc - d), 0.01)
        s2, low = settle(ring(c1, c2, muc - d), 0.5)
        ratio = "{:8.3f}".format(s1 * s1 / d) if d > 0 else "     -"
        print("   {:+8.3f}     {:9.5f}         {:9.5f}         {}"
              "      {:.4f}".format(d, s1, s2, ratio, low))
    print("\nB. H = sum ln x_i along 2,000 time units (step 0.02)")
    for name, a in (("antisymmetric ring", ring(1.0, 0.5, 0.0, True)),
                    ("ring, mu = mu_c - 0.1", ring(c1, c2, muc - 0.1))):
        u = [0.4 * math.cos(2 * math.pi * i / 5 + 0.3) for i in range(5)]
        hs = []
        for n in range(100000):
            u = step(u, a, 0.02)
            if n % 50 == 0:
                hs.append(sum(math.log(v) for v in soft(u)))
        r = max(hs) - min(hs)
        print("   {:<22} H in [{:+.6f}, {:+.6f}], range {}".format(
            name, min(hs), max(hs),
            "{:.2f}".format(r) if r >= 0.01 else "{:.2e}".format(r)))
    print("\nReading: below mu_c a stable oscillation is born whose size")
    print("does not depend on the start, and size^2 / (mu_c - mu) settles")
    print("near a constant: a supercritical Hopf bifurcation. The log-sum")
    print("H is conserved only by the zero-sum (antisymmetric) ring; the")
    print("generation-inhibition ring with self-limitation does not keep")
    print("it.")
# A. mu_c = 0.7135
#    mu_c - mu   size (start 0.01)  size (start 0.5)  size^2/(mu_c-mu)  min x
#      +0.200       0.51596           0.51596            1.331      0.0029
#      +0.100       0.40632           0.40632            1.651      0.0201
#      +0.050       0.31492           0.31492            1.984      0.0513
#      +0.020       0.21251           0.21251            2.258      0.0957
#      +0.010       0.15298           0.15299            2.340      0.1236
#      -0.020       0.00000           0.00000              -      0.2000
#
# B. H = sum ln x_i along 2,000 time units (step 0.02)
#    antisymmetric ring     H in [-8.245226, -8.245226], range 4.71e-11
#    ring, mu = mu_c - 0.1  H in [-10.137253, -8.245356], range 1.89
#
# Reading: below mu_c a stable oscillation is born whose size
# does not depend on the start, and size^2 / (mu_c - mu) settles
# near a constant: a supercritical Hopf bifurcation. The log-sum
# H is conserved only by the zero-sum (antisymmetric) ring; the
# generation-inhibition ring with self-limitation does not keep
# it.

A 段从小扰动(0.01)与大扰动(0.5)两种初值出发,在 μ\mu 低于 μc\mu_c 时都落到同一个振荡上:振荡幅度与初值无关,是一个吸引的极限环。幅度的平方除以 μc−μ\mu_c – \mu 随着靠近阈值趋于常数(从 1.331 到 2.340),这是超临界 Hopf 分岔的标志:振幅按 μc−μ\sqrt{\mu_c – \mu} 从零长出。μ\mu 高于阈值 0.020 时振荡消失,均匀状态 0.2000 重新稳定。离阈值越远,最小的 xx 越接近零(μc−μ=0.2\mu_c – \mu = 0.2 时为 0.0029),第三章会看到这意味着什么。

B 段检查对数和 H=∑iln⁡xiH = \sum_i \ln x_i。它的变化率是 dHdt=∑i(A𝒙)i−5𝒙⊤A𝒙.\frac{dH}{dt} = \sum_i (A\mathbf{x})_i – 5\,\mathbf{x}^{\top}A\mathbf{x} . 对零和(反对称)的环,两项都恒为零,HH 守恒:2,000 个时间单位里它只在 4.71e-11 的范围内漂移,即数值误差。对本章的生成-抑制环,HH 在一个周期里变化 1.89。所以第二处修正是:∑ln⁡xi\sum \ln x_i 只是零和环的守恒量,不是一般生成-抑制环的守恒量。「石头-剪刀-布-蜥蜴-史波克」属于前者;带自身饱和的生成-抑制环属于后者。

Hopf 阈值 \mu_c 与振荡频率 |\operatorname{Im}\lambda_1| 随 c_2/c_1 的变化(c_1 = 1);在黄金比处虚部为零,没有振荡诞生。

注

这里没有说的事。 复制子方程描述的是各节点所占份额的相互作用,书中的参数没有单位,也不对应任何真实系统。模型说明的是一种图结构在数学上能做什么:失稳、振荡、守恒或不守恒。它不说明任何真实的「五元」系统具有这些性质。

假说 · 尚未验证

作者的假说(尚未验证): 对任意 NN 节点、只含循环生成与隔 mm 抑制的环,存在一个由 cos⁡(2π/N)\cos(2\pi/N) 与 cos⁡(2πm/N)\cos(2\pi m/N) 决定的耦合比,使首先失稳的模的虚部为零;N=5N = 5、m=2m = 2 时这个比恰为黄金比。什么结果会证明它错:对某个 NN 与 mm,首先失稳的模在所有耦合比下都有非零虚部,或零虚部出现在另一个模上。

小结

五节点生成-抑制环的相互作用矩阵是循环矩阵,全部特征值由环的对称性直接写出。没有自身饱和时均匀状态总不稳定;Hopf 阈值是 μc=c1cos⁡72∘+c2cos⁡36∘\mu_c = c_1\cos 72^\circ + c_2\cos 36^\circ,分岔是超临界的,极限环吸引且振幅与初值无关。当 c2/c1c_2/c_1 等于黄金比时没有振荡诞生。对数和 ∑ln⁡xi\sum \ln x_i 只在零和环中守恒。

参考文献

Davis, Philip J. 1979. Circulant Matrices. Wiley.
Gray, Robert M. 2006. “Toeplitz and Circulant Matrices: A Review.” Foundations and Trends in Communications and Information Theory 2 (3): 155–239.
Hofbauer, Josef, and Karl Sigmund. 1998. Evolutionary Games and Population Dynamics. Cambridge University Press.
Kuznetsov, Yuri A. 2004. Elements of Applied Bifurcation Theory. 3rd ed. Springer.

Fan, Y. (2026). Five-Node Cyclic Network Dynamics, Solar-Longitude Ephemeris and Multi-Scale Oscillator Perturbations: Rock-Paper-Scissors-Lizard-Spock Lotka-Volterra Graphs, Equation-of-Time Keplerian Mechanics and Jacobian Sensitivity Bounds [五节点循环网络动力学、黄经历表与多尺度振子扰动] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090168 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).