5D Library › Insulin-Glucagon Bistability, Visceral Lipolysis Kinetics and Linear-Programming Diet Optimization · 中文
Chapter 5. The Mineral the Diet Takes Away
Why a low-carbohydrate week costs salt
The complaints that arrive in the first week of a low-carbohydrate diet, the headache, the light head on standing, the cramp in the calf at night, are not detoxification and not an adaptation that has to be endured. They are the predictable consequence of a sodium loss, and the mechanism is the same insulin fall the whole plan is built around. Boulter, Hoffman and Arky measured the pattern directly in fasting subjects and found a brisk natriuresis in the first days, after which excretion settles (Boulter et al. 1973). Cahill’s review places the same observation in the sequence of fasting adaptations (Cahill 2006). Insulin is a sodium-retaining hormone at the renal tubule; when it falls, sodium goes, water follows it, and the kidney’s handling of potassium and magnesium shifts with it.
Evidence
Published. Boulter, Hoffman and Arky measured sodium excretion through starvation and described the early natriuresis and its later settling (Boulter et al. 1973). Cahill’s review sets the renal handling of sodium inside the broader sequence of fasting adaptations (Cahill 2006).
So a plan that lowers insulin on purpose creates an obligation it rarely acknowledges: it has to put the minerals back. That turns into an optimisation problem, because the obligation competes with the energy budget, with the cost of food, and with what anyone will actually eat.
Calculation
# Chapter 5. p09: Meeting the electrolyte floors at the lowest cost. A
# low-carbohydrate week lowers insulin, and low insulin makes the kidney
# excrete sodium, which drags potassium and magnesium with it, so the
# floors below are the ones a careful plan holds. Nine items, nought to
# three portions of each, every one of the 262,144 combinations priced
# by exhaustive search. Composition figures are rounded from published
# food tables; the prices are illustrative. The whole-food-only run
# repeats the search with the three added salts and capsules removed.
ITEMS = (
# name, sodium, potassium, magnesium (mg), kcal, cost
("avocado 150 g", 11, 727, 44, 240, 1.20),
("spinach 180 g", 126, 839, 157, 41, 0.90),
("almonds 28 g", 0, 208, 76, 164, 0.45),
("pumpkin seeds 28 g", 5, 223, 156, 158, 0.50),
("salmon 150 g", 75, 534, 44, 310, 3.50),
("bone broth 250 ml", 860, 110, 10, 40, 1.10),
("table salt 2.5 g", 970, 0, 0, 0, 0.01),
("lite salt 2 g", 0, 1050, 0, 0, 0.05),
("magnesium capsule", 0, 0, 100, 0, 0.12),
)
WHOLE = 6 # the first six items are whole foods
FLOOR = (3000, 3500, 400) # sodium, potassium, magnesium, mg a day
KCAL_CAP = 900 # kcal these items may take of the day
MAXP = 3
def search(items):
n = len(items)
best = None
counts = [0] * n
while True:
na = k = mg = kcal = 0
cost = 0.0
for i, c in enumerate(counts):
if c:
_, a, b, m, e, p = items[i]
na += a * c
k += b * c
mg += m * c
kcal += e * c
cost += p * c
if (na >= FLOOR[0] and k >= FLOOR[1] and mg >= FLOOR[2]
and kcal <= KCAL_CAP):
if best is None or cost < best[0] - 1e-12:
best = (cost, tuple(counts), na, k, mg, kcal)
i = 0
while i < n:
counts[i] += 1
if counts[i] <= MAXP:
break
counts[i] = 0
i += 1
if i == n:
break
return best
if __name__ == "__main__":
print(" floors: sodium {} mg, potassium {} mg, magnesium {} mg"
.format(*FLOOR))
print(" energy these items may take: {} kcal".format(KCAL_CAP))
for label, items in (("all nine items", ITEMS),
("whole foods only", ITEMS[:WHOLE])):
best = search(items)
if best is None:
print(" {}: no combination meets the floors".format(label))
continue
cost, counts, na, k, mg, kcal = best
print(" {}: cheapest plan costs {:.2f}".format(label, cost))
for i, c in enumerate(counts):
if c:
print(" {} x {}".format(c, items[i][0]))
print(" sodium {} mg, potassium {} mg, magnesium {} mg,"
" {} kcal".format(na, k, mg, kcal))
print(" slack: sodium {} mg, potassium {} mg,"
" magnesium {} mg".format(na - FLOOR[0], k - FLOOR[1],
mg - FLOOR[2]))
a = search(ITEMS)
b = search(ITEMS[:WHOLE])
print(" whole foods cost {:.2f} more and bring {} kcal more"
.format(b[0] - a[0], b[5] - a[5]))
print(" ratio of the two costs: {:.2f}".format(b[0] / a[0]))
print(" the cheap plan spends {:.3f} of its cost on the three salts"
" and capsules".format(sum(a[1][i] * ITEMS[i][5]
for i in range(WHOLE, len(ITEMS)))
/ a[0]))
# floors: sodium 3000 mg, potassium 3500 mg, magnesium 400 mg
# energy these items may take: 900 kcal
# all nine items: cheapest plan costs 1.44
# 1 x spinach 180 g
# 3 x table salt 2.5 g
# 3 x lite salt 2 g
# 3 x magnesium capsule
# sodium 3036 mg, potassium 3989 mg, magnesium 457 mg, 41 kcal
# slack: sodium 36 mg, potassium 489 mg, magnesium 57 mg
# whole foods only: cheapest plan costs 9.95
# 3 x spinach 180 g
# 1 x almonds 28 g
# 1 x salmon 150 g
# 3 x bone broth 250 ml
# sodium 3033 mg, potassium 3589 mg, magnesium 621 mg, 717 kcal
# slack: sodium 33 mg, potassium 89 mg, magnesium 221 mg
# whole foods cost 8.51 more and bring 676 kcal more
# ratio of the two costs: 6.91
# the cheap plan spends 0.375 of its cost on the three salts and capsulesAllowed the three salts and capsules, the cheapest day that clears all three floors costs 1.44 and takes 41 kcal: one portion of spinach with three of table salt, three of lite salt and three magnesium capsules, delivering 3036, 3989 and 457 milligrams against floors of 3000, 3500 and 400. Restricted to whole foods, the cheapest day costs 9.95 and takes 717 kcal, a cost ratio of 6.91 and 676 kcal more. The exhaustive search over all 262144 combinations is what makes those figures claims rather than guesses: no cheaper combination exists inside the stated list and ceilings.
The 676 kcal are the part that matters, because the plan in Chapter 6 has only about 1800 of them to spend. Spending 717 of them on minerals leaves little for protein. This is the arithmetic behind a piece of advice that otherwise sounds like supplement marketing: on a deliberately low-insulin diet the salts are not an upsell, they are what keeps the energy budget solvable at all.
Which foods carry minerals without carrying energy
The same list ranked a different way shows where the pressure comes from.
Calculation
# Chapter 5. p10: Which foods carry electrolytes without carrying energy.
# For every item of p09 this prints the milligrams of each electrolyte a
# hundred kilocalories buy, and the money a gram of each electrolyte
# costs from that item. An item with no energy is listed as unlimited on
# the first measure, which is the point of a salt: it adds the mineral
# without adding a single kilocalorie to the day's budget.
ITEMS = (
("avocado 150 g", 11, 727, 44, 240, 1.20),
("spinach 180 g", 126, 839, 157, 41, 0.90),
("almonds 28 g", 0, 208, 76, 164, 0.45),
("pumpkin seeds 28 g", 5, 223, 156, 158, 0.50),
("salmon 150 g", 75, 534, 44, 310, 3.50),
("bone broth 250 ml", 860, 110, 10, 40, 1.10),
("table salt 2.5 g", 970, 0, 0, 0, 0.01),
("lite salt 2 g", 0, 1050, 0, 0, 0.05),
("magnesium capsule", 0, 0, 100, 0, 0.12),
)
def per_100kcal(mg, kcal):
return None if kcal == 0 else 100.0 * mg / kcal
def cost_per_g(cost, mg):
return None if mg == 0 else 1000.0 * cost / mg
def show(v, width, digits, blank="no energy"):
if v is None:
return "{:<{}}".format(blank, width)
return "{:<{}.{}f}".format(v, width, digits)
if __name__ == "__main__":
print(" milligrams per 100 kcal")
print(" item sodium potassium magnesium")
for name, na, k, mg, kcal, cost in ITEMS:
print(" {:<22}{}{}{}"
.format(name, show(per_100kcal(na, kcal), 11, 1),
show(per_100kcal(k, kcal), 11, 1),
show(per_100kcal(mg, kcal), 11, 1)))
print(" money per gram of mineral")
print(" item sodium potassium magnesium")
for name, na, k, mg, kcal, cost in ITEMS:
print(" {:<22}{}{}{}"
.format(name, show(cost_per_g(cost, na), 11, 3, "none"),
show(cost_per_g(cost, k), 11, 3, "none"),
show(cost_per_g(cost, mg), 11, 3, "none")))
best_k = min((cost_per_g(c, k), n) for n, _, k, _, _, c in ITEMS
if k > 0)
best_mg = min((cost_per_g(c, m), n) for n, _, _, m, _, c in ITEMS
if m > 0)
best_na = min((cost_per_g(c, a), n) for n, a, _, _, _, c in ITEMS
if a > 0)
print(" cheapest gram of sodium: {} at {:.3f}"
.format(best_na[1], best_na[0]))
print(" cheapest gram of potassium: {} at {:.3f}"
.format(best_k[1], best_k[0]))
print(" cheapest gram of magnesium: {} at {:.3f}"
.format(best_mg[1], best_mg[0]))
dense = max((per_100kcal(k, kc) + per_100kcal(m, kc), n)
for n, _, k, m, kc, _ in ITEMS if kc > 0)
print(" densest whole food per 100 kcal: {}".format(dense[1]))
print(" it carries {:.1f} mg of potassium and magnesium together"
.format(dense[0]))
worst = min((per_100kcal(k, kc) + per_100kcal(m, kc), n)
for n, _, k, m, kc, _ in ITEMS if kc > 0)
print(" least dense: {} at {:.1f} mg".format(worst[1], worst[0]))
print(" ratio between the densest and the least dense: {:.1f}"
.format(dense[0] / worst[0]))
# milligrams per 100 kcal
# item sodium potassium magnesium
# avocado 150 g 4.6 302.9 18.3
# spinach 180 g 307.3 2046.3 382.9
# almonds 28 g 0.0 126.8 46.3
# pumpkin seeds 28 g 3.2 141.1 98.7
# salmon 150 g 24.2 172.3 14.2
# bone broth 250 ml 2150.0 275.0 25.0
# table salt 2.5 g no energy no energy no energy
# lite salt 2 g no energy no energy no energy
# magnesium capsule no energy no energy no energy
# money per gram of mineral
# item sodium potassium magnesium
# avocado 150 g 109.091 1.651 27.273
# spinach 180 g 7.143 1.073 5.732
# almonds 28 g none 2.163 5.921
# pumpkin seeds 28 g 100.000 2.242 3.205
# salmon 150 g 46.667 6.554 79.545
# bone broth 250 ml 1.279 10.000 110.000
# table salt 2.5 g 0.010 none none
# lite salt 2 g none 0.048 none
# magnesium capsule none none 1.200
# cheapest gram of sodium: table salt 2.5 g at 0.010
# cheapest gram of potassium: lite salt 2 g at 0.048
# cheapest gram of magnesium: magnesium capsule at 1.200
# densest whole food per 100 kcal: spinach 180 g
# it carries 2429.3 mg of potassium and magnesium together
# least dense: almonds 28 g at 173.2 mg
# ratio between the densest and the least dense: 14.0Per hundred kilocalories, spinach carries 2046.3 milligrams of potassium and 382.9 of magnesium, which is why it appears in the cheap plan; almonds carry 126.8 and 46.3. Between the densest whole food and the least dense the ratio is 14.0. Measured in money instead, the cheapest gram of sodium is 0.010 from table salt, the cheapest gram of potassium 0.048 from lite salt, and the cheapest gram of magnesium 1.200 from a capsule, against 1.279, 1.073 and 3.205 from the best whole-food sources. For sodium the ordinary salt cellar beats the best food by more than a hundred times.
Note
Floors are not targets and not ceilings. The three numbers in p09 are the floors a plan should clear, not amounts anyone should aim to exceed. Sodium in particular has an upper bound that matters for people with high blood pressure or heart or kidney disease, and the potassium figures in this chapter are dangerous for anyone with reduced kidney function or taking a potassium-sparing diuretic, an angiotensin-converting-enzyme inhibitor or an angiotensin-receptor blocker, in whom added potassium can be fatal. Chapter 8 computes how large that group is. This chapter is an optimisation exercise, not a supplement schedule.
Hypothesis · not established
The author’s interpretation (not yet tested): most of what is described as the adaptation period of a low-carbohydrate diet is sodium depletion, and a plan that clears the sodium floor from day one will show the symptom cluster largely absent rather than merely shortened. What would show it wrong: in a randomised comparison of an identical low-carbohydrate diet with and without sodium replacement that clears the floor, if headache, postural light-headedness and cramp occurred at similar rates in the first week in both arms, the depletion account would be wrong.
Summary
Lowering insulin on purpose makes the kidney excrete sodium, and the plan has to put it back. An exhaustive search over 262144 combinations puts the cheapest compliant day at 1.44 with salts allowed and 9.95 from whole food alone, a ratio of 6.91, and the whole-food route costs 676 extra kilocalories out of a budget that does not have them. Chapter 6 takes the same constraints and solves the whole day as a linear programme.
References
Fan, Y. (2026). Insulin-Glucagon Bistability, Visceral Lipolysis Kinetics and Linear-Programming Diet Optimization: Hepatic Glycogen Depletion Times, Triglyceride-Glucose Indices and Micronutrient-Constrained Menus [胰岛素胰高血糖素双稳态、内脏脂解动力学与线性规划配餐] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090248 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).