DCT Laboratory — Volume II, Chapter 6
Optimal Control of Enterprise Systems
Seed 26206 · Companion to Chapter 6 and AXIOM Lab 2.6 (module AXIOM-06) · Mirrored in DCT_V2_Ch06_Lab.xlsx
This laboratory reproduces Worked Example 6.1, What Is Meridian's Engineering Team Worth?, with the book's declarations, and works the five steps of AXIOM Lab 2.6: simulate, read the Hamiltonian, price capability, solve by shooting and by transcription, and compare. It closes with the chapter's two small capital problems (Figure 6.2). Every Meridian number below is the book's (Table 6.3, Figures 6.1–6.3, Online Appendix 6.B.2–6.B.3); the final cell checks them. Money is in $ million.
The declarations (Worked Example 6.1, Step 1)
The state is workforce capability ; the decision is the rate of hiring and training, , at $4 million a point and at most 2.5 points a quarter (Volume I, Chapter 10). Capability decays at 2.5 percent a quarter, a year in continuous time, so ; the cap points a year keeps Volume I's ceiling of 100 and its time to build exactly. The digital build runs from the first moment capability reaches 55, and from then on capability must stay at or above 55; every year it waits costs $32 million (a quarter of delay is worth $8 million, Volume I, Chapter 15). The automation program needs 55 only at its annual round decisions, and the race restores 55 within half a year, so the value found here is, if anything, low. The board discounts at 10 percent a year, , over an open horizon. The value of a position is minus the present value of hiring and delay. The buyer of part of Industrial Systems pays $112 million net if the engineering team goes with the unit, leaving capability at 53, and $92 million if Meridian keeps it, at 58.
Python Code
import numpy as np
import scipy.sparse as sp
from scipy.integrate import solve_ivp
from scipy.optimize import brentq, linprog
import matplotlib.pyplot as plt
plt.rcParams.update({"figure.dpi": 110, "axes.spines.top": False, "axes.spines.right": False})
SEED = 26206
DELTA = 4 * np.log(1 / 0.975) # attrition: 2.5 percent a quarter, in continuous time a year
UBAR = 100 * DELTA # hiring cap: keeps Volume I's ceiling of 100 (2.5 / 0.025)
K, FLOOR, DELAY, RHO = 4.0, 55.0, 32.0, np.log(1.1)
C_KEPT, C_GONE = 58.0, 53.0 # capability with and without the engineering team
PROCEEDS = {C_KEPT: 92.0, C_GONE: 112.0}
def declare(**changes): # the declarations as a set, so that Panel 8 can vary them
p = dict(delta=DELTA, ubar=UBAR, k=K, floor=FLOOR, delay=DELAY, rho=RHO)
p.update(changes)
return p
P0 = declare()
def annuity(r, T): # present value of 1 a year paid continuously for T years
return (1 - np.exp(-r * T)) / r
def race_time(c0, p=P0): # at the cap from c0 up to the floor: Volume I's time to build
top = p["ubar"] / p["delta"]
return np.log((top - c0) / (top - p["floor"])) / p["delta"] if c0 < p["floor"] else 0.0
def drift_time(c0, p=P0): # hiring nothing, from c0 down to the floor
return np.log(c0 / p["floor"]) / p["delta"] if c0 > p["floor"] else 0.0
def V_floor(p=P0): # pay the rent, delta x floor points a year, forever
return -p["k"] * p["delta"] * p["floor"] / p["rho"]
def V(c0, p=P0): # value of the best plan from c0 above 43.45 (Panel 7): race up to the floor or drift down to it, then the rent
if c0 < p["floor"]:
tau = race_time(c0, p)
return -(p["k"] * p["ubar"] + p["delay"]) * annuity(p["rho"], tau) + np.exp(-p["rho"] * tau) * V_floor(p)
return np.exp(-p["rho"] * drift_time(c0, p)) * V_floor(p)
def price(c0, p=P0): # m = V'(c0) in closed form (Theorem 6.1(iii)); on the floor, the cost of a point
if c0 < p["floor"]:
return (np.exp(-p["rho"] * race_time(c0, p)) * (p["k"] * p["ubar"] + p["delay"] + p["rho"] * V_floor(p))
/ (p["ubar"] - p["delta"] * c0))
if c0 == p["floor"]:
return p["k"]
return np.exp(-p["rho"] * drift_time(c0, p)) * (-p["rho"] * V_floor(p)) / (p["delta"] * c0)
print(f"delta = {DELTA:.5f} a year, cap {UBAR:.3f} points a year (ceiling {UBAR / DELTA:.0f}), rho = {RHO:.5f}; "
f"rho + delta = {RHO + DELTA:.4f}")
print(f"V(53) = {V(C_GONE):.3f}, V(58) = {V(C_KEPT):.3f}: the team is worth V(58) - V(53) = {V(C_KEPT) - V(C_GONE):.3f}")delta = 0.10127 a year, cap 10.127 points a year (ceiling 100), rho = 0.09531; rho + delta = 0.1966 V(53) = -254.892, V(58) = -222.363: the team is worth V(58) - V(53) = 32.529
Panel 1 — Simulate: Volume I's schedules and the race-and-rent plan (Figure 6.3(a); Table 6.3)
AXIOM Lab 2.6, step 1, and Worked Example 6.1, Step 4. The state simulator runs a plan phase by phase — a hiring rate held until capability reaches a level — integrating with the present values of hiring and delay, and starts the digital build the first moment capability reaches 55. Team kept: hire nothing, let attrition take capability to 55 in 2.1 quarters, then pay the rent. Team gone: race at the cap, reach 55 in 1.7 quarters (Volume I's time to build), then pay the rent. Volume I's schedules hold 58; with the team gone, Meridian first rebuilds to 58 at the cap, in 4.44 quarters.
Python Code
def simulate(c0, plan, p=P0, T=150.0):
# Run a plan: phases (hiring rate, level of capability that ends the phase; None = for ever).
# The build starts the first moment capability reaches the floor; beyond T the plan's last rate is
# a perpetuity. Returns the path, the start, the phase ends and the present values.
rates = {"cap": p["ubar"], "nothing": 0.0, "rent": p["delta"] * p["floor"], "hold 58": p["delta"] * 58.0}
t, y = 0.0, np.array([c0, 0.0, 0.0]) # capability, PV of hiring, PV of delay
start = 0.0 if c0 >= p["floor"] else None
ts, cs, rs, ends = [0.0], [c0], [rates[plan[0][0]]], []
for rate, until in plan:
u = rates[rate]
while True:
wait = 1.0 if start is None else 0.0
events = []
if until is not None:
ev = lambda s, z, L=until: z[0] - L
ev.terminal = True
events.append(ev)
if start is None:
st = lambda s, z: z[0] - p["floor"]
st.terminal, st.direction = True, 1
events.append(st)
rhs = lambda s, z: [u - p["delta"] * z[0], p["k"] * u * np.exp(-p["rho"] * s),
p["delay"] * wait * np.exp(-p["rho"] * s)]
sol = solve_ivp(rhs, (t, T), y, events=events or None, rtol=1e-12, atol=1e-12, max_step=0.05)
ts += list(sol.t[1:]); cs += list(sol.y[0, 1:]); rs += [u] * (len(sol.t) - 1)
t, y = sol.t[-1], sol.y[:, -1]
if start is None and abs(y[0] - p["floor"]) < 1e-8:
start = t
if until is None or abs(y[0] - until) < 1e-8 or sol.status == 0:
ends.append(t)
break
tail = np.exp(-p["rho"] * T) * p["k"] * u / p["rho"]
return dict(t=np.array(ts), c=np.array(cs), u=np.array(rs), start=start, ends=ends, hiring=y[1] + tail, delay=y[2])
PLANS = [("Team kept: drift to 55, pay the rent", C_KEPT, [("nothing", 55.0), ("rent", None)]),
("Team gone: race to 55, pay the rent", C_GONE, [("cap", 55.0), ("rent", None)]),
("Volume I: team kept, hold 58", C_KEPT, [("hold 58", None)]),
("Volume I: team gone, rebuild to 58, hold it", C_GONE, [("cap", 58.0), ("hold 58", None)])]
sims = {name: simulate(c0, plan) for name, c0, plan in PLANS}
print(f"{'plan':45s} build starts hiring delay total proceeds less costs")
for name, c0, plan in PLANS:
s = sims[name]
total = s["hiring"] + s["delay"]
print(f"{name:45s} {4 * s['start']:7.3f} q {s['hiring']:7.2f} {s['delay']:7.2f} {total:7.2f} {PROCEEDS[c0] - total:8.2f}")
kept, gone = sims[PLANS[0][0]], sims[PLANS[1][0]]
rebuild = sims[PLANS[3][0]]
print(f"team kept reaches the floor after {4 * kept['ends'][0]:.3f} quarters ({kept['ends'][0]:.4f} years); "
f"team gone after {4 * gone['start']:.3f} quarters ({gone['start']:.4f} years); rebuilt to 58 after {4 * rebuild['ends'][0]:.3f} quarters")
print(f"the simulator against the closed forms: {kept['hiring'] + kept['delay'] + V(C_KEPT):.1e} (kept), "
f"{gone['hiring'] + gone['delay'] + V(C_GONE):.1e} (gone)")
fig, ax = plt.subplots(figsize=(7.6, 3.6))
for name, col, ls, lab in ((PLANS[2][0], "#E65100", ":", "Volume I: hold 58"), (PLANS[3][0], "#1F4E79", ":", "Volume I: rebuild to 58"),
(PLANS[0][0], "#E65100", "-", "team kept: drift, then the rent"), (PLANS[1][0], "#1F4E79", "-", "team gone: race, then the rent")):
s = sims[name]
sel = s["t"] <= 3.0
ax.plot(s["t"][sel], s["c"][sel], color=col, ls=ls, lw=2 if ls == "-" else 1.4, label=lab)
ax.axhline(FLOOR, color="#616161", lw=0.8, ls="--")
ax.plot([gone["start"]], [FLOOR], "o", color="#1F4E79", ms=5)
ax.annotate(f"build starts after {4 * gone['start']:.1f} quarters", xy=(gone["start"], FLOOR), xytext=(0.62, 53.0),
fontsize=8, color="#1F4E79", arrowprops=dict(arrowstyle="-", color="#1F4E79", lw=0.7))
ax.text(2.97, 55.12, "floor 55: pay the rent", fontsize=8, color="#616161", ha="right")
ax.set(xlim=(0, 3), ylim=(52.5, 59.3), xlabel="years after the sale", ylabel="workforce capability (points)",
title="Race or drift to the floor, then pay the rent (seed 26206)")
ax.legend(frameon=False, fontsize=8, loc="center right", bbox_to_anchor=(1.0, 0.585)); plt.tight_layout(); plt.show()plan build starts hiring delay total proceeds less costs Team kept: drift to 55, pay the rent 0.000 q 222.36 0.00 222.36 -130.36 Team gone: race to 55, pay the rent 1.718 q 241.43 13.46 254.89 -142.89 Volume I: team kept, hold 58 0.000 q 246.51 0.00 246.51 -154.51 Volume I: team gone, rebuild to 58, hold it 1.718 q 264.44 13.46 277.90 -165.90 team kept reaches the floor after 2.098 quarters (0.5244 years); team gone after 1.718 quarters (0.4294 years); rebuilt to 58 after 4.443 quarters the simulator against the closed forms: 3.1e-13 (kept), -2.3e-13 (gone)

Panel 2 — Read the Hamiltonian: the cap, the rent or nothing (Theorem 6.2; Figure 6.1(b))
AXIOM Lab 2.6, step 2, and Worked Example 6.1, Step 2. With the price of a point, Meridian's Hamiltonian is : the value earned now plus the value banked in capability. The hiring rate enters only through , so the maximum condition reads off the switching function : hire at the cap when a point is worth more than its $4 million, nothing when it is worth less, any rate — the rent — when it is worth exactly that. Along each best plan the maximized Hamiltonian is the hurdle return on the position's value, , and it changes at times the value banked (Proposition 6.1(iii)).
Python Code
def H(c, u, m, waiting, p=P0): # Equation 6.2 for Meridian: value earned now plus value banked
return -p["k"] * u - p["delay"] * waiting + m * (u - p["delta"] * c)
grid = np.linspace(0, UBAR, 201) # decision values, the cap and zero among them
for c0, where in ((53.0, "at 53, team gone"), (55.0, "on the floor, build running"), (58.0, "at 58, team kept")):
m0 = price(c0)
gain = (m0 - K) * grid
best = grid[gain >= gain.max() - 1e-12]
rule = f"the cap, {best[0]:.2f} a year" if len(best) == 1 and best[0] > 0 else "nothing" if len(best) == 1 else \
f"any rate, the rent {DELTA * FLOOR:.2f} among them"
print(f"{where:28s} price {m0:6.3f} switching function m - 4 = {m0 - K:+.3f} -> hire {rule}")
def best_plan(c0, t): # Panel 1's best plans in closed form: capability, decision, price, delay running
arc = race_time(c0) if c0 < FLOOR else drift_time(c0)
top = UBAR / DELTA
c = np.where(t < arc, top - (top - c0) * np.exp(-DELTA * t) if c0 < FLOOR else c0 * np.exp(-DELTA * t), FLOOR)
u = np.where(t < arc, UBAR if c0 < FLOOR else 0.0, DELTA * FLOOR)
m = np.array([price(x) if s < arc else K for x, s in zip(c, t)])
return c, u, m, ((t < arc) & (c0 < FLOOR)).astype(float), arc
t = np.linspace(0, 3, 3001)
audit = {}
print("\nswitching function m - 4 along each plan, by quarter: " + "".join(f"{q:7.1f}" for q in (0, 0.5, 1, 1.5, 2, 2.5, 3, 4)))
for c0, name in ((C_GONE, "team gone: race, then the rent"), (C_KEPT, "team kept: drift, then the rent")):
c, u, m, waiting, arc = best_plan(c0, t)
sigma = np.interp(np.array([0, 0.5, 1, 1.5, 2, 2.5, 3, 4]) / 4, t, m - K)
Hmax = np.maximum(H(c, 0.0, m, waiting), H(c, UBAR, m, waiting))
gap = Hmax - H(c, u, m, waiting) # the maximum condition: zero
rhoV = RHO * np.array([V(x) if s < arc else V_floor() for x, s in zip(c, t)])
off = t < arc - 1e-3
drift = np.abs(np.gradient(Hmax[off], t[off]) - RHO * m[off] * (u[off] - DELTA * c[off]))[1:-1].max()
audit[c0] = float(np.abs(Hmax - rhoV).max())
print(f"{name:52s}" + "".join(f"{x:+7.2f}" for x in sigma))
print(f" maximum condition: largest gap {gap.max():.0e}; max H - rho V(c): {np.abs(Hmax - rhoV).max():.0e};"
f" d(max H)/dt - rho m f: {drift:.0e} (Proposition 6.1(iii))")
fig, ax = plt.subplots(figsize=(7.6, 3.6))
for c0, col, lab in ((53.0, "#1F4E79", "at 53: price $%.1fm, hire at the cap"), (55.0, "#616161", "on the floor: price $%.0fm, any rate"),
(58.0, "#E65100", "at 58: price $%.1fm, hire nothing")):
m0 = price(c0)
ax.plot(grid, (m0 - K) * grid, color=col, lw=2, label=lab % m0)
ax.plot([UBAR], [(price(53.0) - K) * UBAR], "o", color="#1F4E79", ms=5)
ax.plot([0], [0], "o", color="#E65100", ms=5)
ax.axvline(UBAR, color="#999999", lw=0.6)
ax.set(xlabel="hiring and training u (points a year)", ylabel="(m - 4) u ($ million a year)",
title="The part of the Hamiltonian hiring moves (seed 26206)")
ax.legend(frameon=False, fontsize=8, loc="upper left"); plt.tight_layout(); plt.show()at 53, team gone price 10.130 switching function m - 4 = +6.130 -> hire the cap, 10.13 a year on the floor, build running price 4.000 switching function m - 4 = +0.000 -> hire any rate, the rent 5.57 among them at 58, team kept price 3.608 switching function m - 4 = -0.392 -> hire nothing switching function m - 4 along each plan, by quarter: 0.0 0.5 1.0 1.5 2.0 2.5 3.0 4.0 team gone: race, then the rent +6.13 +6.38 +6.64 +6.90 +0.00 +0.00 +0.00 +0.00 maximum condition: largest gap 0e+00; max H - rho V(c): 1e-14; d(max H)/dt - rho m f: 7e-09 (Proposition 6.1(iii)) team kept: drift, then the rent -0.39 -0.30 -0.21 -0.12 -0.02 +0.00 +0.00 +0.00 maximum condition: largest gap 0e+00; max H - rho V(c): 4e-15; d(max H)/dt - rho m f: 3e-09 (Proposition 6.1(iii))

Panel 3 — Price the floor: the rent and the user cost (Proposition 6.3(ii))
Worked Example 6.1, Step 3. Once the build runs, the cheapest way to keep the commitment is to hold capability exactly at 55 and pay the rent, points a year. On that arc the price of a point stays at its $4 million cost, and the floor's price is the user cost: interest on $4 million at plus attrition at . Paying the rent forever is worth .
Python Code
rent_pts, rent = DELTA * FLOOR, K * DELTA * FLOOR
interest, attrition = RHO * K, DELTA * K
eta = interest + attrition # Proposition 6.3(ii): (rho + delta) k less the earnings of a point on the floor, none
print(f"rent: {rent_pts:.3f} points a year, ${rent:.2f} million a year; paying it forever: V(55) = -rent/rho = {V_floor():.2f}")
print(f"the floor's price: {interest:.4f} interest + {attrition:.4f} attrition = {eta:.4f} a point a year (user cost)")
print(f"costate equation on the floor: dm/dt = (rho + delta) x 4 - 0 - eta = {(RHO + DELTA) * K - eta:.1e}: the price stays at $4 million")
print(f"five points of margin over the floor: 5 x {eta:.4f} = {5 * eta:.2f} a year")rent: 5.570 points a year, $22.28 million a year; paying it forever: V(55) = -rent/rho = -233.76 the floor's price: 0.3812 interest + 0.4051 attrition = 0.7863 a point a year (user cost) costate equation on the floor: dm/dt = (rho + delta) x 4 - 0 - eta = 0.0e+00: the price stays at $4 million five points of margin over the floor: 5 x 0.7863 = 3.93 a year
Panel 4 — Price capability along each plan, checked by finite differences (Theorem 6.1; Figure 6.3(b))
AXIOM Lab 2.6, step 3. Off the floor the costate equation is : the price of a point grows at the hurdle rate plus the attrition rate, 19.7 percent a year, toward the moment it pays. Run it backward from each plan's arrival at the floor — $4 million for the drift, where the floor's price takes over; for the race, a point's cost plus the delay it saves by starting the build sooner — and check it against central finite differences of the best value (Theorem 6.1(iii)). A point is worth $10.1 million at 53, two and a half times its cost, and $3.6 million at 58, less than it costs; the price falls to the cost the moment the build starts (Tobin's above one: build; below: run down).
Python Code
tau, taud = race_time(C_GONE), drift_time(C_KEPT)
m_arrive = K + DELAY / (UBAR - DELTA * FLOOR) # price just below 55: Online Appendix 6.B.3
back = lambda m_end, T_end: solve_ivp(lambda t, m: (RHO + DELTA) * m, (T_end, 0.0), [m_end], rtol=1e-12, atol=1e-12, dense_output=True)
m_gone, m_kept = back(m_arrive, tau), back(K, taud)
fd = lambda c0, h=1e-5: (V(c0 + h) - V(c0 - h)) / (2 * h)
print(f"team gone: price on arrival 4 + 32/{UBAR - DELTA * FLOOR:.3f} = {m_arrive:.3f} "
f"(a point starts the build {1 / (UBAR - DELTA * FLOOR):.2f} years sooner); backward to the sale: {m_gone.sol(0.0)[0]:.3f}")
print(f"team kept: price on arrival $4 million; backward to the sale: {m_kept.sol(0.0)[0]:.3f}; also the floor's price "
f"as earnings from {taud:.4f} years, discounted at rho + delta: {eta * np.exp(-(RHO + DELTA) * taud) / (RHO + DELTA):.3f}")
print(" c price finite difference Tobin's q")
for c0 in (53.0, 54.0, 54.999, 56.0, 58.0, 60.0):
print(f"{c0:7.3f} {price(c0):8.3f} {fd(c0, 1e-6 if c0 == 54.999 else 1e-5):14.3f} {price(c0) / K:13.3f}")
err = []
for s, sol in ((gone, m_gone), (kept, m_kept)):
sel = s["t"] < (tau if s is gone else taud) - 1e-3
err.append(np.abs(sol.sol(s["t"][sel])[0] - [fd(c) for c in s["c"][sel]]).max())
print(f"along the plans, costate against finite differences of V: largest gap {max(err):.1e}")
fig, ax = plt.subplots(figsize=(7.6, 3.6))
tt = np.linspace(0, 3, 601)
ax.axhline(K, color="#616161", lw=0.8, ls="--")
ax.plot(tt[tt < tau], m_gone.sol(tt[tt < tau])[0], color="#1F4E79", lw=2, label="team gone: race, then the rent")
ax.plot(tt[tt >= tau], np.full((tt >= tau).sum(), K), color="#1F4E79", lw=2)
ax.plot([tau, tau], [K, m_arrive], color="#1F4E79", lw=0.8, ls=":")
ax.plot(tt[tt < taud], m_kept.sol(tt[tt < taud])[0], color="#E65100", lw=2, label="team kept: drift, then the rent")
ax.plot(tt[tt >= taud], np.full((tt >= taud).sum(), K), color="#E65100", lw=2, ls=(0, (4, 3)))
for s, T_ in ((gone, tau), (kept, taud)):
pts = np.linspace(0, T_ - 0.03, 6)
ax.plot(pts, [fd(np.interp(t_, s["t"], s["c"])) for t_ in pts], "o", ms=3.5, mfc="none", color="#616161")
ax.plot([], [], "o", ms=3.5, mfc="none", color="#616161", label="finite differences of V")
ax.text(2.95, 4.25, "cost of a point $4m: pay the rent", fontsize=8, color="#616161", ha="right")
ax.set(xlim=(0, 3), ylim=(2, 12.3), xlabel="years after the sale", ylabel="price of a point ($ million)",
title="The price of a point jumps to its cost as the build starts (seed 26206)")
ax.legend(frameon=False, fontsize=8, loc="upper right"); plt.tight_layout(); plt.show()team gone: price on arrival 4 + 32/4.557 = 11.022 (a point starts the build 0.22 years sooner); backward to the sale: 10.130 team kept: price on arrival $4 million; backward to the sale: 3.608; also the floor's price as earnings from 0.5244 years, discounted at rho + delta: 3.608 c price finite difference Tobin's q 53.000 10.130 10.130 2.532 54.000 10.562 10.562 2.640 54.999 11.021 11.021 2.755 56.000 3.863 3.863 0.966 58.000 3.608 3.608 0.902 60.000 3.378 3.378 0.845 along the plans, costate against finite differences of V: largest gap 4.3e-09

Panel 5 — Solve by shooting (Theorem 6.2; Table 6.2)
AXIOM Lab 2.6, step 4, first part: the indirect method. Guess the starting price, run the state and the costate forward with the decision the maximum condition picks, and correct the guess until the end condition holds as capability reaches the floor. For the race, the price on arrival must be a point's cost plus the delay it saves; for the drift, the price must reach the $4 million cost exactly as capability reaches 55, where the floor's price takes over (Proposition 6.3(ii)). Shooting needs the shape of the answer — here a single arc to the floor — before it can find it.
Python Code
def forward(c0, m0, p=P0, T=5.0):
# state and costate forward from (c0, m0), the decision from the maximum condition (Theorem 6.2):
# returns when capability reaches the floor, when the price reaches the cost, and the path
u = p["ubar"] if m0 > p["k"] else 0.0
rhs = lambda t, y: [u - p["delta"] * y[0], (p["rho"] + p["delta"]) * y[1]]
at_floor = lambda t, y: y[0] - p["floor"]
at_cost = lambda t, y: y[1] - p["k"]
sol = solve_ivp(rhs, (0, T), [c0, m0], events=[at_floor, at_cost], rtol=1e-12, atol=1e-12, dense_output=True)
first = lambda e: sol.t_events[e][0] if len(sol.t_events[e]) else np.inf
return first(0), first(1), sol
def miss_race(m0): # price on arrival less a point's cost plus the delay it saves
t_floor, _, sol = forward(C_GONE, m0)
return sol.sol(t_floor)[1] - m_arrive
def miss_drift(m0): # the price must reach the cost as capability reaches the floor
t_floor, t_cost, _ = forward(C_KEPT, m0)
return t_cost - t_floor
def secant(miss, a, b, tol=1e-11): # correct the guess from the last two misses: the shooting loop
fa, fb = miss(a), miss(b)
steps = [(a, fa), (b, fb)]
while abs(fb) > tol and abs(b - a) > 1e-13 and len(steps) < 40:
a, fa, b = b, fb, b - fb * (b - a) / (fb - fa)
fb = miss(b)
steps.append((b, fb))
return b, steps
m0_gone, it_gone = secant(miss_race, 6.0, 8.0)
m0_kept, it_kept = secant(miss_drift, 2.0, 3.0)
print("race from 53: " + ", ".join(f"{g:.4f} (miss {f:+.1e})" for g, f in it_gone))
print("drift from 58: " + ", ".join(f"{g:.4f} (miss {f:+.1e})" for g, f in it_kept))
print(f"shooting's starting prices: {m0_gone:.3f} at 53 and {m0_kept:.3f} at 58 (closed forms {price(C_GONE):.3f} and {price(C_KEPT):.3f})")
t_floor, _, sol = forward(C_GONE, m0_gone)
print(f"the race reaches the floor after {4 * t_floor:.3f} quarters at the price {sol.sol(t_floor)[1]:.3f}; "
f"the Hamiltonian there {H(FLOOR, UBAR, sol.sol(t_floor)[1], 1.0):.3f} = rho V(55) = {RHO * V_floor():.3f}")race from 53: 6.0000 (miss -4.5e+00), 8.0000 (miss -2.3e+00), 10.1297 (miss +3.9e-14) drift from 58: 2.0000 (miss +3.0e+00), 3.0000 (miss +9.4e-01), 3.4553 (miss +2.2e-01), 3.5948 (miss +1.9e-02), 3.6079 (miss +4.0e-04), 3.6082 (miss +7.5e-07), 3.6082 (miss +3.0e-11), 3.6082 (miss -1.0e-15) shooting's starting prices: 10.130 at 53 and 3.608 at 58 (closed forms 10.130 and 3.608) the race reaches the floor after 1.718 quarters at the price 11.022; the Hamiltonian there -22.280 = rho V(55) = -22.280
Panel 6 — Solve by direct transcription, and cross-audit (Section 6.6; Online Appendix 6.B.3)
AXIOM Lab 2.6, step 4, second part: the direct method, handed to the solvers of AXIOM-04. Hold the hiring rate level within each step of a calendar (exact discretization, Volume I, Proposition 7.2), require capability at or above 55 at every grid date from the build's start, charge the delay up to that date, and solve the linear program with HiGHS. Every plan the program allows is a plan of the continuous problem that costs no more than the program says, so the program never beats the closed form (Theorem 5.1(i)) and closes in on it as the calendar is refined: $0.38 million above it on a weekly calendar, $0.02 million on a daily one. Its multipliers price capability on its calendar.
Python Code
def transcribe(c0, k0, h, p=P0, T=60.0):
# Chapter 5's transcription: n steps of h years, decisions u_0..u_{n-1}, states c_1..c_n;
# c_{j+1} = a c_j + b u_j; c_j >= floor for j >= k0; the rent after T years as a perpetuity
n = int(round(T / h)); a = np.exp(-p["delta"] * h); b = (1 - a) / p["delta"]
w = (1 - np.exp(-p["rho"] * h)) / p["rho"]
cost = np.concatenate([p["k"] * w * np.exp(-p["rho"] * h * np.arange(n)), np.zeros(n)])
A_eq = sp.hstack([-b * sp.identity(n), sp.identity(n) - a * sp.eye(n, k=-1)], format="csr")
b_eq = np.zeros(n); b_eq[0] = a * c0
js = np.arange(max(k0, 1), n + 1)
A_ub = sp.csr_matrix((-np.ones(len(js)), (np.arange(len(js)), n + js - 1)), shape=(len(js), 2 * n))
res = linprog(cost, A_ub=A_ub, b_ub=-p["floor"] * np.ones(len(js)), A_eq=A_eq, b_eq=b_eq,
bounds=[(0, p["ubar"])] * n + [(None, None)] * n, method="highs")
if res.status != 0:
return None # the floor cannot be reached by step k0
total = res.fun + p["delay"] * annuity(p["rho"], k0 * h) + np.exp(-p["rho"] * T) * p["k"] * p["delta"] * p["floor"] / p["rho"]
tj = h * np.arange(1, n + 1)
return dict(total=total, u=res.x[:n], c=res.x[n:], k0=k0, h=h,
m=-res.eqlin.marginals * np.exp(p["rho"] * tj), # price of a point at each grid date, current value
eta=-res.ineqlin.marginals * np.exp(p["rho"] * h * js) / h) # the floor's price a point a year
LP = {}
for h, cal, later in ((1 / 52, "weekly", (1, 3, 7, 13)), (1 / 365, "daily", (1, 7))):
first = int(np.ceil(tau / h - 1e-9))
assert transcribe(C_GONE, first - 1, h) is None # one step earlier the floor is out of reach
best, keep = transcribe(C_GONE, first, h), transcribe(C_KEPT, 0, h)
scan = [(first + d, transcribe(C_GONE, first + d, h)["total"]) for d in later]
LP[cal] = dict(first=first, years=first * h, best=best, keep=keep, scan=scan, gap=best["total"] + V(C_GONE),
m_floor=float(np.median(best["m"][first + 5:first + 40])), eta=float(np.median(best["eta"][5:40])))
r = LP[cal]
print(f"{cal:6s}: earliest start step {first} ({r['years']:.4f} years) costs {best['total']:.3f}, {r['gap']:.3f} above the closed form "
f"{-V(C_GONE):.3f}; later starts " + ", ".join(f"{k}: {c:.2f}" for k, c in scan))
print(f" team kept {keep['total']:.4f} (closed form {-V(C_KEPT):.4f}); on the floor the multipliers price a point at "
f"{r['m_floor']:.4f} and the floor at {r['eta']:.4f} a point a year")
wk = LP["weekly"]["best"]
print(f"the weekly plan: {wk['u'][0]:.2f} points a year in the first week, then the cap ({wk['u'][1]:.2f}) to week {wk['k0']}, "
f"capability {wk['c'][wk['k0'] - 1]:.3f} there, then the rent {wk['u'][wk['k0'] + 10]:.3f}: the maximum condition's race and rent")weekly: earliest start step 23 (0.4423 years) costs 255.269, 0.377 above the closed form 254.892; later starts 24: 255.83, 26: 256.94, 30: 259.15, 36: 262.40
team kept 222.3628 (closed form 222.3627); on the floor the multipliers price a point at 4.0076 and the floor at 0.7863 a point a year
daily : earliest start step 157 (0.4301 years) costs 254.914, 0.022 above the closed form 254.892; later starts 158: 254.99, 164: 255.47
team kept 222.3627 (closed form 222.3627); on the floor the multipliers price a point at 4.0011 and the floor at 0.7863 a point a year
the weekly plan: 6.93 points a year in the first week, then the cap (10.13) to week 23, capability 55.000 there, then the rent 5.570: the maximum condition's race and rent
Panel 7 — Certify and value the team (Theorem 6.3; Table 6.3; Online Appendix 6.B.3)
Worked Example 6.1, Step 5. The team-kept plan is certified by Theorem 6.3: the Hamiltonian and the floor are linear, the price path meets the costate equation with the floor's multiplier, and every feasible path stays at or above the plan's. The race passes through the region where the delay makes the problem lumpy, so the theorem does not apply; its closed form certifies it instead. At every level from which racing beats never starting the build — every level above 43.4 — it satisfies the dynamic-programming condition . A test the certificate must survive: thousands of random feasible plans, none of which may do better. The team is worth .
Python Code
c_a = brentq(lambda c: V(c) + DELAY / RHO, 30.0, 54.9, xtol=1e-12)
print(f"racing beats never starting the build (the delay forever, {DELAY / RHO:.2f}) above c_a = {c_a:.2f}")
levels = np.concatenate([np.linspace(c_a + 0.01, 54.99, 300), np.linspace(55.01, 75.0, 300)])
def hjb(c0): # rho V - max over u of {-4u - 32 1{c < 55} + V'(u - delta c)}: the maximum is at 0 or the cap
d = DELAY if c0 < FLOOR else 0.0
return RHO * V(c0) - max(-K * u - d + price(c0) * (u - DELTA * c0) for u in (0.0, UBAR))
dp_residual = max(abs(hjb(c)) for c in levels)
print(f"dynamic-programming condition, {len(levels)} levels from c_a to 75: largest residual {dp_residual:.1e};"
f" below the floor V' >= {min(price(c) for c in np.linspace(c_a, 54.9999, 2001)):.2f} > 4")
mk = [price(c) for c in kept["c"][(kept["t"] < taud)]]
print(f"Theorem 6.3, team kept: H = -4u + m(u - delta c) is linear; the price rises from {mk[0]:.3f} to 4 on the drift; "
f"on the floor m = 4 and the multiplier {eta:.4f} >= 0; e^(-rho t) m (c - 55) >= 0 for every feasible path")
rng = np.random.default_rng(SEED)
def random_plans(c0, n=6000, weeks=260, h=1 / 52, p=P0):
# Feasible plans, hiring held level each week for five years. Until the build runs: any rate, the cap
# with random dips, or a random wait and then the cap; once it runs, the hiring that keeps capability at
# or above 55 plus a random excess. After five years, the best continuation from where each stands.
# The costs are exact: within a week capability moves one way, so the start is found exactly.
a, b = np.exp(-p["delta"] * h), (1 - np.exp(-p["delta"] * h)) / p["delta"]
w = (1 - np.exp(-p["rho"] * h)) / p["rho"]
kind, week = rng.integers(0, 3, (n, 1)), np.arange(weeks)[None, :]
before = np.where(kind == 0, rng.uniform(0, p["ubar"], (n, weeks)),
np.where(kind == 1, p["ubar"] * (1 - rng.beta(0.5, 6.0, (n, weeks))),
p["ubar"] * (week >= rng.integers(0, 30, (n, 1)))))
excess = rng.exponential(rng.uniform(0, 1, (n, 1)), (n, weeks))
c, cost = np.full(n, c0), np.zeros(n)
start = np.full(n, 0.0 if c0 >= p["floor"] else np.inf)
for j in range(weeks):
running = np.isfinite(start)
u = np.where(running, np.maximum(0.0, (p["floor"] - a * c) / b) + excess[:, j], before[:, j])
u = np.minimum(u, p["ubar"])
c1 = a * c + b * u
cross = ~running & (c1 >= p["floor"])
top = u[cross] / p["delta"]
start[cross] = j * h + np.log((top - c[cross]) / (top - p["floor"])) / p["delta"]
cost += p["k"] * u * w * np.exp(-p["rho"] * h * j)
c = c1
T = weeks * h
cost += p["delay"] * annuity(p["rho"], np.minimum(start, T))
cost += np.exp(-p["rho"] * T) * -np.array([V(x, p) for x in c])
return cost
for c0, name in ((C_GONE, "from 53"), (C_KEPT, "from 58")):
costs = random_plans(c0)
print(f"{len(costs)} random feasible plans {name} (seed {SEED}): the cheapest costs {costs.min():.3f}, "
f"{costs.min() + V(c0):.4f} more than the closed form {-V(c0):.3f}; plans that do better: {(costs < -V(c0)).sum()}")
print("(these plans start the build the moment capability reaches 55; the transcription of Panel 6 starts it on a grid date)")
hire_race = K * UBAR * annuity(RHO, tau); delay_race = DELAY * annuity(RHO, tau)
rent_later = (np.exp(-RHO * tau) - np.exp(-RHO * taud)) * -V_floor()
team = V(C_KEPT) - V(C_GONE)
print(f"team worth {team:.2f} = {hire_race:.2f} hiring the rebuild needs + {delay_race:.2f} delay + {rent_later:.2f} rent starting later;"
f" net of the buyer's $20 million, keep it by {team - 20:.2f}")
top = UBAR / DELTA
t58 = np.log((top - C_GONE) / (top - C_KEPT)) / DELTA
table63 = [("Team kept: drift to 55, pay the rent", 0.0, -V(C_KEPT), 0.0, PROCEEDS[C_KEPT]),
("Team gone: race to 55, pay the rent", 4 * tau, -V(C_GONE) - delay_race, delay_race, PROCEEDS[C_GONE]),
("Volume I: team kept, hold 58", 0.0, K * DELTA * 58 / RHO, 0.0, PROCEEDS[C_KEPT]),
("Volume I: team gone, rebuild to 58, hold it", 4 * tau,
K * UBAR * annuity(RHO, t58) + np.exp(-RHO * t58) * K * DELTA * 58 / RHO, delay_race, PROCEEDS[C_GONE])]
print(f"\n{'Table 6.3':45s} starts (q) hiring delay proceeds less costs simulator")
for (name, q, hire, dl, proceeds), (_, c0, _) in zip(table63, PLANS):
s = sims[name]
print(f"{name:45s} {q:7.1f} {hire:9.1f} {dl:7.1f} {proceeds - hire - dl:12.1f} {abs(s['hiring'] + s['delay'] - hire - dl):12.1e}")
net = [proceeds - hire - dl for _, _, hire, dl, proceeds in table63]
print(f"holding 58 costs {table63[2][2] - table63[0][2]:.2f} more than the drift; rebuilding to 58 costs "
f"{table63[3][2] - table63[1][2]:.2f} more than the race; keeping leads by {net[0] - net[1]:.2f} (best plans), "
f"{net[2] - net[3]:.2f} (Volume I's schedules)")racing beats never starting the build (the delay forever, 335.75) above c_a = 43.45 dynamic-programming condition, 600 levels from c_a to 75: largest residual 1.4e-14; below the floor V' >= 7.07 > 4 Theorem 6.3, team kept: H = -4u + m(u - delta c) is linear; the price rises from 3.608 to 4 on the drift; on the floor m = 4 and the multiplier 0.7863 >= 0; e^(-rho t) m (c - 55) >= 0 for every feasible path 6000 random feasible plans from 53 (seed 26206): the cheapest costs 254.893, 0.0011 more than the closed form 254.892; plans that do better: 0 6000 random feasible plans from 58 (seed 26206): the cheapest costs 222.363, 0.0002 more than the closed form 222.363; plans that do better: 0 (these plans start the build the moment capability reaches 55; the transcription of Panel 6 starts it on a grid date) team worth 32.53 = 17.04 hiring the rebuild needs + 13.46 delay + 2.02 rent starting later; net of the buyer's $20 million, keep it by 12.53 Table 6.3 starts (q) hiring delay proceeds less costs simulator Team kept: drift to 55, pay the rent 0.0 222.4 0.0 -130.4 3.1e-13 Team gone: race to 55, pay the rent 1.7 241.4 13.5 -142.9 2.4e-13 Volume I: team kept, hold 58 0.0 246.5 0.0 -154.5 5.7e-13 Volume I: team gone, rebuild to 58, hold it 1.7 264.4 13.5 -165.9 3.6e-13 holding 58 costs 24.15 more than the drift; rebuilding to 58 costs 23.01 more than the race; keeping leads by 12.53 (best plans), 11.39 (Volume I's schedules)
Panel 8 — Compare: test the declarations (Worked Example 6.1, Step 6)
AXIOM Lab 2.6, step 5. The answer rests on declarations the board owns: Volume I's attrition range, 6 to 11 percent a year (the cap held at 2.5 points a quarter); a cap of 2.0 points a quarter; a quarter of delay worth $4 million or $16 million; and a floor with five points of margin, at 60, because capability is surveyed to points (Volume I, Worked Example 16.1). Record the value of the team under each.
Python Code
def attrition(a): # a percent a year; the cap stays 2.5 points a quarter
dq = 1 - (1 - a) ** 0.25
return declare(delta=-np.log(1 - a), ubar=-np.log(1 - a) * 2.5 / dq)
SCENARIOS = [("base", P0), ("attrition 6% a year", attrition(0.06)), ("attrition 11% a year", attrition(0.11)),
("cap 2.0 points a quarter", declare(ubar=0.8 * UBAR)), ("a quarter of delay worth $4m", declare(delay=16.0)),
("a quarter of delay worth $16m", declare(delay=64.0)), ("floor 60: five points of margin", declare(floor=60.0))]
sens = {}
print(f"{'declaration':32s} team price at 53 race (q) drift (q)")
for name, p in SCENARIOS:
sens[name] = (V(C_KEPT, p) - V(C_GONE, p), price(C_GONE, p), 4 * race_time(C_GONE, p), 4 * drift_time(C_KEPT, p))
tv, m53, rq, dq = sens[name]
print(f"{name:32s} {tv:6.2f} {m53:10.2f} {rq:9.2f} {dq:9.2f}")
p60 = declare(floor=60.0)
print(f"with the floor at 60 the team-kept plan races {4 * race_time(C_KEPT, p60):.2f} quarters to it; the margin costs "
f"5 x {eta:.4f} = {5 * eta:.2f} a year")
values = [v[0] for v in sens.values()]
print(f"the team is worth {min(values):.1f} to {max(values):.1f}: a $20 million ask is below every figure; "
f"a $30 million ask is above {sum(v < 30 for v in values)} of them")declaration team price at 53 race (q) drift (q) base 32.53 10.13 1.72 2.10 attrition 6% a year 28.40 8.39 1.19 3.43 attrition 11% a year 35.21 11.25 2.08 1.82 cap 2.0 points a quarter 42.28 14.33 3.04 2.10 a quarter of delay worth $4m 25.80 6.90 1.72 2.10 a quarter of delay worth $16m 45.99 16.58 1.72 2.10 floor 60: five points of margin 48.52 8.70 6.37 0.00 with the floor at 60 the team-kept plan races 1.93 quarters to it; the margin costs 5 x 0.7863 = 3.93 a year the team is worth 25.8 to 48.5: a $20 million ask is below every figure; a $30 million ask is above 2 of them
Panel 9 — Two small capital problems: a rising cost and a linear one (Proposition 6.2; Figure 6.2)
The chapter's generic shapes (Online Appendix 6.B.2), not Meridian. One stock of capital, , earns 1 a year a unit, decays at 10 percent and is discounted at 8 percent over eight years, with no terminal value; a unit costs . The costate equation gives the price whatever the plan, , because the earnings and the dynamics are linear in the stock. With a quadratic cost of effort, , every decision follows from the costate in closed form, while positive (the rule), and the costate is checked as the marginal value of capital. With a linear cost and investment capped at 1 a year, the switching function gives a bang-bang plan with a single switch. With diminishing earnings over an open horizon, a maintained stock is raced to its level and held (Figure 6.2(c)).
Python Code
v, d6, r6, T6, k6, kap = 1.0, 0.10, 0.08, 8.0, 3.0, 4.0
m6 = lambda t: v / (r6 + d6) * (1 - np.exp(-(r6 + d6) * (T6 - t)))
t_s = T6 + np.log(1 - k6 * (r6 + d6) / v) / (r6 + d6)
u_bang = lambda t: np.where(m6(t) > k6, 1.0, 0.0)
u_smooth = lambda t: np.maximum(0.0, (m6(t) - k6) / kap)
print(f"price of a unit: {m6(0):.3f} at the start, falling through the unit cost {k6:.0f} at {t_s:.3f} years, to 0 at year 8")
print(f"rising cost: invest (m - 3)/4, {u_smooth(0.0):.3f} a year at the start, 0 from {t_s:.2f} years; linear cost: the cap until {t_s:.2f}, then nothing")
def value_from(t0, x0, u, cost): # value of what remains of a plan from date t0 with stock x0, its decisions held fixed
f = lambda t, y: [u(t) - d6 * y[0], np.exp(-r6 * (t - t0)) * (v * y[0] - cost(u(t)))]
return solve_ivp(f, (t0, T6), [x0, 0.0], rtol=1e-12, atol=1e-12, max_step=0.01).y[1, -1]
quad_cost, lin_cost = (lambda u: k6 * u + kap * u ** 2 / 2), (lambda u: k6 * u)
for t0 in (0.0, 2.0, t_s, 6.0):
x0, e = 10.0, 1e-3
fd6 = (value_from(t0, x0 + e, u_smooth, quad_cost) - value_from(t0, x0 - e, u_smooth, quad_cost)) / (2 * e)
print(f" at {t0:5.3f} years: costate {m6(t0):.4f}, marginal value of capital by finite differences {fd6:.4f}")
switches = np.flatnonzero(np.diff(u_bang(np.linspace(0, T6, 8001))))
print(f"linear cost: the switching function changes sign {len(switches)} time(s), at {np.linspace(0, T6, 8001)[switches[0] + 1]:.3f} years")
# a transcription of the linear problem on a weekly calendar, earnings within each week exact, finds the same switch
h6 = 1 / 52; n6 = int(round(T6 / h6)); wk6 = np.arange(n6); disc6 = np.exp(-r6 * h6 * wk6)
a6, w6, A6 = np.exp(-d6 * h6), (1 - np.exp(-r6 * h6)) / r6, (1 - np.exp(-(r6 + d6) * h6)) / (r6 + d6)
b6, B6 = (1 - a6) / d6, (w6 - A6) / d6
gain = v * (B6 * disc6 + A6 * b6 * np.array([np.sum(a6 ** (wk6[j + 1:] - j - 1) * disc6[j + 1:]) for j in range(n6)]))
res6 = linprog(k6 * w6 * disc6 - gain, bounds=[(0, 1)] * n6, method="highs")
weeks_on = res6.x.round(9)
print(f"weekly transcription of the linear problem: the cap for {weeks_on.sum():.0f} weeks, then nothing "
f"({np.count_nonzero(np.diff(weeks_on))} switch, at the end of week {weeks_on.sum():.0f}: {weeks_on.sum() * h6:.2f} years)")
lev, cap6 = 60.0, 12.0
print(f"race to the level 60 (cap 12, decay 10 percent): from 35 in {np.log((cap6 / d6 - 35) / (cap6 / d6 - lev)) / d6:.2f} years; "
f"from 75 by decay in {np.log(75 / lev) / d6:.2f} years; then the rent {d6 * lev:.0f} a year")
fig, ax = plt.subplots(figsize=(7.6, 3.6))
tt = np.linspace(0, T6, 801)
ax.plot(tt, u_bang(tt), color="#1F4E79", lw=2, label="linear cost, capped at 1: bang-bang")
ax.plot(tt, u_smooth(tt), color="#E65100", lw=2, ls=(0, (4, 2)), label="cost 3u + 4u²/2: smooth, (m - 3)/4")
ax.axvline(t_s, color="#616161", lw=0.8, ls=":")
ax.text(t_s + 0.1, 0.62, f"price falls through\nthe unit cost: {t_s:.2f} years", fontsize=8, color="#616161")
ax.set(xlim=(0, 8), ylim=(-0.05, 1.3), xlabel="years", ylabel="investment (units a year)",
title="One switch with a linear cost; a smooth plan with a rising one (seed 26206)")
ax.legend(frameon=False, fontsize=8, loc="upper right"); plt.tight_layout(); plt.show()price of a unit: 4.239 at the start, falling through the unit cost 3 at 3.686 years, to 0 at year 8 rising cost: invest (m - 3)/4, 0.310 a year at the start, 0 from 3.69 years; linear cost: the cap until 3.69, then nothing at 0.000 years: costate 4.2393, marginal value of capital by finite differences 4.2393 at 2.000 years: costate 3.6689, marginal value of capital by finite differences 3.6689 at 3.686 years: costate 3.0000, marginal value of capital by finite differences 3.0000 at 6.000 years: costate 1.6796, marginal value of capital by finite differences 1.6796 linear cost: the switching function changes sign 1 time(s), at 3.686 years weekly transcription of the linear problem: the cap for 192 weeks, then nothing (1 switch, at the end of week 192: 3.69 years) race to the level 60 (cap 12, decay 10 percent): from 35 in 3.48 years; from 75 by decay in 2.23 years; then the rent 6 a year

Validation — the book's numbers, and agreement with DCT_V2_Ch06_Lab.xlsx
Each checkpoint is a number printed in Chapter 6 (Worked Example 6.1, Table 6.3, Figures 6.1–6.3) or in
Online Appendix 6.B.2–6.B.3. The workbook recomputes the ones marked workbook with Excel formulas and shows
PASS against the same engine values on its Checks sheet.
Python Code
checks = [
("race 53 to 55, quarters (workbook)", 4 * tau, 1.718, 5e-4),
("drift 58 to 55, quarters (workbook)", 4 * taud, 2.098, 5e-4),
("rebuild 53 to 58 at the cap, quarters (workbook)", 4 * t58, 4.443, 5e-4),
("simulator: build starts, team gone (quarters)", 4 * gone["start"], 1.718, 5e-4),
("rent at the floor, $ a year (workbook)", rent, 22.28, 5e-3),
("V(55), the rent forever (workbook)", V_floor(), -233.76, 5e-3),
("floor's price, user cost (workbook)", eta, 0.7863, 5e-5),
("V(58) (workbook)", V(C_KEPT), -222.363, 5e-4),
("V(53) (workbook)", V(C_GONE), -254.892, 5e-4),
("team V(58) - V(53) (workbook)", team, 32.53, 5e-3),
("team: hiring the rebuild needs (workbook)", hire_race, 17.04, 5e-3),
("team: delay (workbook)", delay_race, 13.46, 5e-3),
("team: rent starting later (workbook)", rent_later, 2.02, 5e-3),
("price of a point at 53 (workbook)", price(C_GONE), 10.130, 5e-4),
("price of a point at 54 (workbook)", price(54.0), 10.562, 5e-4),
("price as capability reaches 55 (workbook)", m_arrive, 11.022, 5e-4),
("price of a point at 56 (workbook)", price(56.0), 3.863, 5e-4),
("price of a point at 58 (workbook)", price(C_KEPT), 3.608, 5e-4),
("price of a point at 60 (workbook)", price(60.0), 3.378, 5e-4),
("finite difference of V at 53 (workbook)", fd(C_GONE), 10.130, 5e-4),
("shooting: starting price, race (workbook)", m0_gone, 10.130, 5e-4),
("shooting: starting price, drift (workbook)", m0_kept, 3.608, 5e-4),
("transcription weekly: start week (workbook)", LP["weekly"]["first"], 23, 0),
("transcription weekly: cost (workbook)", LP["weekly"]["best"]["total"], 255.269, 5e-4),
("transcription weekly: cost, start week 36 (workbook)", LP["weekly"]["scan"][-1][1], 262.40, 5e-3),
("transcription daily: start day (workbook)", LP["daily"]["first"], 157, 0),
("transcription daily: above the closed form (workbook)", LP["daily"]["gap"], 0.022, 5e-4),
("transcription: team kept, weekly (workbook)", LP["weekly"]["keep"]["total"], 222.363, 5e-4),
("transcription: price on the floor, weekly (workbook)", LP["weekly"]["m_floor"], 4.008, 5e-4),
("transcription: floor's price, daily (workbook)", LP["daily"]["eta"], 0.7863, 5e-5),
("racing beats never starting above (workbook)", c_a, 43.45, 5e-3),
("hold 58 less the drift (workbook)", table63[2][2] - table63[0][2], 24.15, 5e-3),
("rebuild to 58 less the race (workbook)", table63[3][2] - table63[1][2], 23.01, 5e-3),
("Table 6.3: team gone, proceeds less costs (workbook)", net[1], -142.89, 5e-3),
("Table 6.3: rebuild to 58, proceeds less costs (workbook)", net[3], -165.90, 5e-3),
("team, attrition 6% a year (workbook)", sens["attrition 6% a year"][0], 28.40, 5e-3),
("team, attrition 11% a year (workbook)", sens["attrition 11% a year"][0], 35.21, 5e-3),
("team, cap 2.0 a quarter (workbook)", sens["cap 2.0 points a quarter"][0], 42.28, 5e-3),
("team, delay $4m a quarter (workbook)", sens["a quarter of delay worth $4m"][0], 25.80, 5e-3),
("team, delay $16m a quarter (workbook)", sens["a quarter of delay worth $16m"][0], 45.99, 5e-3),
("team, floor 60 (workbook)", sens["floor 60: five points of margin"][0], 48.52, 5e-3),
("capital problem: price at the start (workbook)", m6(0.0), 4.239, 5e-4),
("capital problem: switch, years (workbook)", t_s, 3.686, 5e-4),
("capital problem: smooth investment at the start (workbook)", u_smooth(0.0), 0.310, 5e-4),
]
ok = 0
for name, got, want, tol in checks:
status = "PASS" if abs(got - want) <= tol else "FAIL"; ok += status == "PASS"
print(f"{name:56s} {got:11.4f} book {want:10.4f} {status}")
print(f"\n{ok} of {len(checks)} checkpoints PASS")race 53 to 55, quarters (workbook) 1.7176 book 1.7180 PASS drift 58 to 55, quarters (workbook) 2.0977 book 2.0980 PASS rebuild 53 to 58 at the cap, quarters (workbook) 4.4426 book 4.4430 PASS simulator: build starts, team gone (quarters) 1.7176 book 1.7180 PASS rent at the floor, $ a year (workbook) 22.2797 book 22.2800 PASS V(55), the rent forever (workbook) -233.7596 book -233.7600 PASS floor's price, user cost (workbook) 0.7863 book 0.7863 PASS V(58) (workbook) -222.3627 book -222.3630 PASS V(53) (workbook) -254.8921 book -254.8920 PASS team V(58) - V(53) (workbook) 32.5295 book 32.5300 PASS team: hiring the rebuild needs (workbook) 17.0429 book 17.0400 PASS team: delay (workbook) 13.4632 book 13.4600 PASS team: rent starting later (workbook) 2.0234 book 2.0200 PASS price of a point at 53 (workbook) 10.1297 book 10.1300 PASS price of a point at 54 (workbook) 10.5615 book 10.5620 PASS price as capability reaches 55 (workbook) 11.0218 book 11.0220 PASS price of a point at 56 (workbook) 3.8625 book 3.8630 PASS price of a point at 58 (workbook) 3.6082 book 3.6080 PASS price of a point at 60 (workbook) 3.3784 book 3.3780 PASS finite difference of V at 53 (workbook) 10.1297 book 10.1300 PASS shooting: starting price, race (workbook) 10.1297 book 10.1300 PASS shooting: starting price, drift (workbook) 3.6082 book 3.6080 PASS transcription weekly: start week (workbook) 23.0000 book 23.0000 PASS transcription weekly: cost (workbook) 255.2688 book 255.2690 PASS transcription weekly: cost, start week 36 (workbook) 262.4001 book 262.4000 PASS transcription daily: start day (workbook) 157.0000 book 157.0000 PASS transcription daily: above the closed form (workbook) 0.0217 book 0.0220 PASS transcription: team kept, weekly (workbook) 222.3628 book 222.3630 PASS transcription: price on the floor, weekly (workbook) 4.0076 book 4.0080 PASS transcription: floor's price, daily (workbook) 0.7863 book 0.7863 PASS racing beats never starting above (workbook) 43.4462 book 43.4500 PASS hold 58 less the drift (workbook) 24.1475 book 24.1500 PASS rebuild to 58 less the race (workbook) 23.0117 book 23.0100 PASS Table 6.3: team gone, proceeds less costs (workbook) -142.8921 book -142.8900 PASS Table 6.3: rebuild to 58, proceeds less costs (workbook) -165.9039 book -165.9000 PASS team, attrition 6% a year (workbook) 28.4025 book 28.4000 PASS team, attrition 11% a year (workbook) 35.2144 book 35.2100 PASS team, cap 2.0 a quarter (workbook) 42.2795 book 42.2800 PASS team, delay $4m a quarter (workbook) 25.7979 book 25.8000 PASS team, delay $16m a quarter (workbook) 45.9926 book 45.9900 PASS team, floor 60 (workbook) 48.5214 book 48.5200 PASS capital problem: price at the start (workbook) 4.2393 book 4.2390 PASS capital problem: switch, years (workbook) 3.6860 book 3.6860 PASS capital problem: smooth investment at the start (workbook) 0.3098 book 0.3100 PASS 44 of 44 checkpoints PASS
Next. Chapter 7 lets capability move as it will, not as planned: dynamic programming values every position on a calendar, its slope prices capability wherever Meridian stands, and the race-and-rent plan becomes a rule with a margin over the floor. AXIOM-06 runs this chapter's model interactively (Lab 2.6); this notebook and the workbook are its reproducible record.


