What does Cross-Border Dual Sourcing and Disruption Options conclude, in numbers, about “Closing the Loop: the Dual-Source Split Sheet, the Small Tool and a Pre-Registered Test”?
Answer: Chapter 8 gives the dual-source split sheet, the Dual-Source Safety-Stock Calculator and a pre-registered test plan. Marked boxes separate published evidence, runnable Python calculations (20 programs), classical sources and the author's hypotheses.
Scope of the numbers: Its prices, lead times, outage frequencies, margins and capacities are illustrative; all calculations are generated by its programs; the book is not individual legal, tax or financial advice. Marked boxes separate published evidence, runnable Python calculations (20 programs), classical sources and the author's hypotheses.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python only
| sku | plan alpha far_ship | near_S | stock | save/yr | ||
| A-base | D | 0.55 | 308 | 839 | 359 | 8323 |
| B-slow | D | 0.55 | 62 | 188 | 92 | 30 |
| C-fast | D | 0.95 | 1995 | 3645 | 1845 | 4175 |
| D-long | D | 0.50 | 280 | 813 | 333 | 94609 |
| E-rigid | F | 1.00 | 560 | 0 | 1401 | 0 |
| status of every line: PENDING-RELEASE (buyer signs before use) |
Show the full program
# Chapter 8. p81: the monthly dual-source split sheet for five SKUs.
# Model: the annual model of p21 applied SKU by SKU (values below are
# illustrative, not any firm's data). For each SKU: the cheapest plan
# (F far only, N near only, D dual), the far share alpha, the far base
# shipment per 14 days, the near order-up-to level (demand over the
# 12-day near protection interval plus safety stock), the safety and
# outage stock, and the yearly saving against the best far-only plan.
# Every line is a proposal pending human release.
import math
from statistics import NormalDist
N01 = NormalDist()
YEAR = 365.0
# 基准参数(示意):日需求均值与标准差、年持有率、在途资金率、缺一件毛利;
# 远源到岸价、交期均值与标准差、补货周期、每票固定费;近源同;
# 远源断供年发生率与平均天数、近源产能上限与量弹性
BASE = dict(d=40.0, sd=12.0, h=0.25, i=0.10, p=120.0,
cF=100.0, LF=40.0, sLF=10.0, TF=14.0, KF=300.0,
cN=108.0, LN=5.0, sLN=1.0, TN=7.0, KN=200.0,
lam=0.5, tau=40.0, cap=60.0, flex=1.0)
def loss(z):
return N01.pdf(z) - z * (1.0 - N01.cdf(z))
def capped_m2(s_l, cap, n=400):
# E[min(delta+, cap)^2], delta ~ N(0, s_l)
if s_l <= 0.0:
return 0.0
hs = cap / n
w = [1.0 if k in (0, n) else (4.0 if k % 2 else 2.0)
for k in range(n + 1)]
f = [(k * hs) ** 2 * N01.pdf(k * hs / s_l) / s_l for k in range(n + 1)]
body = math.fsum(a * b for a, b in zip(w, f)) * hs / 3.0
return body + cap ** 2 * (1.0 - N01.cdf(cap / s_l))
def buffer(q, sp, c, t):
z = max(0.0, N01.inv_cdf(q["p"] / (q["p"] + q["h"] * c * t / YEAR)))
return z * sp, q["h"] * c * z * sp, YEAR / t * sp * loss(z) * q["p"]
def outage(q, u, ss, mitigate=True):
# 断供期缺口速率 u;缓冲 b 按 h*c = lam*p*exp(-(ss+b)/(u*tau)) 取最优
ut = u * q["tau"]
if ut <= 0.0 or q["lam"] <= 0.0:
return 0.0, 0.0
b = 0.0
if mitigate and q["lam"] * q["p"] > q["h"] * q["cF"]:
b = max(0.0, ut * math.log(q["lam"] * q["p"]
/ (q["h"] * q["cF"])) - ss)
return b, q["lam"] * q["p"] * ut * math.exp(-(ss + b) / ut)
def far_only(q, mitigate=True):
sp = math.sqrt((q["LF"] + q["TF"]) * q["sd"] ** 2
+ (q["d"] * q["sLF"]) ** 2)
ss, c_ss, c_rec = buffer(q, sp, q["cF"], q["TF"])
b, c_out = outage(q, q["d"], ss, mitigate)
return {"purchase": q["d"] * YEAR * q["cF"],
"orders": YEAR / q["TF"] * q["KF"],
"cycle": q["h"] * q["cF"] * q["d"] * q["TF"] / 2.0,
"transit": q["i"] * q["cF"] * q["d"] * q["LF"],
"safety": c_ss + q["h"] * q["cF"] * b, "recurrent": c_rec,
"outage": c_out, "stock": ss + b}
def dual(q, a):
pn = q["LN"] + q["TN"]
sp = math.sqrt(pn * q["sd"] ** 2 + (q["d"] * q["sLN"]) ** 2
+ (a * q["d"]) ** 2 * capped_m2(q["sLF"], pn))
ss, c_ss, c_rec = buffer(q, sp, q["cN"], q["TN"])
base_n = (1.0 - a) * q["d"]
# 近源断供期可供量:基量乘 (1 + 弹性),且不超过产能上限与日需求
up = min(q["cap"], base_n * (1.0 + q["flex"]), q["d"])
b, c_out = outage(q, q["d"] - up, ss)
days = q["lam"] * q["tau"]
return {"purchase": q["d"] * YEAR * (a * q["cF"] + (1 - a) * q["cN"])
+ days * (up - base_n) * (q["cN"] - q["cF"]),
"orders": (YEAR / q["TF"] * q["KF"] if a > 0 else 0.0)
+ YEAR / q["TN"] * q["KN"],
"cycle": q["h"] * q["d"] / 2.0
* (a * q["cF"] * q["TF"] + (1 - a) * q["cN"] * q["TN"]),
"transit": q["i"] * q["d"]
* (a * q["cF"] * q["LF"] + (1 - a) * q["cN"] * q["LN"]),
"safety": c_ss + q["h"] * q["cF"] * b, "recurrent": c_rec,
"outage": c_out, "stock": ss + b}
def total(r):
return math.fsum(v for k, v in sorted(r.items()) if k != "stock")
def best_dual(q, step=0.05):
grid = [k * step for k in range(int(round(1 / step)) + 1)]
return min((total(dual(q, a)), a) for a in grid)
def best_far(q):
return min(total(far_only(q, False)), total(far_only(q, True)))
# ---- end of shared model ----
SKUS = [("A-base", {}),
("B-slow", dict(d=8.0, sd=5.0, p=300.0)),
("C-fast", dict(d=150.0, sd=30.0, p=40.0, cN=106.0)),
("D-long", dict(tau=90.0)),
("E-rigid", dict(flex=0.25))]
def sheet_line(name, over):
q = dict(BASE, **over)
far = best_far(q)
near = total(dual(q, 0.0))
inner = min((total(dual(q, k * 0.05)), k * 0.05) for k in range(1, 20))
plan, a, cost = "F", 1.0, far
if min(near, inner[0]) < far:
plan, a, cost = ("N", 0.0, near) if near <= inner[0] else (
"D", inner[1], inner[0])
if plan == "F":
r = far_only(q, True) if total(far_only(q, True)) <= total(
far_only(q, False)) else far_only(q, False)
ship, target = q["d"] * q["TF"], 0.0
else:
r = dual(q, a)
ship = a * q["d"] * q["TF"]
target = q["d"] * (q["LN"] + q["TN"]) + r["stock"]
return "%-8s %4s %5.2f %8.0f %9.0f %9.0f %10.0f" % (
name, plan, a, ship, target, r["stock"], far - cost)
print("%-8s %4s %5s %8s %9s %9s %10s" % ("sku", "plan", "alpha",
"far_ship", "near_S", "stock",
"save/yr"))
for name, over in SKUS:
print(sheet_line(name, over))
print("status of every line: PENDING-RELEASE (buyer signs before use)")Single source and citation
Fan, Y. (2026). Dual-Source Redundancy and Supply-Disruption Real Options in Cross-Border Chains: Optimal Safety Stock and Source Splits under Shipping Delays and Customs Variability (Version 1.0.0), Chapter 8: Closing the Loop: the Dual-Source Split Sheet, the Small Tool and a Pre-Registered Test. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-291 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026291,
author = {Fan, Yafu},
title = {Dual-Source Redundancy and Supply-Disruption Real Options in Cross-Border Chains: Optimal Safety Stock and Source Splits under Shipping Delays and Customs Variability},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · Lead-Time Variance: the Term Deleted from the Safety-Stock Formula
- Chapter 2 · The Full Annual Ledger of the Lowest Price: One Far Source, One Near Source, or Two
- Chapter 3 · The Split: the Ceiling on the Far Share Is Set by Near-Source Flexibility
- Chapter 4 · The Two-Source Newsvendor: the Critical Fractile of a One-Order Season and the Value of Reacting
- Chapter 5 · Supply-Disruption Real Options: Reserved Capacity, Exchange-Rate Switching and Keeping a Supplier Warm
- Chapter 6 · Clearance Variability and Robustness: Two-Peaked Lead Times, a Handful of Shipments, and a Common Failure Point
- Chapter 7 · The Classics Examined: "Feeding on the Enemy" and Harris's Square Root