关于「一维有限差分:均匀热度怎样碎成等距高点」,《图灵斑图与据点间距》给出的定量结论是什么?

结论:隐显式有限差分把扩散与衰减放到下一时刻去解,把产生项留在当前时刻,用托马斯算法解三对角方程组,让纯 Python 在一秒内算完一条 40 公里的走廊。程序 p21 显示,从均匀热度出发,格局经历线性放大、非线性变尖、高点合并三个阶段,最终在默认参数下停在 6 个高点,平均间距 7.20 公里;总热度从 80.00 降到 63.67。程序 p22 显示,格宽与步长在合理范围内变化时,高点个数不变、间距变化不到百分之一;而换一组初始噪声,间距可以变一成。那么,究竟是什么决定了间距?为什么同一组方程可以停在不同的间距上?下一章回到色散关系,把这两个问题算清楚。

数据口径:书中半径、衰减率、城市长度与数据均为示意;全部计算由书中程序生成;本书属非个人化经营方法,不构成投资、法律或选址决策建议。 书中以标注框区分已发表的证据、可运行的 Python 计算(17 段程序)、原典与作者的假说。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 40, 63.67, 7.20, 80.00

tpeakscontrastmax atotal activity (a dx)
001.0102.0180.00
1071.1122.1179.99
2078.8723.7575.75
30634.6734.3864.18
406196.8094.4463.09
606121.2634.4263.31
100671.4954.3963.49
200647.8264.3563.60
400644.3064.3263.67
peak positions km: 3.9 11.5 18.9 26.1 33.1 39.9
gaps km: 7.6 7.4 7.2 7.0 6.8edge margins 3.9 and 0.1
mean gap 7.20 km; onset scale 2 pi sqrt(la lh) = 7.54 km
查看完整验算程序
# Chapter 2. p21: how evenly spread outposts break into regular peaks.
# Model: Gierer-Meinhardt with mu = 1, nu = 2, la = 0.6 km, lh = 2.4 km
# (reach ratio 4, illustrative) on a 40 km corridor, no-flux ends.
# Scheme: cell width 0.2 km, step 0.05; decay and diffusion implicit
# (Thomas algorithm), production a^2 / h and a^2 explicit. Start from
# the uniform state with 1 per cent seeded noise; print snapshots of
# peak count, contrast and the largest activity, then the final gaps.

import math
import random

MU, NU, LA, LH = 1.0, 2.0, 0.6, 2.4
LENGTH, DX, DT = 40.0, 0.2, 0.05


def factor(n, r, c):
    di = [1.0 + c + 2.0 * r] * n
    di[0] = di[-1] = 1.0 + c + r
    cp, den = [0.0] * n, [0.0] * n
    den[0] = di[0]
    cp[0] = -r / den[0]
    for i in range(1, n):
        den[i] = di[i] + r * cp[i - 1]
        cp[i] = -r / den[i]
    return cp, den, r


def solve(f, rhs):
    cp, den, r = f
    n = len(rhs)
    y = [0.0] * n
    y[0] = rhs[0] / den[0]
    for i in range(1, n):
        y[i] = (rhs[i] + r * y[i - 1]) / den[i]
    for i in range(n - 2, -1, -1):
        y[i] -= cp[i] * y[i + 1]
    return y


def peaks(a):
    lo, hi = min(a), max(a)
    if hi - lo < 0.01 * hi:
        return []
    cut, n = lo + 0.5 * (hi - lo), len(a)
    return [(i + 0.5) * DX for i in range(n) if a[i] > cut
            and (i == 0 or a[i] >= a[i - 1])
            and (i == n - 1 or a[i] > a[i + 1])]


n = int(round(LENGTH / DX))
rng = random.Random(20261113)
a = [2.0 * (1.0 + 0.01 * (rng.random() - 0.5)) for _ in range(n)]
h = [2.0] * n
fa = factor(n, DT * MU * LA * LA / DX ** 2, DT * MU)
fh = factor(n, DT * NU * LH * LH / DX ** 2, DT * NU)
marks = (0, 10, 20, 30, 40, 60, 100, 200, 400)
print("   t  peaks  contrast  max a   total activity (a dx)")
step = 0
for t_mark in marks:
    while step * DT < t_mark - 1e-9:
        ra = [a[i] + DT * a[i] * a[i] / h[i] for i in range(n)]
        rh = [h[i] + DT * a[i] * a[i] for i in range(n)]
        a, h = solve(fa, ra), solve(fh, rh)
        step += 1
    print("%4d  %5d  %8.3f  %5.2f  %8.2f"
          % (t_mark, len(peaks(a)), max(a) / min(a), max(a),
             DX * math.fsum(a)))
p = peaks(a)
gaps = [p[i + 1] - p[i] for i in range(len(p) - 1)]
print("peak positions km: " + " ".join("%.1f" % x for x in p))
print("gaps km: " + " ".join("%.1f" % g for g in gaps)
      + "   edge margins %.1f and %.1f" % (p[0], LENGTH - p[-1]))
print("mean gap %.2f km; onset scale 2 pi sqrt(la lh) = %.2f km"
      % (math.fsum(gaps) / len(gaps), 2 * math.pi * math.sqrt(LA * LH)))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《图灵反应扩散斑图、小众口碑品牌陌生城市据点涌现与区域垄断扩散比条件母典》第 2 章「一维有限差分:均匀热度怎样碎成等距高点」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-247 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026247,
  author    = {Fan, Yafu},
  title     = {Turing Reaction-Diffusion Patterns: How the Outposts of a Niche Word-of-Mouth Brand Emerge in a New City, and the Diffusion-Ratio Condition for Regional Dominance},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论