关于「精确解出的排程」,《抑制矩阵、给药窗口与酶竞争》给出的定量结论是什么?

结论:第六章穷举 177147 种三槽排程,最优为 0.8605,而全部放进早餐为 0.5394;更要紧的是 0.8355 的随意排程比全部放进早餐更差。

数据口径:书中参数均为示意或合成;全部数字由书中程序产生;本书不是医疗建议,不作诊断,也不可用于开始、停止或改动任何补剂或药物。 书中以标注框区分已发表的证据、可运行的 Python 计算(十六段程序)、原典与作者的假说。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 与结论吻合的打印值: 0.5394, 0.8355, 0.8605, 177147

schedules scored177147
best 0.8605, worst 0.1561, median 0.4384
10th to 90th percentile0.3145 to 0.5716
everything at breakfast scores 0.5394
share of schedules worse than that0.8355
schedules within 0.01 of the best1 (0.00001)
schedules within 0.02 of the best3 (0.00002)
schedules within 0.05 of the best19 (0.00011)
so a guessed split lands near the optimum rarely, and the
median guess gives up 0.4906 of the best
value of moving one item out of the all-at-breakfast pile:
item to slot score gain
magnesium3 0.6441 +0.1047
calcium3 0.6369 +0.0975
theanine3 0.6244 +0.0850
zinc2 0.6176 +0.0782
zinc3 0.6071 +0.0677
vitamin K23 0.5655 +0.0260
the best single move is worth +0.1047, which is 0.3260 of
the whole gain the full schedule achieves
查看完整验算程序
# Chapter 6. p12: How lucky a guessed schedule is. The previous program
# found the best of the 177,147 labelled schedules. This one scores all
# of them and looks at the distribution, which answers a question the
# optimum does not: if someone splits the pile by instinct rather than
# by arithmetic, how well are they likely to do? It also ranks the
# single moves out of the morning pile by what each one is worth on its
# own, because a reader who will change exactly one thing should know
# which one. The model is identical to p11, repeated here so that this
# program runs on its own.
ITEMS = (
    # name, dose mg, molar mass, site, Km mmol, needs, phase
    ("magnesium",     400.00,  24.305, "divalent",  4.0000, "plain", "eve"),
    ("zinc",           25.00,  65.380, "divalent",  0.1500, "lowphy", "any"),
    ("calcium",       500.00,  40.080, "divalent",  5.0000, "plain", "eve"),
    ("iron",           18.00,  55.850, "divalent",  0.0800, "acid", "morn"),
    ("vitamin D3",      0.10, 384.600, "micelle",   0.0004, "fat", "morn"),
    ("vitamin K2",      0.18, 444.700, "micelle",   0.0005, "fat", "any"),
    ("NAD precursor", 300.00, 255.200, "nrk",       1.0000, "plain", "morn"),
    ("curcumin",      500.00, 368.400, "conjugate", 1.0000, "fat", "any"),
    ("piperine",       10.00, 285.300, "conjugate", 0.0500, "plain", "any"),
    ("theanine",      200.00, 174.200, "amino",     1.0000, "plain", "eve"),
    ("caffeine",      100.00, 194.200, "cyp1a2",    0.5000, "plain", "morn"),
)
# slot: label, clock hour, fat g, phytate mg, polyphenol mg, stomach pH
SLOTS = (
    ("breakfast 07:00", 7.0, 18.0, 120.0, 40.0, 2.0),
    ("afternoon 14:00", 14.0, 2.0, 0.0, 0.0, 1.6),
    ("evening 22:00", 22.0, 8.0, 60.0, 0.0, 1.9),
)
FAT_HALF, PHY_MASS, ZN_MASS = 9.0, 660.0, 65.38
PH_HALF, PH_HILL = 3.4, 2.4
PHASE_PEAK = {"morn": 6.0, "eve": 22.5, "any": None}
PHASE_WIDTH = 5.0
ENH_MAX, ENH_K = 1.60, 0.020      # piperine on curcumin, saturating

def mmol(dose_mg, molar_mass):
    return dose_mg / molar_mass

def site_factor(i, group):
    name, dose, mm, site, km, needs, phase = ITEMS[i]
    s = mmol(dose, mm)
    extra = sum(mmol(ITEMS[j][1], ITEMS[j][2]) / ITEMS[j][4]
                for j in group if j != i and ITEMS[j][3] == site)
    return (s / (km * (1.0 + extra) + s)) / (s / (km + s))

def condition_factor(needs, slot):
    _, _, fat_g, phytate, polyphenol, ph = slot
    f = 1.0
    if needs == "fat":
        f *= (fat_g / (FAT_HALF + fat_g)) / (18.0 / (FAT_HALF + 18.0))
    if needs == "acid":
        f *= 1.0 / (1.0 + polyphenol / 120.0)
        f *= (1.0 / (1.0 + (ph / PH_HALF) ** PH_HILL)) \
            / (1.0 / (1.0 + (1.6 / PH_HALF) ** PH_HILL))
    if needs == "lowphy":
        ratio = (phytate / PHY_MASS) / (25.0 / ZN_MASS)
        f *= 1.0 / (1.0 + 0.55 * ratio)
    return min(1.0, f)

def phase_factor(phase, slot):
    peak = PHASE_PEAK[phase]
    if peak is None:
        return 1.0
    d = abs((slot[1] - peak + 12.0) % 24.0 - 12.0)
    return 2.718281828459045 ** (-(d / PHASE_WIDTH) ** 2)

def enhance(i, group):
    # curcumin gains if piperine is in the same slot
    if ITEMS[i][0] != "curcumin":
        return 1.0
    for j in group:
        if ITEMS[j][0] == "piperine":
            s = mmol(ITEMS[j][1], ITEMS[j][2])
            return 1.0 + ENH_MAX * s / (ENH_K + s)
    return 1.0

def item_score(i, group, s):
    return (site_factor(i, group)
            * condition_factor(ITEMS[i][5], SLOTS[s])
            * phase_factor(ITEMS[i][6], SLOTS[s])
            * enhance(i, group))

def total(assign):
    groups = [[i for i, a in enumerate(assign) if a == s]
              for s in range(len(SLOTS))]
    out = 0.0
    for s, group in enumerate(groups):
        for i in group:
            out += item_score(i, group, s)
    return out / len(ITEMS)

if __name__ == "__main__":
    n, k = len(ITEMS), len(SLOTS)
    scores = []
    assign = [0] * n
    best, arg = -1.0, None
    while True:
        v = total(assign)
        scores.append(v)
        if v > best:
            best, arg = v, tuple(assign)
        i = 0
        while i < n:
            assign[i] += 1
            if assign[i] < k:
                break
            assign[i] = 0
            i += 1
        if i == n:
            break
    scores.sort()
    m = len(scores)
    allone = total([0] * n)
    def q(a):
        return scores[int(a * (m - 1))]
    print("   schedules scored: {}".format(m))
    print("   best {:.4f}, worst {:.4f}, median {:.4f}"
          .format(scores[-1], scores[0], q(0.5)))
    print("   10th to 90th percentile: {:.4f} to {:.4f}"
          .format(q(0.1), q(0.9)))
    print("   everything at breakfast scores {:.4f}".format(allone))
    worse = sum(1 for v in scores if v < allone)
    print("   share of schedules worse than that: {:.4f}".format(worse / m))
    for tol in (0.01, 0.02, 0.05):
        near = sum(1 for v in scores if v >= scores[-1] - tol)
        print("   schedules within {:.2f} of the best: {} ({:.5f})"
              .format(tol, near, near / m))
    print("   so a guessed split lands near the optimum rarely, and the")
    print("   median guess gives up {:.4f} of the best"
          .format(1.0 - q(0.5) / scores[-1]))
    print("   value of moving one item out of the all-at-breakfast pile:")
    print("   item           to slot   score    gain")
    moves = []
    for i in range(n):
        for s in (1, 2):
            a = [0] * n
            a[i] = s
            moves.append((total(a) - allone, ITEMS[i][0], s + 1, total(a)))
    moves.sort(reverse=True)
    for gain, name, slot, v in moves[:6]:
        print("   {:<15}{:<10d}{:<9.4f}{:+.4f}".format(name, slot, v, gain))
    print("   the best single move is worth {:+.4f}, which is {:.4f} of"
          .format(moves[0][0], moves[0][0] / (scores[-1] - allone)))
    print("   the whole gain the full schedule achieves")

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《复合补剂相互作用、时间疗法给药窗口与代谢酶竞争》第 6 章「精确解出的排程」(版本 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090250

DOI: 10.5281/zenodo.24090250 · 阅读本章所在专著 · 5DL-B-096 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026096,
  author    = {Fan, Yafu},
  title     = {Polypharmacy Supplement Interactions, Chronotherapy Dosing Windows and Cytochrome Enzyme Competition},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  doi       = {10.5281/zenodo.24090250},
  url       = {https://doi.org/10.5281/zenodo.24090250}
}

本书其他章节结论